28 March 2021

Progress Review: Pepsi Can

In this project, I’m using a Pepsi can to control a game called soda man, which features a Pepsi colored man running around a neighborhood collecting as many cans as he can while dodging many different obstacles in his path. After all, if you’re going to play a Pepsi themed game, it might as well have a Pepsi themed controller to go with it.

 

How this controller works is that it’ll use the sound sensor and accelerometer as a replacement for the control keys and spacebar. While running, you tilt the can left and right to move accordingly, tilting it up to jump and tilting it down to slide. Once you acquire enough cans to boost, you can scream near the can. Once the sound sensor hits a certain threshold, it’ll activate the boost.

 

                                


 

#include <Adafruit_CircuitPlayground.h>
#include <Adafruit_Circuit_Playground.h>
 
//Variables for accelerometer
//Variables for sound sensor
 
void setup() {
// put your setup code here, to run once:
  CircuitPlayground.begin();
}

void loop() {
     //accelerometer setup
      float x = CircuitPlayground.motionX();
      float y = CircuitPlayground.motionY();

      //correction of the accelerometer

      //if Y hits a certain threshold, activate up button
      //else Y hits a certain threshold, activate down button

      //move left or right depending on X's float

      //if sound sensor hits a certain threshold, activate boost
}

 

Questions:

1.)  The can honestly might be a bit too small for the components going inside of it. If that’s the case, what alternative method of storing it would you suggest? A litter bottle seems too big and a smaller bottle seems rather lopsided.

2.)    Do you think the sound sensor could be replaced with something more efficient? I like the idea of screaming loudly while playing this but if it’s in a can it might not register as efficiently as it would with a different method.

No comments:

Post a Comment

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