This tutorial will show you how to build a bluetooth controlled ARDUINO dice shaker game.
Click on video below for full tutorial…
The APP:
ARDUINO Code:
#define shaker 3
void setup() {
Serial.begin(9600);
pinMode(shaker, OUTPUT);
}
void loop() {
if (Serial.available() >= 2 )
{
unsigned int a = Serial.read();
unsigned int b = Serial.read();
unsigned int val = (b * 256) + a;
delay(1000);
analogWrite(shaker, 175);
delay(val);
digitalWrite(shaker, LOW);
}
}