Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
11 years ago

ALtera DE2-115 GPIO input

Hi guys, I'm connecting a light sensor interface to a GPIO pin, the output of the sensor is high when light intensity is high and vice verse if the the light intensity is low, now I want to know, how to write a Verilog code to switch in a LED whenever the light intensity is low.

I tried if (lightIntensity == 1'b0) but it didn't work, specifically, HOW ALtera read the GPIO input?

--I'm an ultimate beginner, so forgive me :D any help appreciated :)

3 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Did you assign the input and output signals to the proper fpga pins?

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Yes sure, I want to know how specifcally the input of the sensor enter the Altera, is it abstract 0 and 1? Binary digits? Or decimel or what??

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I can't understand your question. You just said the sensor output is simply 1 or 0 depending on light intensity.

    How can it become decimal or binary digits wen entering fpga?

    Infact I understand your device is a simple on/off sensor switching at a fixed light threshold.

    You'd have to manage a decimal or binary value only if you had a sensor capable to measure the actual ligh level.

    But in that case the sensor would have a parallel or serial connection.