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
| /* <--- Arduino SbS Simple String Parser example ---> | |
| * | |
| * This sketch shows how to receive a String from the serial | |
| * monitor and parse it so that the first and second characters | |
| * are returned. Once you have this information, you can use | |
| * it to control connected devices, like an array of LEDs. | |
| * | |
| * For example, if you type '03O' (letter 'O'), the parses | |
| * will detect '3' as the pin number and 'O' as the | |
| * command, and will turn On an LED conected to digital pin 3. |
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
| /* | |
| 2. Blink | |
| 3. Turns on an LED on for one second, then off for one second, repeatedly. | |
| 4. Most Arduinos have an on-board LED you can control. On the UNO, MEGA and ZERO | |
| 5. it is attached to digital pin 13, on MKR1000 on pin 6. LED_BUILTIN is set to | |
| 6. the correct LED pin independent of which board is used. | |
| 7. If you want to know what pin the on-board LED is connected to on your Arduino model, check | |
| 8. the Technical Specs of your board at https://www.arduino.cc/en/Main/Products |
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 "RGBLED.hpp" | |
| // Pin mapping for the first RGBLED object: | |
| const byte redLed = 3; | |
| const byte greenLed = 5; | |
| const byte blueLed = 6; | |
| // The RGBLED object defaults to common cathode configuration. | |
| RGBLED rgbLed(redLed, greenLed, blueLed); | |
| 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
| // the setup function runs once when you press reset or power the board | |
| void setup() { | |
| // initialize digital pin LED_BUILTIN as an output. | |
| pinMode(13, OUTPUT); | |
| } | |
| // the loop function runs over and over again forever | |
| void loop() { | |
| make_it_blink(); | |
| } |
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
| /* Infrred sensor demo sketch | |
| * | |
| * This sketch demonstrates the use of the PIR infrared motion sensor. | |
| * | |
| * The sketch adds to the bare minimum version by allowing extra time | |
| * after the sensor goes LOW for the LED to remain HIGH. This could be | |
| * useful in a scenario where you want a light to go on in a room when | |
| * someone enters it, but to turn of a few minutes after they leave it. | |
| * | |
| * This sketch was adapted from the original that comes with the |
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
| //Original sketch: https://bigdanzblog.wordpress.com/2014/08/16/using-a-ky040-rotary-encoder-with-arduino/ | |
| //Modified by Peter Dalmaris, July 2015 | |
| const int PinCLK=2; // Used for generating interrupts using CLK signal | |
| const int PinDT=3; // Used for reading DT signal | |
| const int PinSW=8; // Used for the push button switch | |
| volatile long virtualPosition =0; // must be volatile to work with the isr |
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 "FS.h" | |
| #include "SPIFFS.h" | |
| // a change | |
| /* You only need to format SPIFFS the first time you run a | |
| test or else use the SPIFFS plugin to create a partition | |
| https://github.com/me-no-dev/arduino-esp32fs-plugin */ | |
| #define FORMAT_SPIFFS_IF_FAILED true |
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
| // Written by Peter Dalmaris. | |
| // This is an example of how to record data from the Arduino 101 accelerometer to an SD card | |
| // Part of a demonstration for the Arduino Bootcamp for Teachers Extension Project | |
| #include <SPI.h> | |
| #include <SD.h> | |
| #include "CurieIMU.h" | |
| const int chipSelect = 4; |
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
| const byte LED_GPIO = 2; | |
| volatile int interruptCounter; // When this is not zero, we'll take a reading from the sensor | |
| // The interrupt service routine will increment it. | |
| // When the sensor is read, this variable is decremented. | |
| volatile int blinkCounter = 0; | |
| // The hardware timer pointer | |
| hw_timer_t * timer = NULL; |
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
| void setup() { | |
| Serial.begin(9600); | |
| while (!Serial) | |
| {} | |
| // put your setup code here, to run once: | |
| String str = "GET /?led06=1"; | |
| int led_index = str.indexOf("led"); | |
| int equal_index = str.indexOf("="); |