22 October 2023

Scaffolding: Progress Review - Michael Kocis (Frogger)

My controller is for Frogger. It is a plush frog that utilizes the accelerometer and conductive nylon tape as input mechanisms. The accelerometer is used to control moving left and right. It checks if the frog plush has been moved, simulating making the frog jump to either side. The conductive nylon tape is going to be on each leg of the frog and when the front legs or back legs are touched together, the frog will move in that direction. Touching the front legs together moves the character forward and back legs together moves the character back to simulate the movement of the frog jumping in either direction. Current would flow through one leg into the other when they’re touching, which would signal the keyboard press for moving forward or back. The concept is that you are controlling the movement of the Frogger frog in real life, manipulating its jumping and foot movements.

Sketch:


Schematic:

Psuedocode:
setup() {
    set two pin values to input (pin1, pin2)
}

loop() {
    // Get values for motion and pins
    m = accelerometerMotionValue
    pin1State = digitalRead(pin1)
    pin2State = digitalRead(pin2)

    if m > 1
        Press key 'd' // if tilt right, move right
        delay()
    else if m < -1
        Press key 'a' // if tilt left, move left
        delay()
    else if pin1State is active
        Press key 'w' // if front legs connect, move forward
        delay()
    else if pin2State is active
        Press key 's' // if rear legs connect, move back
        delay()
}

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.