doc_id
stringlengths
36
36
metadata
dict
input
stringlengths
28
4.3k
output
stringlengths
11
5.45k
7e23224c-0b21-41f5-9b5d-60dd4a3990a5
{ "language": "Arduino" }
```arduino ``` Add example to list all addresses where a device is present.
```arduino #include <SoftWire.h> #include <AsyncDelay.h> SoftWire sw(SDA, SCL); void setup(void) { Serial.begin(9600); sw.setTimeout_ms(40); sw.begin(); pinMode(LED_BUILTIN, OUTPUT); digitalWrite(LED_BUILTIN, LOW); // Set how long we are willing to wait for a device to respond sw.setTimeout_ms(200); ...
1e1474b5-aa97-4fca-9fdb-438ff6d192cd
{ "language": "Arduino" }
```arduino ``` Add new starting payload program
```arduino #include <Wire.h> #include "Adafruit_BMP085.h" /* * BMP180 setup instructions: * ---------------------------------------- * Connect BMP180 V-in to 3.3V (NOT 5.0V) * Connect BMP180 GND to Ground * Connect BMP180 SCL to Analog 5 * Connect BMP180 SDA to Analog 4 * ---------------------------...
5070d7dc-c43a-4ae0-ba16-1d5af8327c56
{ "language": "Arduino" }
```arduino ``` Add HTTP POST for Arduino Yun.
```arduino /* Yún HTTP Client This example for the Arduino Yún shows how create a basic HTTP client that connects to the internet and downloads content. In this case, you'll connect to the Arduino website and download a version of the logo as ASCII text. created by Tom igoe May 2013 This example code is in ...
59a6b813-f223-42aa-a7d4-27c6c36d199d
{ "language": "Arduino" }
```arduino ``` Add the Arduino sketch for reading and remembering key numbers. Doesn't build with ino atm.
```arduino #include <OneWire.h> #include <EEPROM.h> // This is the pin with the 1-Wire bus on it OneWire ds(PIN_D0); // unique serial number read from the key byte addr[8]; // poll delay (I think 750ms is a magic number for iButton) int del = 1000; // Teensy 2.0 has an LED on port 11 int ledpin = 11; // number of ...
b5794573-868c-4d47-8c22-b4782488c800
{ "language": "Arduino" }
```arduino ``` Test program for PIR module
```arduino /**************************************************************************** PIRsensor : test program for PIR sensor module Author: Enrico Formenti Permissions: MIT licence Remarks: - OUT pin is connected to digital pin 2 of Arduino, change this if needed - DELAY times depend on th...
dee8bbb4-4538-4d9d-a1c9-52c6191afd7e
{ "language": "Arduino" }
```arduino ``` Add arduino code to work with the serial_test
```arduino /*************************************************** Simple serial server ****************************************************/ //serial String inputString = ""; // a string to hold incoming data boolean stringComplete = false; // whether the string is complete void setup(){ //delay(100); //wa...
9e8d6efa-5575-43f3-8cd8-e4e5b6c2faf2
{ "language": "Arduino" }
```arduino ``` Add next Arduino example - blinky with Timer1 OVF.
```arduino /** * Copyright (c) 2019, Łukasz Marcin Podkalicki <lpodkalicki@gmail.com> * ArduinoUno/001 * Blinky with timer1 OVF. */ #define LED_PIN (13) #define TIMER_TCNT (57723) // 65536 - 16MHz/1024/2 void setup() { pinMode(LED_PIN, OUTPUT); // set LED pin as output TCCR1A = 0; TCCR1B = _BV(CS12)|_B...
a6c20a9f-c382-4113-8370-025c75088f47
{ "language": "Arduino" }
```arduino ``` Add basic GA1A12S202 light sensor Arduino testbed.
```arduino """ @author: Sze 'Ron' Chau @source: https://github.com/wodiesan/senior_design_spring @Desc: Adafruit Analog Light Sensor, modified by Ron Chau. 1. Connect sensor output to Analog Pin 0 2. Connect 5v to VCC and GND to GND 3. Connect 3.3v to the AREF pin """ int led1 = 2; // LED ...
39d695ec-9c3a-4cd2-a896-248c09201e04
{ "language": "Arduino" }
```arduino ``` Print all virtual data example
```arduino /************************************************************** * Blynk is a platform with iOS and Android apps to control * Arduino, Raspberry Pi and the likes over the Internet. * You can easily build graphic interfaces for all your * projects by simply dragging and dropping widgets. * * Downloads,...
9603150a-32fa-4a58-ac59-d6e663e9d82d
{ "language": "Arduino" }
```arduino ``` Add tests for web client
```arduino // Demo using DHCP and DNS to perform a web client request. // 2011-06-08 <jc@wippler.nl> http://opensource.org/licenses/mit-license.php #include <EtherCard.h> // ethernet interface mac address, must be unique on the LAN static byte mymac[] = { 0x74,0x69,0x69,0x2D,0x30,0x31 }; byte Ethernet::buffer[600]; ...
4a5a511e-4c23-443c-915d-4015e649c917
{ "language": "Arduino" }
```arduino ``` Add example of setbaud and findbaud
```arduino /* * findBaudTest - Test all supported baud settings * * The progress and results are printed to Serial, so open the 'Serial * Montitor'. * * The progress and results will be easier to read if you disable the * debugging (comment out or delete the "#define DEBUG_HC05" line in * HC05.h. */ #include <...
66231d57-3082-4587-b813-42e1d18bc3c5
{ "language": "Arduino" }
```arduino ``` Add simple program that sets the first recived byte by BLE and write in the pot
```arduino /* Digital Potentiometer control over BLE MCP4110 digital Pots SPI interface */ // inslude the SPI library: #include <SPI.h> #include <SoftwareSerial.h> SoftwareSerial bleSerial(2, 3); // RX, TX // set pot select pin const int potSS = 10; //const int potWriteCmd = B00100011; const int potWriteCmd...
48181020-ff8e-4afd-8f6d-12c77b1a51fe
{ "language": "Arduino" }
```arduino ``` Add GSM Serial for testing AT Command
```arduino #include <SoftwareSerial.h> SoftwareSerial SSerial(10, 11); void setup(void) { Serial.begin(9600); SSerial.begin(9600); } void loop(void) { if (Serial.available() > 0) { SSerial.write(Serial.read()); } if (SSerial.available() > 0) { Serial.write(SSerial.read()); } } ```
634562a9-f372-4799-b2fe-e460119001ca
{ "language": "Arduino" }
```arduino ``` Add sketch to verify Watchdog/RTC::since() behavior.
```arduino /** * @file CosaSince.ino * @version 1.0 * * @section License * Copyright (C) 2015, Mikael Patel * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2....
2dd1d62e-1c8a-4f64-b6ca-7ae05809dd36
{ "language": "Arduino" }
```arduino ``` Add example of Iot device that posts to data.sparkfun.com
```arduino #include "DHT.h" #define DHTPIN 2 // what pin we're connected to // Uncomment whatever type you're using! #define DHTTYPE DHT11 // DHT 11 //#define DHTTYPE DHT22 // DHT 22 (AM2302) //#define DHTTYPE DHT21 // DHT 21 (AM2301) // Connect pin 1 (on the left) of the sensor to +5V // NOTE: If using a...
cc6d61b6-e904-4dfe-b919-c3891cae7ea6
{ "language": "Arduino" }
```arduino ``` Test input values by displaying in the serial monitor
```arduino //Skript for testing the input-values of the arduino by displaying values in the serial monitor int delayTime = 4000; int buttonState = 0; int piezo = A0; int photo = A1; int poti = A2; int switchBtn = 11; int buttonBtn = 12; int extFlash = 8; int camTrigger = 9; int camFocus = ...
e74fdd1b-a232-43f4-847f-fbb459adbaeb
{ "language": "Arduino" }
```arduino ``` Add a DMX send example
```arduino #include <TeensyDmx.h> #define DMX_REDE 2 byte DMXVal[] = {50}; // This isn't required for DMX sending, but the code currently requires it. struct RDMINIT rdmData { "TeensyDMX v0.1", "Teensyduino", 1, // Device ID "DMX Node", 1, // The DMX footprint 0, // The DMX startAddress - only used fo...
9e843633-4411-464f-a484-2a7de7bd9ea4
{ "language": "Arduino" }
```arduino ``` Add simple interrupt test script
```arduino /****************************************************************************************************************************\ * * Arduino interrupt tests, as simple and understandable as possible. * © Aapo Rista 2017, MIT license * Tested with Wemos ESP8266 D1 Mini PRO * https://www.wemos.cc/product/d1...
09f9a9ff-7936-4dcb-8516-2b4d3afcd959
{ "language": "Arduino" }
```arduino ``` Add draw text with scale example.
```arduino #include "AL_ILI9341.h" #include "AL_Font.h" // Wiring #define TFT_PORT PORTF #define TFT_PIN PINF #define TFT_DDR DDRF #define TFT_RST A12 #define TFT_CS A11 #define TFT_RS A10 #define TFT_WR A9 #define TFT_RD A8 AL_ILI9341 tft( &TFT_PORT, &TFT_PIN, &TFT_DDR, TFT_RST, TFT_CS, TFT_RS...
c0bebe32-7173-4079-8bf7-ed3e1eaaf1bf
{ "language": "Arduino" }
```arduino ``` Add test sketch for SR-04 ultasound sensors
```arduino #include <NewPing.h> #define SONAR_NUM 4 // Number or sensors. #define MAX_DISTANCE 200 // Maximum distance (in cm) to ping. #define PING_INTERVAL 33 // Milliseconds between sensor pings (29ms is about the min to avoid cross-sensor echo). unsigned long pingTimer[SONAR_NUM]; // Holds the times when the nex...
008cb56a-1919-4af3-a492-fe5ca6f3e5d7
{ "language": "Arduino" }
```arduino ``` Add Arduino sketch for testing individual strips
```arduino // Program for testing a single strip of lights. // Cycles through each possible combination of pure colors: // #000000 #FF0000 #00FF00 #FFFF00 #0000FF #FF00FF #00FFFF #FFFFFF // For each color, lights up lights one at a time with a slight delay between // individual lights, then leaves the whole strip lit u...
98a69a2b-9593-4436-8f4a-6a3d35bfdaf1
{ "language": "Arduino" }
```arduino ``` Add working code for the arduino uno
```arduino // VoteVisualization // // Author: sven.mentl@gmail.com // Released under the GPLv3 license to match the rest of the AdaFruit NeoPixel library #include <Adafruit_NeoPixel.h> #include <avr/power.h> // Digital I/O Pin connected to Data In of the NeoPixel Ring #define PIN 13 // Number of NeoPix...
4f6956b4-9ea4-4b85-9359-6b6cb396530b
{ "language": "Arduino" }
```arduino ``` Add the arduino sketch to test the rover movement.
```arduino /* * Author: Manuel Parra Z. * Date: 14/11/2015 * License: MIT License * Materials: * - Arduino Uno R3 * - DFRobot DF-MD V1.3 * - DFRobot Pirate 4WD * Description: * This sketch will use as a movement test, first the rover will go foward * on the track, then it will go reverse, then...
72112356-2fd7-4fff-be1f-24841be887ce
{ "language": "Arduino" }
```arduino ``` Add example for pairing with AccelStepper library
```arduino /** * Author Teemu Mäntykallio * Initializes the library and turns the motor in alternating directions. */ #define EN_PIN 38 // Nano v3: 16 Mega: 38 //enable (CFG6) #define DIR_PIN 55 // 19 55 //direction #define STEP_PIN 54 // 18 54 //step #define ...
f1e83f76-c944-4526-b0de-49732eb2bae9
{ "language": "Arduino" }
```arduino ``` Add RedBearLab BLE Mini module
```arduino /************************************************************** * Blynk is a platform with iOS and Android apps to control * Arduino, Raspberry Pi and the likes over the Internet. * You can easily build graphic interfaces for all your * projects by simply dragging and dropping widgets. * * Downloads,...
daba43a5-3f48-4dc3-8f57-608f2374e377
{ "language": "Arduino" }
```arduino ``` Add WiFiNINA, Arduino MKR WiFi 1010 support
```arduino /************************************************************* Download latest Blynk library here: https://github.com/blynkkk/blynk-library/releases/latest Blynk is a platform with iOS and Android apps to control Arduino, Raspberry Pi and the likes over the Internet. You can easily build graphic...
77a96e8d-5ee1-4aab-a2dd-4b24742c834a
{ "language": "Arduino" }
```arduino ``` Add an example showing how to set the QoS value of a message to publish
```arduino /* MQTT with QoS example - connects to an MQTT server - publishes "hello world" to the topic "outTopic" with a variety of QoS values */ #include <ESP8266WiFi.h> #include <PubSubClient.h> const char *ssid = "xxxxxxxx"; // cannot be longer than 32 characters! const char *pass = "yyyyyyyy"; // // Up...
6e5cb0e8-64d7-42f7-9aa7-310806ceb1a4
{ "language": "Arduino" }
```arduino ``` Add Arduino example that receives ESP predictions over serial.
```arduino // Arduino example that streams accelerometer data from an ADXL335 // (or other three-axis analog accelerometer) to the ESP system and // lights different LEDs depending on the predictions made by the // ESP system. Use with the user_accelerometer_gestures.cpp ESP example. // the accelerometer pins int zpin...
67883032-bbda-4c38-9648-ffc9b53d0017
{ "language": "Arduino" }
```arduino ``` Add demo on new functionality
```arduino /* * IRremote: IRInvertModulate - demonstrates the ability enable/disable * IR signal modulation and inversion. * An IR LED must be connected to Arduino PWM pin 3. * To view the results, attach an Oscilloscope or Signal Analyser across the * legs of the IR LED. * Version 0.1 November, 2013 * Copyright...
5ff94cf2-6fa6-4390-8c10-635e1bc8a99e
{ "language": "Arduino" }
```arduino ``` Bring up verification of GroveMoisture
```arduino int sensorPin = A1; // select the input pin for the potentiometer float sensorValue[0]; float get_sensor_data_moisture(){ // read the value from the sensor: return analogRead(sensorPin); } void setup() { // declare the ledPin as an OUTPUT: Serial.begin(115200); } void loop() { sens...
2d9f91ff-b801-4a3c-8aa2-23468b8729b6
{ "language": "Arduino" }
```arduino ``` Add example sketch for testing out "will" messages
```arduino /* MQTT "will" message example - connects to an MQTT server with a will message - publishes a message - waits a little bit - disconnects the socket *without* sending a disconnect packet You should see the will message published when we disconnect */ #include <ESP8266WiFi.h> #include <PubSubClie...
3aa6f66e-8d90-4f41-8f68-95d4652ea432
{ "language": "Arduino" }
```arduino ``` Test code for the line follow
```arduino #define FAR_LEFT A0 #define LEFT A1 #define CENTER_LEFT A2 #define CENTER_RIGHT A3 #define RIGHT A4 #define FAR_RIGHT A5 #define WB_THRESHOLD 400 #define IR_DELAY 140 void setup() { Serial.begin(9600); pinMode(FAR_LEFT, INPUT); pinMode(LEFT, INPUT); pinMode(CENTER_LEFT, INPUT); pinMode(CENTER_R...
26589647-d796-4200-b0e7-c9cd476b1bbb
{ "language": "Arduino" }
```arduino ``` Add blink file too for ease of access
```arduino /* Blink Turns on an LED on for one second, then off for one second, repeatedly. Most Arduinos have an on-board LED you can control. On the Uno and Leonardo, it is attached to digital pin 13. If you're unsure what pin the on-board LED is connected to on your Arduino model, check the documentatio...
83a917ac-299e-4a26-83fa-de8c3d9094fa
{ "language": "Arduino" }
```arduino ``` Add arduino stepper motor control
```arduino /* Stepper Motor Control */ #include <Stepper.h> const int stepsPerRevolution = 200; // change this to fit the number of steps per revolution // for your motor // initialize the stepper library on pins 8 through 11: Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11); int stepCount = 0; // nu...
a821a335-14da-4e26-af14-494b32d3dbc2
{ "language": "Arduino" }
```arduino ``` Add super simple arduino servo-based cutdown program.
```arduino #include <Servo.h> Servo myservo; int pos = 0; void setup() { myservo.attach(9); myservo.write(45); // Start out in a good position delay(5000); // Wait as long as you like. (milliseconds) } void loop() { myservo.write(130) // End in a release position while(true); // Do nothing, ...
79cdebf2-0ccc-468c-bd08-f53b023711ce
{ "language": "Arduino" }
```arduino ``` Add simple Arduino test program
```arduino void setup() { // initialize serial communication at 9600 bits per second: Serial.begin(9600); Keyboard.begin(); //setup buttons pinMode(2, INPUT_PULLUP); //Button 1 pinMode(3, INPUT_PULLUP); //Button 2 pinMode(4, INPUT_PULLUP); //Button 3 pinMode(5, INPUT_PULLUP); //Button 4 //setup mainbo...
5db0abc9-f791-463c-90aa-97ed0e2b082f
{ "language": "Arduino" }
```arduino ``` Add a tool for auto calibration of watchdog based clock.
```arduino /** * @file CosaAutoCalibration.ino * @version 1.0 * * @section License * Copyright (C) 2015, Mikael Patel * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * ...
85bcfccf-19d3-468f-8a6d-7d695fbc56b0
{ "language": "Arduino" }
```arduino ``` Add TFmini plus (lidar) test code
```arduino // set this to the hardware serial port you wish to use #define HWSERIAL Serial1 byte byteArray [9]; // Byte0 Byte 1 Byte2 Byte3 Byte4 Byte5 Byte6 Byte7 Byte8 // 0x89 0x89 Dist_L Dist_H Strength_L Strength_H Temp_L Temp_H Checksum // byte2 is distance, overflows into byte3 byte configOutput [...
8346f54a-9c04-47ce-9d5d-46515dd38bc7
{ "language": "Arduino" }
```arduino ``` Test for motor using enable pins and buttons operation.
```arduino #include <Stepper.h> #define P1 P4_5 #define P2 P1_1 const int stepsPerRevolution = 200; Stepper myStepper(stepsPerRevolution, 12,13,5,9); short forward; short backward; void setup() { // set the speed at 60 rpm: myStepper.setSpeed(60); // initialize the serial port: Serial.begin(9600); //...
c34bb8dc-302f-4425-a036-b3a281d7d5a6
{ "language": "Arduino" }
```arduino ``` Add canbus FD send example
```arduino // demo: CAN-BUS Shield, send data // loovee@seeed.cc #include <SPI.h> #include "mcp2518fd_can.h" /*SAMD core*/ #ifdef ARDUINO_SAMD_VARIANT_COMPLIANCE #define SERIAL SerialUSB #else #define SERIAL Serial #endif #define CAN_2518FD // the cs pin of the version after v1.1 is default to D9 // v0.9b ...
d182e533-0b37-4d91-89a7-3bd66fc394cf
{ "language": "Arduino" }
```arduino ``` Add ECDSA test for Arduino
```arduino #include <uECC.h> #include <j0g.h> #include <js0n.h> #include <lwm.h> #include <bitlash.h> #include <GS.h> #include <SPI.h> #include <Wire.h> #include <Scout.h> #include <Shell.h> #include <uECC.h> extern "C" { static int RNG(uint8_t *p_dest, unsigned p_size) { while(p_size) { long v = random(...
4ba9e819-956b-4315-b741-802c2ba552c8
{ "language": "Arduino" }
```arduino ``` Add sketch for reading button press
```arduino int BUTTON_PIN = 2; void setup() { pinMode(BUTTON_PIN, INPUT); Serial.begin(9600); } void loop() { //Serial.println("Hello computer!"); //Serial.print("This line will mash together with the next."); int buttonPressed = digitalRead(BUTTON_PIN); if(buttonPressed == 1) { Serial.println("I p...
3dde5267-8e6c-4a91-806d-659615b9289d
{ "language": "Arduino" }
```arduino ``` Add sketch that includes all LCD interface implementations and adapters.
```arduino /** * @file CosaLCDverify.ino * @version 1.0 * * @section License * Copyright (C) 2015, Mikael Patel * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * versio...
4109a968-b55c-4a85-be2d-05df1be0adf3
{ "language": "Arduino" }
```arduino ``` Add firmware for LightBlueBean Token
```arduino // Token's firmware working copy // Code based on RFDUINO hardware, uses C char arrays #include <ArduinoJson.h> //Test JSON strings char OFF[]= "{\"device\":\"LED\",\"event\":\"off\"}"; char GREEN[] = "{\"device\":\"LED\",\"event\":\"on\",\"color\":\"green\"}"; char RED[] = "{\"device\":\"LED\",\"event\...
90522359-e46e-40fe-864a-91262fcd772b
{ "language": "Arduino" }
```arduino ``` Add new sketch for ESP8266
```arduino /* * Blink for esp8266 */ #define ESP8266_LED 2 void setup() { // put your setup code here, to run once: pinMode(ESP8266_LED, OUTPUT); } void loop() { // put your main code here, to run repeatedly: digitalWrite(ESP8266_LED, HIGH); delay(1000); digitalWrite(ESP8266_LED, LOW); delay(1000); }...
e8baf89b-e421-4a14-be66-7e3c6ac0aafc
{ "language": "Arduino" }
```arduino ``` Add example to help find suitable contrast value.
```arduino /** Contrast Helper * * Loops through a range of contrast values and prints each one. * * To set the contrast in your sketch, simply put lcd.setContrast(xx); * after your lcd.begin(). * * Experimentally determined, contrast values around 65-70 tend to * work reasonably well on most displ...
6d486c55-4386-4f54-9705-6c1ea6ff186c
{ "language": "Arduino" }
```arduino ``` Add Arduino program to generate camera and light trigger.
```arduino // // Generate a 9Hz square signal to trigger camera and lightning // // Arduino setup void setup() { // Output signal pinMode( 13, OUTPUT ); } // Main loop void loop() { // High state (11ms) digitalWrite( 13, HIGH ); delay( 11 ); // Low state (100ms) digitalWrite( 13, LOW ); delay( 100 )...
a246c222-24a1-4dbf-8bab-1cc8e6d8815b
{ "language": "Arduino" }
```arduino ``` Add test sketch which simply runs each motor separately, without input from Android
```arduino #include "DualVNH5019MotorShield.h" DualVNH5019MotorShield md; void stopIfFault() { if (md.getM1Fault()) { Serial.println("M1 fault"); while(1); } if (md.getM2Fault()) { Serial.println("M2 fault"); while(1); } } void setup() { Serial.begin(19200); Serial.println("Dual VN...
ec5e30c2-5f03-4f9e-a654-85a8c85b5aaa
{ "language": "Arduino" }
```arduino ``` Read GPS data from sensor and write it to the serial port
```arduino #include <SoftwareSerial.h> SoftwareSerial SoftSerial(2, 3); char buffer[265]; int count=0; void setup() { SoftSerial.begin(9600); Serial.begin(9600); } void loop() { if (SoftSerial.available()) { while(SoftSerial.available()) { buffer[count++]=SoftSerial.read(); if(count == 2...
80e7bcb5-3122-4d7f-9b2e-a3b3fb66a02e
{ "language": "Arduino" }
```arduino ``` Add source code for Jarbas
```arduino #include <ESP8266HTTPClient.h> #include <ESP8266WiFiMulti.h> #define RELAY D1 const int HTTPS_PORT = 443; const char* WIFI = "WIFI"; const char* PASSWORD = "PASSWORD"; const char* HOST = "hooks.slack.com"; const char* URL = "URL"; String PAYLOAD = String("{\"text\": \"@here Café quentinho na cafeteira!...
3d498926-34ac-40a6-9e5b-27a8c8b01b60
{ "language": "Arduino" }
```arduino ``` Add example to read A0
```arduino /* * Simple demonstration of AsyncDelay to read the A0 analogue input * every 50 ms. */ #include <AsyncDelay.h> AsyncDelay samplingInterval; void setup(void) { Serial.begin(115200); samplingInterval.start(50, AsyncDelay::MILLIS); } void loop(void) { if (samplingInterval.isExpired()) { uint1...
a3909cdc-5243-4499-aae9-3dcb3f91a24d
{ "language": "Arduino" }
```arduino ``` Add simple sketch to test Ultrasonic sensor
```arduino /* Test Ultrasonic sensor readings Created 2 7 2014 Modified 2 7 2014 */ // Ultrasonic sensor settings const byte ULTRASONIC_PIN = A6; void setup() { Serial.begin(9600); } void loop() { Serial.println(analogRead(ULTRASONIC_PIN)); delay(1000); }```
3a7e9dbd-69b6-4bf0-8956-5cd5c05123a4
{ "language": "Arduino" }
```arduino ``` Add Simblee BLE example
```arduino /************************************************************** * Blynk is a platform with iOS and Android apps to control * Arduino, Raspberry Pi and the likes over the Internet. * You can easily build graphic interfaces for all your * projects by simply dragging and dropping widgets. * * Downloads,...
26f53a32-ff16-4490-9941-a251d71ccfa8
{ "language": "Arduino" }
```arduino ``` Add example of a custom function in serial
```arduino #include "VdlkinoSerial.h" VdlkinoSerial vdlkino(14, 6, &Serial); uint16_t get_analog_byte(void *block) { VdlkinoBlock *vblock = (VdlkinoBlock*) block; return map(analogRead(vblock->pin), 0, 1023, 0, 255); } void setup() { Serial.begin(9600); vdlkino.operations[8] = &get_analog_byte; } void loop(...
3ad749f3-5276-474f-9b0a-de2d47d217b1
{ "language": "Arduino" }
```arduino ``` Add a simple example sketch with many explanatory comments
```arduino /* NeoPixel Ring simple sketch (c) 2013 Shae Erisson released under the GPLv3 license to match the rest of the AdaFruit NeoPixel library */ #include <Adafruit_NeoPixel.h> #ifdef __AVR_ATtiny85__ // Trinket, Gemma, etc. #include <avr/power.h> #endif // Which pin on the FLORA is connected to the NeoPixel ri...
4c4578c5-cdc0-49e0-aab0-c206ef378fe2
{ "language": "Arduino" }
```arduino ``` Add comment to improve code readability
```arduino #include <HID.h> #include <Keyboard.h> // Init function void setup() { // Start Keyboard and Mouse Keyboard.begin(); // Start Payload // press Windows+X Keyboard.press(KEY_LEFT_GUI); delay(1000); Keyboard.press('x'); Keyboard.releaseAll(); delay(500); // launch Command Prompt (Admin) ...
ce9c35ef-5b2d-4072-adab-934acf7db56a
{ "language": "Arduino" }
```arduino ``` Add sketch that test ultrasonic readings on sensor platform
```arduino /* Test Ultrasonic sensor readings on sensor platform This sketch is designed to test the accuracy of the Ultrasonic sensor with the battery pack and circuit of the sensor platform. This sketch takes 5 readings and averages them to help verify similar calculations used in BridgeSensorGSM sketch...
b7340c93-0c30-4fdb-aaa9-318f5041b7bb
{ "language": "Arduino" }
```arduino ``` Add initial robot motor body code
```arduino /* This is a test sketch for the Adafruit assembled Motor Shield for Arduino v2 It won't work with v1.x motor shields! Only for the v2's with built in PWM control For use with the Adafruit Motor Shield v2 ----> http://www.adafruit.com/products/1438 */ #include <Wire.h> #include <Adafruit_MotorShield.h> #...
f570b414-91d1-4a22-b144-ca8ba27eb99b
{ "language": "Arduino" }
```arduino ``` Add Arduino sketch to test encoders and leds
```arduino // Total number of input channels supported by the hardware const uint8_t numChannels = 5; const uint8_t ledPins[] = {2, 4, 7, 8, 12}; const uint8_t encoderPins[] = {5, 6, 9, 10, 11}; unsigned long currentEncoderValues[] = {0, 0, 0, 0, 0}; unsigned long previousEncoderValues[] = {0, 0, 0, 0, 0}; const unsign...
26bbb0b0-6586-4a20-8283-388bc758cbfc
{ "language": "Arduino" }
```arduino ``` Test for accelerometer on sensorboard.
```arduino /* ADXL362_SimpleRead.ino - Simple XYZ axis reading example for Analog Devices ADXL362 - Micropower 3-axis accelerometer go to http://www.analog.com/ADXL362 for datasheet License: CC BY-SA 3.0: Creative Commons Share-alike 3.0. Feel free to use and abuse this code however you'd like. If you find i...
c3a51de5-640c-48e9-afaf-a507d14489e1
{ "language": "Arduino" }
```arduino ``` Add project resources for Mote
```arduino #include <SoftwareSerial.h> // software serial #2: RX = digital pin 8, TX = digital pin 9 // on the Mega, use other pins instead, since 8 and 9 don't work on the Mega SoftwareSerial portTwo(8, 9); void setup() { pinMode(LED_BUILTIN, OUTPUT); // Open serial communications and wait for port to open: ...
1eda6412-efe9-48bb-a11f-a1af4fea1739
{ "language": "Arduino" }
```arduino ``` Add a file to control sabertooth board
```arduino // Software Serial Sample // Copyright (c) 2012 Dimension Engineering LLC // See license.txt for license details. #include <SoftwareSerial.h> #include <SabertoothSimplified.h> SoftwareSerial SWSerial(NOT_A_PIN, 11); // RX on no pin (unused), TX on pin 11 (to S1). SabertoothSimplified ST(SWSerial); // Use S...
251a3084-824d-40e3-82fc-24a5fb49a444
{ "language": "Arduino" }
```arduino ``` Add temp sensor example sketch
```arduino // TimerOne library: https://code.google.com/p/arduino-timerone/ #include <TimerOne.h> #include <SPI.h> #include <BLEPeripheral.h> // define pins (varies per shield/board) #define BLE_REQ 10 #define BLE_RDY 2 #define BLE_RST 9 BLEPeripheral blePeripheral = BLEPeripheral(BLE_REQ, BLE_RDY, BLE_RST); ...
467674e1-e8a0-411c-8b89-aeb4e1818a42
{ "language": "Arduino" }
```arduino ``` Test script for flashing LEDs on same port using AIO and DIO
```arduino /** * Use the schedule class to have two different LEDs on one JeeNode * port flash at different rates. One LED is on DIO and the other * AIO. * * This is a straight-forward modification of the sched_blinks.ino * sketch. * * Based largely on jcw's "schedule" and "blink_ports" sketches * * Changes...
404e3ff0-6922-4362-ac9d-bdd665ed9174
{ "language": "Arduino" }
```arduino ``` Add example demonstrating the simple `read()` command and SoftWire
```arduino // This example demonstrates how to use the HIH61xx class with the SoftWire library. SoftWire is a software I2C // implementation which enables any two unused pins to be used as a I2C bus. A blocking read is made to the // HIH61xx device. See HIH61xx_SoftWire_demo for a more sophisticated example which allow...
d9af7fbf-8e65-48f7-870d-184ef4ed0c48
{ "language": "Arduino" }
```arduino ``` Test for checking the processing code
```arduino /* * User testing for the arduino * Two kinds of messages can be send to the arduino: * - 0-255 * - S,1,# * c rrrgggbbb * - L,1,C#########\n */ void setup() { // put your setup code here, to run once: Serial.begin(9600); } void loop() { // put your main code here, to run repeatedly: ...
398d8810-b1fc-4932-91bc-82a0f0a854ba
{ "language": "Arduino" }
```arduino ``` Implement IMU unit on Curie
```arduino #include "CurieIMU.h" void setup() { Serial.begin(9600); // Initialize internal IMU CurieIMU.begin(); // Set accelerometer range to 2G CurieIMU.setAccelerometerRange(2); } void loop() { float ax, ay, az; CurieIMU.readAccelerometerScaled(ax, ay, az); Serial.print("Value ax:"); Serial....
0d632e16-4a28-44ec-9653-901f3fbe93f7
{ "language": "Arduino" }
```arduino ``` Add LED widget setColor example
```arduino /************************************************************** * Blynk is a platform with iOS and Android apps to control * Arduino, Raspberry Pi and the likes over the Internet. * You can easily build graphic interfaces for all your * projects by simply dragging and dropping widgets. * * Downloads,...
84d6aabb-2965-4544-9b8d-fe8156299470
{ "language": "Arduino" }
```arduino ``` Add SPI EEPROM 25LC040 example.
```arduino #include "mbed.h" // use fully qualified class name to resolve ambiguities with // Arduino's own global "SPI" object mbed::SPI spi(SPI_MOSI, SPI_MISO, SPI_SCK); DigitalOut cs(D10); RawSerial pc(USBTX, USBRX); static const uint8_t READ = 0x03; // read data from memory array static const uint8_t WRITE = 0x...
be8efdf0-4d03-41cf-8135-4a0cfd858a01
{ "language": "Arduino" }
```arduino ``` Add example showing one-shot usage
```arduino #include <AsyncDelay.h> AsyncDelay oneShot; bool messagePrinted = false; void setup(void) { Serial.begin(9600); Serial.println("Starting one-shot timer"); oneShot.start(5000, AsyncDelay::MILLIS); } void loop(void) { if (!messagePrinted && oneShot.isExpired()) { Serial.print("The timer was sta...
23b02c95-2eb5-4907-929c-72d442c0b62b
{ "language": "Arduino" }
```arduino ``` Add arduino Lidar and servo sweeping code
```arduino #include <I2C.h> #include <Servo.h> #define LIDARLite_ADDRESS 0x62 // Default I2C Address of LIDAR-Lite. #define RegisterMeasure 0x00 // Register to write to initiate ranging. #define MeasureValue 0x04 // Value to initiate ranging. #define RegisterHighLowB...
db0e5e75-865c-4e53-8529-094cbbaa2ca1
{ "language": "Arduino" }
```arduino ``` Add blink test for Attiny85
```arduino /* Blink Turns on an LED on for one second, then off for one second, repeatedly. This example code is in the public domain. */ // Pin 13 has an LED connected on most Arduino boards. // give it a name: int led = 3; int led2 = 4; // the setup routine runs once when you press reset: void setup() { ...
2b19c753-32b5-4a6a-af66-dab2d01d82cd
{ "language": "Arduino" }
```arduino ``` Add simple demo stuff for 2x2x2 cube
```arduino #define REP(x,n) for(int x=0;x<n;x++) #define ALL REP(i,2) REP(j,2) REP(k,2) const int DELAY = 10; int cube[2][2][2]; int cols[2][2] = {{8, 9}, {10, 11}}; int rows[2] = {6, 7}; void clear() { ALL cube[i][j][k] = 0; } void setup() { REP(i,2) pinMode(rows[i], OUTPUT); REP(i,2) REP(j,2) pinMode(cols[i...
45a8365a-7809-499d-9780-05334d6bb4a9
{ "language": "Arduino" }
```arduino ``` Add simple teensy throughput program
```arduino //#define USE_BINARY const int sampleRate = 8000; const long serialRate = 2000000; const int NWORDS = 20; const int WSIZE = sizeof(uint16_t); const int NBYTES = NWORDS * WSIZE; volatile bool pushData = false; typedef union { uint16_t words[NWORDS]; uint8_t bytes[NBYTES]...
84b06646-65ea-4de7-a675-17272e4a8383
{ "language": "Arduino" }
```arduino ``` Add next Arduino example - blinky with Timer1 COMPA.
```arduino /** * Copyright (c) 2019, Łukasz Marcin Podkalicki <lpodkalicki@gmail.com> * ArduinoUno/003 * Blinky with Timer1 COMPA. */ #define LED_PIN (13) void setup() { pinMode(LED_PIN, OUTPUT); // set LED pin as output TCCR1A = 0; // clear register TCCR1B = _BV(WGM12); // set Timer1 to CTC mode TCCR...
35e2825b-51b3-4e4b-b9a5-f48ec2842a9d
{ "language": "Arduino" }
```arduino ``` Add first Arduino example - blinky with delay function.
```arduino /** * Copyright (c) 2019, Łukasz Marcin Podkalicki <lpodkalicki@gmail.com> * ArduinoUno/001 * Blinky with delay function. */ #define LED_PIN (13) void setup() { pinMode(LED_PIN, OUTPUT); } void loop() { digitalWrite(LED_PIN, !digitalRead(LED_PIN)); // Toggle LED pin delay(500); // wait 0.5s } `...
073a0e95-f9d6-4b65-aa42-40e62ea2d13c
{ "language": "Arduino" }
```arduino ``` Add code to read temperature and light to display on a LCD
```arduino /* * Read temperature and light and display on the LCD * * For: Arduino Uno R3 * * Parts: * 1x LCD (16x2 characters) * 1x 10 kΩ variable resistor * 1x 10 KΩ resistor * 1x 220 Ω resitor * 1x Photocell * 1x TMP36 temperature sensor */ #include <LiquidCrystal.h> int temperaturePin = 0; int lightPin...
274ba055-f22a-4c69-9c4c-e311a149ed88
{ "language": "Arduino" }
```arduino ``` Add test sketch for moisture sensor and sd card on kit
```arduino /* Test Moisture sensor readings on sensor platform This sketch is designed to test the accuracy of the Moisture sensor with the battery pack and circuit of the sensor platform. This sketch takes 5 readings and averages them to help verify similar calculations used in MoistureSensorGSM sketch. ...
23707c81-975a-4545-9b9c-5bbc452761ee
{ "language": "Arduino" }
```arduino ``` Add pseudoRandom Demo for Science Museum project
```arduino /* * pseudoRandom Demonstration sketch * Author: Darrell Little * Date: 04/29/2017 * This code is in the public domain */ // Array to hold the pin numbers with LED connected int ledPin[] = {11,10,9,6}; // Variable to set the delay time to blink int waitTime = 1000; // Variable to hold the random LED pin...
15f2f42e-6140-4de5-baea-7593057425c5
{ "language": "Arduino" }
```arduino ``` Add original code for writing to SD card.
```arduino #include <SD.h> #include <SPI.h> void setup() { //this is needed for the duemilanove and uno without ethernet shield const int sdCardPin = 10; int loopCount = 0; //for testing. delete before launches. Serial.begin(9600); delay(1000); pinMode(10,OUTPUT); if (!SD.begin(sdCardPin)) { ...
9c80aa3e-6806-4049-a377-32f529faacf7
{ "language": "Arduino" }
```arduino ``` Add script to read HX711 and load cell
```arduino /* Inspired from code HX711 demo from Nathan Seidle, SparkFun Electronics This example code uses bogde's excellent library: https://github.com/bogde/HX711 bogde's library is released under a GNU GENERAL PUBLIC LICENSE The HX711 does one thing well: read load cells. T Arduino pin (Nano) 2 -> HX71...
2df82691-69a6-4044-a58c-a15c7e232c18
{ "language": "Arduino" }
```arduino ``` Add early version of ship station demonstration software for OSU Expo
```arduino #include <AccelStepper.h> #include <MultiStepper.h> #include <math.h> /* Written for ST6600 stepper driver * PUL+ 5v * PUL- Arduino pin 9/11 * DIR+ 5v * DIR- Arduino pin 8/10 * DC+ 24v power supply * DC- Gnd on power supply & Gnd on Arduino */ // Each step is 0.12 degrees, or 0.0020943...
a3f80522-7585-4f7c-b4ea-a0315c3004fe
{ "language": "Arduino" }
```arduino ``` Add support for Arduino MKR ETH shield
```arduino /************************************************************* Download latest Blynk library here: https://github.com/blynkkk/blynk-library/releases/latest Blynk is a platform with iOS and Android apps to control Arduino, Raspberry Pi and the likes over the Internet. You can easily build graphic...
8e2d7cd8-9b06-4f84-80d8-abfc8555c4e6
{ "language": "Arduino" }
```arduino ``` Add example for storing JSON config file in SPIFFS
```arduino // Example: storing JSON configuration file in flash file system // // Uses ArduinoJson library by Benoit Blanchon. // https://github.com/bblanchon/ArduinoJson // // Created Aug 10, 2015 by Ivan Grokhotkov. // // This example code is in the public domain. #include <ArduinoJson.h> #include "FS.h" bool loadC...
75e8316d-9245-4b0b-b0d8-e81af1fc0267
{ "language": "Arduino" }
```arduino ``` Add STM32F103 Blue Pill example
```arduino /************************************************************** * Blynk is a platform with iOS and Android apps to control * Arduino, Raspberry Pi and the likes over the Internet. * You can easily build graphic interfaces for all your * projects by simply dragging and dropping widgets. * * Downloads,...
f13b7c70-5239-481e-8f2c-85d5eed0f153
{ "language": "Arduino" }
```arduino ``` Add example for storing JSON config file in SPIFFS
```arduino // Example: storing JSON configuration file in flash file system // // Uses ArduinoJson library by Benoit Blanchon. // https://github.com/bblanchon/ArduinoJson // // Created Aug 10, 2015 by Ivan Grokhotkov. // // This example code is in the public domain. #include <ArduinoJson.h> #include "FS.h" bool loadC...
3775ad4f-dd0f-458f-822c-be547506a752
{ "language": "Arduino" }
```arduino ``` Add 'ino' file to allow build from Arduino IDE
```arduino /* Stub to allow build from Arduino IDE */ /* Includes to external libraries */ #include <MemoryFree.h> #include <Countdown.h> #include <MQTTClient.h> #include <SoftwareSerial.h> ```
c5279c84-23e9-4da2-9af5-d1ec3b1851a4
{ "language": "Arduino" }
```arduino ``` Include code sample for Arduino
```arduino char incomingByte = 0; const char lampCount = 4; const unsigned short doorUnlockTime = 2000; // in miliseconds bool lampStatus[lampCount]; bool doorStatus; unsigned short doorUnlockTimer; void setup() { Serial.begin(9600); pinMode(13, OUTPUT); for (int i = 0; i < lampCount; ++i) lampStatus[i]...
e9c9f3e8-1998-4ab8-b180-115ea8ff69f7
{ "language": "Arduino" }
```arduino ``` Add motor control arduino sketch
```arduino int motorPin = 9; int switchPin = 7; int motorStep = 0; int maxStep = 200; int minimumStepDelay = 2; String motorState = String("off"); void makeStep() { digitalWrite(motorPin, HIGH); digitalWrite(motorPin, LOW); motorStep += 1; if (motorStep > maxStep) { motorStep = 0; } } void resetMotor(...
ec4fb158-c5f2-418a-ac10-ee8374b9a178
{ "language": "Arduino" }
```arduino ``` Add example of using serial
```arduino #include "VdlkinoSerial.h" VdlkinoSerial vdlkino(14, 6, &Serial); void setup() { Serial.begin(9600); } void loop() { vdlkino.run(); } ```
bcd5bda8-3780-4b9b-985d-e07c0aae8b87
{ "language": "Arduino" }
```arduino ``` Add an example of how to determine the gain setting for a filter.
```arduino // Gain Setting Example // Demonstrates the filter response with unity input to // get the appropriate value for the filter gain setting. #include <FIR.h> // Make an instance of the FIR filter. In this example we'll use // floating point values and a 13 element filter. FIR<long, 13> fir; void setup() { ...
ddcd377a-f5bb-431c-b44e-f02eb7dab84a
{ "language": "Arduino" }
```arduino ``` Add Feather M0 WiFi example
```arduino /************************************************************** * Blynk is a platform with iOS and Android apps to control * Arduino, Raspberry Pi and the likes over the Internet. * You can easily build graphic interfaces for all your * projects by simply dragging and dropping widgets. * * Downloads,...
571e161b-390d-4785-9d9c-9a5f6f008216
{ "language": "Arduino" }
```arduino ``` Add program to adjust pixel color with three potentiometers.
```arduino /* * neopixel_rgb_knob * * This is a test program to adjust the rgb of a strip of * neopixels useing three potentiometers. */ #include <Adafruit_NeoPixel.h> #ifdef __AVR__ #include <avr/power.h> // Required for 16 MHz Adafruit Trinket #endif // Which pin on the Arduino is connected to the NeoPixels?...
2589d3bf-86ff-44e1-80ed-75058f9b4eb9
{ "language": "Arduino" }
```arduino ``` Add Arduino code for reporting temperature sensor data.
```arduino #include <OneWire.h> #include <DallasTemperature.h> // Change these if appropriate // The pin that sensors are connected to #define ONE_WIRE_BUS 2 // What precision to set the sensor to #define TEMPERATURE_PRECISION 11 OneWire one_wire(ONE_WIRE_BUS); DallasTemperature sensors(&one_wire); // We will store ...
3af0d6c2-efc4-4d12-ab29-a8735fb04d89
{ "language": "Arduino" }
```arduino ``` Add Bluetooth 2.0 Serial Port Profile (SPP) example
```arduino /************************************************************** * Blynk is a platform with iOS and Android apps to control * Arduino, Raspberry Pi and the likes over the Internet. * You can easily build graphic interfaces for all your * projects by simply dragging and dropping widgets. * * Downloads,...
078296b2-d7b9-46da-9241-1c66076b201d
{ "language": "Arduino" }
```arduino ``` Add Arduino program for working with Analog data
```arduino const int analogInPin = A0; const int analogOutPin = 3; int sensorValue = 0; int outputValue = 0; void setup() { Serial.begin(9600); } void loop() { sensorValue = analogRead(analogInPin); outputValue = map(sensorValue, 0, 1023, 0, 255); analogWrite(analogOutPin, outputValue); // print the resul...
1556db59-a128-465c-899d-b95e8a0a8a1f
{ "language": "Arduino" }
```arduino ``` Add canbus FD receive interrupt example
```arduino // demo: CAN-BUS Shield, receive data with interrupt mode // when in interrupt mode, the data coming can't be too fast, must >20ms, or else you can use check mode // loovee, 2014-6-13 #include <SPI.h> #include "mcp2518fd_can.h" /*SAMD core*/ #ifdef ARDUINO_SAMD_VARIANT_COMPLIANCE #define SERIAL SerialU...
38899b52-3044-4a75-8f79-db90dd77d274
{ "language": "Arduino" }
```arduino ``` Switch keyboard with resistor ladder
```arduino int notes[] = {262, 294, 330, 349}; void setup() { Serial.begin(9600); } void loop() { int keyVal = analogRead(A0); Serial.println(keyVal); if (keyVal == 1023) { tone(8, notes[0]); } else if (keyVal >= 950 && keyVal <= 1010) { tone(8, notes[1]); } else if (keyVal >= 505 && keyVal <=...
a9853e42-19f4-4ebc-87e4-dd50e2ce4a5e
{ "language": "Arduino" }
```arduino ``` Add separate Blynk Board example. It deserves one! ;)
```arduino /************************************************************** * Blynk is a platform with iOS and Android apps to control * Arduino, Raspberry Pi and the likes over the Internet. * You can easily build graphic interfaces for all your * projects by simply dragging and dropping widgets. * * Downloads,...
9da258e7-b9c6-4ca9-b7a5-f8cf322396b3
{ "language": "Arduino" }
```arduino ``` Add stub implementation for NodeMCU implementation
```arduino #include <ESP8266WiFi.h> const char* ssid = "FRITZ!Box Fon WLAN 7360"; const char* password = "62884846722859294257"; const char* host = "192.168.178.34"; char* clientId = "photo1"; char* requestBody = "{ \"name\":\"%s\", \"weatherData\": { \"temperature\":\"%f\", \"humidity\":\"%f\" } }"; int delayIn...