First draft of binary dice
This commit is contained in:
parent
3c7e37f7a3
commit
742fa9d141
22
arduino/BinaryDice/BinaryDice.ino
Normal file
22
arduino/BinaryDice/BinaryDice.ino
Normal 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
1
arduino/BinaryDice/Makefile
Symbolic link
@ -0,0 +1 @@
|
||||
../arduino.mk
|
Loading…
Reference in New Issue
Block a user