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_button btn[8]; | |
| int btnPins[8] = { 3, 4, 5, 6, 7, 8, 9, 10 }; | |
| void button_callback( int idx, int v, int up ) { | |
| if ( v ) { | |
| //player.playTrack( idx ); | |
| } |
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_button button; | |
| Atm_led motor; | |
| void button_change( int press ) | |
| { | |
| if ( !press ) { // On a release | |
| motor.trigger( EVT_BLINK ); // Send a blink message to the motor | |
| } |
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; | |
| Atm_button button; | |
| static int pattern[] = { | |
| 2, 2000, 0, | |
| 3, 4000, 0, | |
| 4, 3000, 0, | |
| }; |
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_analog sensor[4]; // 4 analog inputs | |
| Atm_timer timer; | |
| uint16_t avgbuffer[4][32]; // 4 buffers with 32 entries | |
| const char aPin[] = { A0, A1, A2, A3 }; | |
| 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
| #include "Atm_trafficlight.h" | |
| /* Add optional parameters for the state machine to begin() | |
| * Add extra initialization code | |
| */ | |
| Atm_trafficlight& Atm_trafficlight::begin( int pin_g, int pin_y, int pin_r ) { | |
| // clang-format off | |
| const static state_t state_table[] PROGMEM = { | |
| /* ON_ENTER ON_LOOP ON_EXIT EVT_TIMER_G EVT_TIMER_Y EVT_TIMER_R EVT_NEXT EVT_GREEN EVT_YELLOW EVT_RED ELSE */ |
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_esp8266.h> | |
| Atm_esp8266_wifi wifi; | |
| Atm_esp8266_httpd_simple server( 80 ); | |
| void setup() { | |
| Serial.begin( 9600 ); | |
| wifi.begin( "MySSID", "MyPASSWORD" ) | |
| .onChange( true, server, server.EVT_START ) |
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_esp8266.h> | |
| // Control a blinking led with a toggle button and a browser | |
| Atm_esp8266_wifi wifi; | |
| Atm_esp8266_httpd_simple server( 80 ); | |
| Atm_led led; | |
| Atm_button button; |
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_esp8266.h> | |
| Atm_esp8266_wifi wifi; | |
| Atm_esp8266_httpd_simple server( 80 ); | |
| Atm_led led; | |
| void setup() { | |
| Serial.begin( 9600 ); |
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> | |
| /* | |
| http://paulmurraycbr.github.io/ArduinoTheOOWay.html | |
| The OP has a bike headlamp. this headlamp has a button that you can press 5 times to cycle | |
| through 5 output settings, and a power switch. the OP would like to have one button to | |
| control it. A long click should turn the lamp on and off, and a short click should cycle | |
| the brightness. Furthermore, when the lamp is turned on, the OP would like the arduino to | |
| cycle the light up to its previous level of brightness. The outputs to cycle the lamp |
OlderNewer