09 March 2025

Team19: Progress review

Our controller is going to be for the online Nitrome game called Knuckleheads, it’s going to have two stylized handles on the ends where the players can grab and use to stretch or squash the controller in order to complete the game mechanic that requires the player to expand and contract the distance between the player characters- the controller will have a smaller piece that slides out and into the larger piece easily so the player can accomplish this mechanic. There will be an unconventional switch within the controller that tells the circuit whether or not it’s opened or closed, and we will use the embedded accelerometer within the adafruit playground to allow the player to move left or right.

  1. Pseudo Code for KnuckleHeads controller First of all, we start the code by including the libraries adafruit_circuitplaygrond.h and the keyboard.h after we create the setup function circuit playground begin our serial for taking notes pinmode input for our electrical current (used for the stretch and squash) our delay
    And we move to our void loop. The first function on it is grabbing the Z motion on the accelerometer to then be able to control the rotation of the knucklehead, we do this with: float z = circuitplayground.motionZ(); and we print it out to keep track of it. Afterwards we create an if else statementwhere if z<-8 we press the key down arrow, and release key up arrow. else, press key up arrow and release key down arrow. (here it might be good to think about a way to have the sensor not move if it does not detect rotation, will come back to this later) this should give us our up and down inputs. In terms of the stretching and squashing of the controller, we're using the electrical current received into the adafruit in a certain pin. The functions go as follows: int CurrentState = digitalread(the pin we use) Then after we get our current state, we create another else if statement if the state is high keyboard press left arrow key keyboard release right arrow key else the state is low keyboard press right arrow key keyboard release left arrow key + our delay






No comments:

Post a Comment

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