Arduino/ABRO/ABRO.ino
2017-03-13 08:28:12 +01:00

36 lines
468 B
C++

#include "ABROModel.c"
// Declarations
void setup() {
// Initializations
pinMode(11, INPUT);
pinMode(8, INPUT);
pinMode(5, INPUT);
pinMode(13, OUTPUT);
// Init model file
reset();
}
void loop() {
// Inputs
A = digitalRead(11) ? HIGH : LOW;
B = digitalRead(8) ? HIGH : LOW;
R = digitalRead(5) ? HIGH : LOW;
// Reaction of model
tick();
// Outputs
if (O) {
digitalWrite(13, HIGH);
} else {
digitalWrite(13, LOW);
}
}