23 March 2025

Scaffolding: Prototype Review Team 15

 Our group has decided to make a controller for the Nitrome game Knuckleheads. Our controller can expand and contract based on how far the player wants the character in-game to stretch, and uses tilt controls in order to move the character left or right within the platformer. The player will use the controller to navigate the game and to try and beat the various levels. We have out circuit playground attached inside of the main point of the controller and are going to use metal bits that will act as a switch in order to tell the computer whether or not the character is to be expanded or not. We’re going to implement two handles on the side of the controller for easy access for the player to grab.


Controller Prototype:


Circuit Prototype: 




Video:



#include <Adafruit_CircuitPlayground.h> #include <Adafruit_Circuit_Playground.h> #include <Keyboard.h> #define CURRENT_PIN 1 const int inputPin = A3; void setup() { // put your setup code here, to run once: //after we create the setup function Serial.begin(9600); CircuitPlayground.begin(); pinMode(CURRENT_PIN, INPUT); delay(500); //pinMode input for our electrical current (used for the stretch and squash) pinMode(inputPin, INPUT_PULLUP); } void loop() { // put your main code here, to run repeatedly: if (digitalRead(inputPin) == LOW) { Serial.println("Current detected! Pressing DOWN Key"); Keyboard.press('s'); Keyboard.release('w'); } else { Serial.println("No current detected. Pressing UP Key"); Keyboard.press('w'); Keyboard.release('s'); } float z = CircuitPlayground.motionZ(); if (z<-8) { Serial.println("GOING DOWN! Pressing LEFT key"); Keyboard.press('a'); Keyboard.release('d'); } else { Serial.println("GOING UP! Pressing RIGHT key"); Keyboard.press('d'); Keyboard.release('a'); } delay(100); }

No comments:

Post a Comment

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