Cookie555
Published © GPL3+

Arduino + Geometry Dash!

This is an Arduino joystick(?) controlling 1 of the versions of geometry dash!

IntermediateShowcase (no instructions)4,827
Arduino + Geometry Dash!

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Resistor 10k ohm
Resistor 10k ohm
×1
Male/Female Jumper Wires
Male/Female Jumper Wires
×3
RobotGeek Pushbutton
RobotGeek Pushbutton
×1

Software apps and online services

Arduino IDE
Arduino IDE
Processing

Story

Read more

Schematics

The Wiring

This is the same as digital read serial in the Arduino examples

Code

My code

Java
The first half is the Arduino code and the 2nd is processing code.
The code is C and Java
int butten = 2;

void setup() {
  Serial.begin(9600);
}

void loop(){
  int buttenState = digitalRead(butten);
  Serial.println(buttenState);
  delay(2);
}// dab more

//------------------Processing code below, paste below------

/* (begin) import processing.serial.*;
Serial myPort;
int X=10;
int Y=200;
PFont font;
float inByte;
void setup(){
  size(1000,400);
  font=createFont("Arial-BoldItalicMT-48",50);
   println(Serial.list());
   myPort = new Serial(this, Serial.list()[0], 9600);
   myPort.bufferUntil('\n');
}

void draw(){
  background(#000000);
  fill(226,160,18);
  rect(0,300,1000,100);
  rect(0,0,1000,100);
  fill(255,246,0);
  rect(950,100,50,200);
  fill( #00FF00 );
  rect(X,Y,10,10);
  X=X+1;
  if(inByte>=1){
    Y=Y-1;
  } else{
    Y=Y+1;
  }
  if(X>950){
    textFont(font);
    text("YOU DID IT!!!",500,200);
    X=975;
    Y=200;
  }
  if(Y>300||Y<100){
    text("YOU LOSE!!!",500,200);
    X=10;
    Y=200;
  }
}

void serialEvent (SerialcPort) {
  // get the ASCII string:
  String inString = myPort.readStringUntil('\n');

  if (inString != null) {
    // trim off any whitespace:
    inString = trim(inString);
    // convert to an int and map to the screen height:
    inByte = float(inString);
    println(inByte);
  }
}//dab more
(end)*/

Credits

Cookie555
1 project • 1 follower
Contact
Thanks to Arduino.

Comments

Please log in or sign up to comment.