User Tools

Site Tools


notes:c4eng:fall2024:projects:ptb0

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
notes:c4eng:fall2024:projects:ptb0 [2024/10/12 19:40] – [GPIO MODE SETTING] skephartnotes: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 for ptb0 we need to change the mode of the LED to output. We do this through the line of code "pinMode (LED, OUTPUT);". The "LED" factor in the parentheses is simply whatever variable name you assigned to the LED when you initialized it.+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 "pinMode (LED, OUTPUT);". The "LED" factor in the parentheses is simply whatever variable name you assigned to the LED pin when you initialized it.
 ====GPIO COMMAND-LINE TESTING==== ====GPIO COMMAND-LINE TESTING====
 ====wiringPi: digitalWrite()==== ====wiringPi: digitalWrite()====
Line 23: 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 "pinMode (button, OUTPUT);". The "button" factor in the parentheses is simply whatever variable name you assigned to the button pin when you initialized it.
 ====VERIFYING CORRECT CIRCUIT CONNECTION==== ====VERIFYING CORRECT CIRCUIT CONNECTION====
 ====wiringPi: digitalRead()==== ====wiringPi: digitalRead()====
notes/c4eng/fall2024/projects/ptb0.1728762033.txt.gz · Last modified: 2024/10/12 19:40 by skephart