Instantly share code, notes, and snippets.

View ConcurrentBlinkingLEDs.ino
//answering a question from StackExchange:
//https://arduino.stackexchange.com/questions/53976/too-few-arguments-for-multiple-if-statement-conditions/53979#53979
// Blue LED blinks
// Red LED should go on if Blue LED is ON and switch/button is in correct posistion
// Concurrent LED blinking code from here: https://learn.adafruit.com/multi-tasking-the-arduino-part-1/using-millis-for-timing
int redLEDPin = 7;
int blueLEDPin = 3;
int redLEDtiming = 250;
int blueLEDtiming = 2000;
View Ultrasonic Range Finder
int trigPin = 12;
int echoPin = 13;
void setup()
{
Serial.begin (9600);
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
}
View Faerie_Twinkle.ino
/*
Blink NeoPixels randomly: vary color and on/off timing
by @GreenMoonArt
*/
#include <Adafruit_NeoPixel.h>
#define PIN 6
#define numPIXELS 8
#define numCOLORS 7
View Dripping Icicles with NeoPixels
/*
* Code to similuate dripping icicles using Arduino and multiple NeoPixel strips
* be sure to weatherize if you are putting this outdoors
*/
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h>
#endif
View RGB LED Servo 1
// Move a servo; update an RGB LED; no concurrency
// see project at:
// https://www.maker.io/en/projects/rotating-holiday-ornament-with-rgb-leds-and-a-servo-motor/3ff0a5ca80ea4e09860f6b2bb543ee0a
// Sparkfun Tinker Kit: https://www.digikey.com/product-detail/en/sparkfun-electronics/KIT-13930/KIT-13930-ND/6098607
#include <Servo.h>
Servo servo;
const int servoRestPosition = 0; //Starting position
View RGB LED Servo 2
// move servo in between RGB LED updates
#include <Servo.h>
Servo servo;
const int servoRestPosition = 0; //Starting position
const int servo90Position = 90; //90 degrees
const int servoTargetPosition = 180; //Position when event is detected
View RGB LED Servo 3
// continuously move a servo while an RGB LED continuously updates its color
#include <Servo.h>
Servo servo;
const int servoRestPosition = 0; //Starting position
const int servo90Position = 90; //90 degrees
const int servoTargetPosition = 180; //Position when event is detected
View LCD5110_Temperature_Graph
// to convert thermistor readings to degrees F, see:
// http://playground.arduino.cc/ComponentLib/Thermistor2
// #include <math.h> // for thermistor temp conversion math
// get display library at http://rinkydinkelectronics.com/library.php?id=47
#include <LCD5110_Graph.h>
LCD5110 myScreen(8,9,10,11,12); // create an instance of the display object
extern uint8_t SmallFont[];
View 8x8 LED matrix moving eyes and mouth
// Edited by @GreenMoonArt for TechShop DC's Halloween 2016
/*
Project based on:
https://learn.adafruit.com/animating-multiple-led-backpacks/ideas?view=all
Libraries and IDE board support:
Adafruit_LED_Backpack
https://github.com/adafruit/Adafruit_LED_Backpack
View Modify The HC-05 Bluetooth Module Defaults
// thanks to http://www.instructables.com/id/Modify-The-HC-05-Bluetooth-Module-Defaults-Using-A/
// wiring diagram: https://cdn.instructables.com/FM8/W4A2/HKZAVRT9/FM8W4A2HKZAVRT9.LARGE.jpg
/*
AUTHOR: Hazim Bitar (techbitar)
DATE: Aug 29, 2013
LICENSE: Public domain (use at your own risk)
CONTACT: techbitar at gmail dot com (techbitar.com)
Procedure to ensure AT Command Mode (identified by slow-blinking LED on HC-05) has been entered:
0. Unplug power from HC-05