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
| /* 04.020 - Grove analog light sensor | |
| This sketch demonstrates how to use the Grove analog light sensor. | |
| The analog light sensor is an analog device. It outputs a voltage | |
| level that depends on the intensity of ambient light. | |
| Upload this sketch and start the Serial monitor (you can also use | |
| the serial plotter). Wave your hand over the sensor and notice the | |
| change in the output displayed in the monitor. |
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
| /* 04.010 - Grove temperature sensor (Temperature Sensor V1.1/1.2) | |
| * | |
| This sketch read the voltage of a Grove temperature sensor and | |
| calculates the temperature in degrees C. | |
| The temperature sensor is an analog sensor. | |
| Components | |
| ---------- |
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
| /* 03.040 - Grove rotary potentiometer | |
| * | |
| This sketch demonstrates how to use the Grove rotary potentiometer. | |
| The momentary button is an analog device (i.e. it outputs a voltage | |
| level that depends on the position of the knob). | |
| Components | |
| ---------- |
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
| /* 03.030 - Grove touch sensor | |
| This sketch demonstrates how to use the Grove touch sensor. | |
| The touch sensor is a digital device (i.e. it can be "on" or "off" only). | |
| Components | |
| ---------- |
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
| // Define interfaces | |
| #define LED_PIN 26 // —>|–[R]—3v3 | |
| #define RELAY_PIN 33 | |
| #define BUTTON_PIN 25 // —./.—-0V | |
| // Define Timings | |
| #define LED_ACTIVE_ON 0.2 // Flashing when relay output is active | |
| #define LED_ACTIVE_OFF 0.2 // Time in seconds | |
| #define LED_IDLE_ON 12 // On with short turn off when idle | |
| #define LED_IDLE_OFF 0.5 | |
| #define RELAY_INTERVAL 6 // duration relay operates in seconds |
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("="); |
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
| // 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
| #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 |