gangstagaming
Published © GPL3+

Cookie Clicker Game

A small Snapino project that hooks up to your computer and acts as a clicker game.

BeginnerFull instructions provided1,677
Cookie Clicker Game

Things used in this project

Hardware components

Snapino
Snap Circuits Snapino
×1

Software apps and online services

Arduino Web Editor
Arduino Web Editor

Story

Read more

Schematics

Cookie Clicker Game

A picture of the circuit used for the project.

Code

Cookie Clicker Game

Arduino
Cookie Clicker Game Code
//Cookie_Clicker

const int button = 9;
int Val = 0;
int oldVal = HIGH;
int counter = 0;

void setup() {
  Serial.begin(9600);
  pinMode(button, INPUT);
}

void loop() {
    Val = digitalRead(button);          //Check the button
  if((Val == HIGH) && (oldVal == LOW)){ 
    ++counter;
    Serial.print("                               Cookies: ");
    Serial.print(counter);
    //Add to the counter when the button is pressed and display it on the screen
  }
  oldVal = Val;
  delay(10);
}

Credits

gangstagaming

gangstagaming

0 projects • 0 followers

Comments