This commit is contained in:
Martin Brodbeck 2024-02-09 14:05:15 +01:00
parent 304615961e
commit fada15a167

View file

@ -6,15 +6,31 @@
namespace
{
const uint LED_PIN = PICO_DEFAULT_LED_PIN;
const uint LEFT_PADDLE_PIN = 2;
const uint RIGHT_PADDLE_PIN = 5;
}
void setup()
{
stdio_init_all();
sleep_ms(1000);
gpio_init(LED_PIN);
gpio_set_dir(LED_PIN, GPIO_OUT);
gpio_put(LED_PIN, 0);
// Setup pins for left and right paddles
gpio_init(LEFT_PADDLE_PIN);
gpio_set_dir(LEFT_PADDLE_PIN, GPIO_IN);
gpio_pull_down(LEFT_PADDLE_PIN);
gpio_init(RIGHT_PADDLE_PIN);
gpio_set_dir(RIGHT_PADDLE_PIN, GPIO_IN);
gpio_pull_down(RIGHT_PADDLE_PIN);
}
int main()
{
stdio_init_all();
sleep_ms(1000);
gpio_init(LED_PIN);
gpio_set_dir(LED_PIN, GPIO_OUT);
gpio_put(LED_PIN, 0);
setup();
Settings settings{read_settings()};