This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #include <Automaton.h> | |
| Atm_player player; // A player machine with 32 bit patterns | |
| Atm_button button1, button2; | |
| // These pins correspond to bitmap positions | |
| const int8_t pin[] = { | |
| 4, 5, 6, 7, 8, 9, 10, 11, | |
| 12, 13, -1, -1, -1, -1, -1, -1, | |
| -1, -1, -1, -1, -1, -1, -1, -1, | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #include <Automaton.h> | |
| Atm_led led1, led2, led3, led4; | |
| Atm_timer timer; | |
| void setup() { | |
| Serial.begin( 9600 ); | |
| led1.begin( 4 ).blink( 500 / 14.4, 500 / 14.4 ).start(); // 14.4 Hz | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #include <Automaton.h> | |
| #include "Atm_trafficlight.h" | |
| Atm_trafficlight tl1, tl2; | |
| Atm_button button; | |
| Atm_timer timer; | |
| Atm_led led; | |
| void setup() { | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #pragma once | |
| #include <Automaton.h> | |
| class Atm_stepper: public Machine { | |
| public: | |
| enum { IDLE, START, STEP_HIGH, STEP_LOW, LOOP, DONE }; // STATES | |
| enum { EVT_TIMER, EVT_COUNTER, EVT_START, EVT_STOP, ELSE }; // EVENTS | |
| Atm_stepper( void ) : Machine() {}; | 
OlderNewer