First draft of binary dice

This commit is contained in:
Dan Buch 2013-12-29 22:03:12 -05:00
parent 3c7e37f7a3
commit 742fa9d141
2 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,22 @@
const unsigned int LED_BIT0 = 10;
const unsigned int LED_BIT1 = 11;
const unsigned int LED_BIT2 = 12;
void outputResult(const long result) {
digitalWrite(LED_BIT0, result & B001);
digitalWrite(LED_BIT1, result & B010);
digitalWrite(LED_BIT2, result & B100);
}
void setup() {
pinMode(LED_BIT0, OUTPUT);
pinMode(LED_BIT1, OUTPUT);
pinMode(LED_BIT2, OUTPUT);
randomSeed(analogRead(A0));
outputResult(random(1, 7));
}
void loop() {
}

1
arduino/BinaryDice/Makefile Symbolic link
View File

@ -0,0 +1 @@
../arduino.mk