Jason's notes

Week7 Duplex Serial Communication

Lab: Duplex Serial Communication

For this week’s lab, I made a Flappy Bird controller. You can click the button to jump, and when the bird hit any obstacle, the red LED will also turn on.

// waiting for hit event
if (Serial.available() > 0) {
  if (Serial.read() == 0) {
    digitalWrite(ledPin, LOW);
  } else {
    digitalWrite(ledPin, HIGH);
  }
}

// send jump command
if (buttonState == HIGH) {
  Serial.println("jump");
}

DEMO

Arduino Code

P5.js Sketch (Arranged from Flappy Bird by Daniel Shiffman)

Project 2 Idea

Inspired from Kay and Wendy’s project idea. I also want to build a accessible game which have not only visual feedback but vibration as well. I still haven’t figure out the game but for the physical part. I’ll make a glove or hat which have several vibraton motor on. These motor will give physical feedback that gives the player clue.

Link to Kay’s blog

Link to Wendy’s blog