User Tools

Site Tools


notes:c4eng:fall2024:projects:ptb0

This is an old revision of the document!


PTB0

LED

GPIO MODE SETTING

GPIO COMMAND-LINE TESTING

wiringPi: digitalWrite()

pico: gpio_put()

The gpio_put() function is a command given to the computer relating to the input of a statement. The “gpio” corresponds to the gp-pin of the pico designated for the code to run through, with “put” being the command that tells the computer that a code is to be “put” into the command. An example is the wiring of an LED; the LED will only be lit up with the gpio_put () function if its “power” wiring is correctly placed in the denoted gp-pin.

BUTTON

GPIO MODE SETTING

VERIFYING CORRECT CIRCUIT CONNECTION

wiringPi: digitalRead()

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 “gpio” corresponds to the gp-pin of the pico designated for the code to run through, with “get” being the command that tells the computer that a code is to be “pulled” from the command. The code the computer needs to “get” must be the same code given to the computer in the corresponding gpio_put () function written in the same command box. An example is the use of a button to light up an LED; the LED is given a designated gp-pin to be wired to, but the gpio_get () function can tell the computer that the LED should only be lit it if the wired button is pushed down, and turned off when the button is released.

notes/c4eng/fall2024/projects/ptb0.1728563874.txt.gz · Last modified: 2024/10/10 12:37 by dnayo