Started implementing controller state machine
This commit is contained in:
parent
f1ca1097ae
commit
245f2c80ae
1 changed files with 7 additions and 1 deletions
|
@ -31,7 +31,6 @@ MCP2515 mcp2515(10);
|
||||||
|
|
||||||
uint8_t state = STATE_INACTIVE;
|
uint8_t state = STATE_INACTIVE;
|
||||||
|
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
Serial.begin(9600);
|
Serial.begin(9600);
|
||||||
mcp2515.reset();
|
mcp2515.reset();
|
||||||
|
@ -65,4 +64,11 @@ void start_hello() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
|
if (state == STATE_INACTIVE) {
|
||||||
|
start_hello();
|
||||||
|
} else if (state == STATE_HELLO) {
|
||||||
|
// Group hello messages from controllers and register them
|
||||||
|
} else if (state == STATE_GAME) {
|
||||||
|
// Game loop
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue