This file contains 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 <Romi32U4.h> | |
#include <QTRSensors.h> | |
// This example is designed for use with eight QTR-1RC sensors or the eight sensors of a | |
// QTR-8RC module. These reflectance sensors should be connected to digital inputs 3 to 10. | |
// The QTR-8RC's emitter control pin (LEDON) can optionally be connected to digital pin 2, | |
// or you can leave it disconnected and change the EMITTER_PIN #define below from 2 to | |
// QTR_NO_EMITTER_PIN. | |
// The setup phase of this example calibrates the sensor for ten seconds and turns on |
This file contains 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
// This example drives each motor on the Romi forward, then | |
// backward. The yellow user LED is on when a motor should be | |
// running forward and off when a motor should be running | |
// backward. | |
#include <Romi32U4.h> | |
Romi32U4Motors motors; | |
Romi32U4ButtonA buttonA; |
This file contains 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
int time1 = 0; | |
int time2 = 0; | |
int distance1 = 0; | |
int distance2 = 0; | |
int threshold = 10; | |
int counter = 0; | |
const int timeout = 3000; | |
bool flag1 = false; | |
bool flag2 = false; |
This file contains 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
Servo myServo; | |
int pastMillis = 0; | |
int currentMillis = 0; | |
int currentHour = 0; | |
int currentDay = 0; | |
int currentMonth = 0; | |
int currentYear = 0; | |
int theYear = 0; |
This file contains 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 <Adafruit_NeoPixel.h> | |
#define PIN 6 | |
Adafruit_NeoPixel strip = Adafruit_NeoPixel(240, PIN, NEO_GRB + NEO_KHZ800); | |
int threshold = 160; | |
int sampleVal = 0; | |
int numPixels = 240; | |
void setup() { | |
Serial.begin(9600); | |
pinMode(13, OUTPUT); |
This file contains 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
int threshold = 160; | |
int sampleVal = 0; | |
void setup() { | |
Serial.begin(9600); | |
pinMode(13, OUTPUT); | |
} | |
void loop() | |
{ | |
sampleVal = analogRead(0); |
This file contains 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
int buffer[10]; | |
int total = 0; | |
int average = 0; | |
const int sampleWindow = 50; // Sample window width in mS (50 mS = 20Hz) | |
unsigned int sample; | |
void setup() { | |
// put your setup code here, to run once: | |
Serial.begin(9600); | |
//analogReference(INTERNAL); |
This file contains 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
{ | |
"event": "historical_weather", | |
"url": "https://api.darksky.net/forecast/fff1a0287d0c19568a00e2f796e1179b/41.8756,-87.6244,{{{year}}}-{{{month}}}-{{{day}}}T{{{hour}}}:00:00", | |
"requestType": "GET", | |
"noDefaults": false, | |
"rejectUnauthorized": true, | |
"responseTemplate": "{{{currently.temperature}}}" | |
} |
This file contains 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
Servo myServo; | |
int pastMillis = 0; | |
int currentMillis = 0; | |
int currentHour = 0; | |
int currentDay = 0; | |
int currentMonth = 0; | |
int currentYear = 0; |
This file contains 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
{ | |
"event": "historical_weather", | |
"url": "https://api.darksky.net/forecast/fff1a0287d0c19568a00e2f796e1179b/41.8756,-87.6244,1902-02-12T20:00:00", | |
"requestType": "GET", | |
"noDefaults": false, | |
"rejectUnauthorized": true, | |
"responseTemplate": "{{{currently.temperature}}}" | |
} |