37 lines
468 B
Arduino
37 lines
468 B
Arduino
|
#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);
|
||
|
}
|
||
|
|
||
|
}
|