Skip to content
Snippets Groups Projects
Commit 89411e6a authored by ajk1e20's avatar ajk1e20
Browse files

Upload New File

parents
Branches
No related tags found
No related merge requests found
#include "pico/stdlib.h"
int main() {
//const uint buttonOne = ?;
const uint ledOne = 0;
const uint button = 20;
//gpio_init(buttonOne);
gpio_init(ledOne);
gpio_init(button);
//gpio_set_dir(buttonOne, ?);
gpio_set_dir(ledOne, GPIO_OUT);
gpio_set_dir(button, GPIO_IN);
//Write your own code to turn a LED on when button is pressed
if (!gpio_get(button)) {
gpio_put(LED_PIN, 1);
}
else {
gpio_put(LED_PIN, 0);
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment