06 April 2022

Scaffolding: Progress Review

 












Below is my sketch for how I want my controller box to look like as of now. A cool idea that I had was to make buttons out of some blank plastic dice that I have left over from a board game kit. I could paint these dice to customize them for my controller. It shouldn't be too hard making them into buttons. The game that I am making my controller for is Jump King. Jump King is a really difficult game that is all about jumping up to the top of the world. To control the game with my controller I am going to do one button for left, one for right, and one button for jumping.



Schematic:

Code:
{
#include <Keyboard.h>
#include <Adafruit_CircuitPlayground.h>
#include <Adafruit_Circuit_Playground.h>

const int debounce = 100;
const int threshold = 500;


void setup()
    {
CircuitPlayground.begin();
pinMode(CPlay_SLIDESWITCHPIN, INPUT_PULLUP);
pinMode(CPLAY_LEFTBUTTON, INPUT_PULLDOWN);
pinMode(CPLAY_RIGHTBUTTON, INPUT_PULLDOWN);
Keyboard.begin();
    }

void loop()
    {
if(digitalRead(CPLAY_LEFTBUTTON))
{
Keyboard.write('A');
delay(debounce);
}
if(digitalRead(CPLAY_RIGHTBUTTON))
{
Keyboard.write('D');
delay(debounce);
}
if(CircuitPlayground.readCap(A3) > threshold && digitalRead(CPLAY_SLIDESWITCHPIN))
{
Keyboard.write(' ');
delay(debounce);
}

Serial.print(CircuitPlayground.readCap(A3));
Serial.print("\t");
Serial.println(analogRead(A2));
}

Questions:
1: How would you implement a mechanic like charge jumping into a controller like this?
2: What do you think of the box design with the dice buttons? Is it creative enough or should I go with another idea?


No comments:

Post a Comment

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