This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
notes:c4eng:fall2024:projects:ptb0 [2024/10/11 17:58] – [wiringPi: digitalWrite()] dprado | notes:c4eng:fall2024:projects:ptb0 [2024/10/12 19:43] (current) – [GPIO MODE SETTING] skephart | ||
---|---|---|---|
Line 5: | Line 5: | ||
====GPIO MODE SETTING==== | ====GPIO MODE SETTING==== | ||
+ | In order to allow for the LED that is connected to the circuit to be turned on and off through the code of the program we need to change the mode of the pin that the LED is connected through, to output. We do this through the line of code " | ||
====GPIO COMMAND-LINE TESTING==== | ====GPIO COMMAND-LINE TESTING==== | ||
====wiringPi: | ====wiringPi: | ||
Line 22: | Line 23: | ||
====GPIO MODE SETTING==== | ====GPIO MODE SETTING==== | ||
+ | In order to allow for the button that is connected to the circuit to be used as an actual input for the code and to power the light through the code of the program for ptb0 we need to ensure that the mode of the pin the button is connected to is set to input. We do this through the line of code " | ||
====VERIFYING CORRECT CIRCUIT CONNECTION==== | ====VERIFYING CORRECT CIRCUIT CONNECTION==== | ||
====wiringPi: | ====wiringPi: | ||
+ | While digitalWrite() will send voltage to a gpio pin in " | ||
====pico: gpio_get()==== | ====pico: gpio_get()==== | ||
The gpio_get() function is a command given to the computer relating to the output of a statement and is the opposite of the gpio_put() function. The " | The gpio_get() function is a command given to the computer relating to the output of a statement and is the opposite of the gpio_put() function. The " |