Project template for TV Pong - The final project of the Raspberry Pi Pico (RP2040) Deep Dive Course.


   Good luck!

const int player1Up = 4;
const int player1Down = 5;
const int player2Up = 6;
const int player2Down = 7;

void setup() {
  Serial1.println("The game begins...");
  pinMode(player1Up, INPUT_PULLUP);
  pinMode(player1Down, INPUT_PULLUP);
  pinMode(player2Up, INPUT_PULLUP);
  pinMode(player2Down, INPUT_PULLUP);

void checkInput(int pin, String keyName) {
  if (!digitalRead(pin)) {
    delay(200); // poor man's debouncing

void loop() {
  checkInput(player1Up, "Player1: Up");
  checkInput(player1Down, "Player1: Down");
  checkInput(player2Up, "Player2: Up");
  checkInput(player2Down, "Player2: Down");
  delay(1); // This really speeds up the simulation in accurate clock mode