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
// 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 |
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
// 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 |
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
// 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 |
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
// 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[]; |
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
// 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 |
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
// 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 |
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
// kindly provided by: http://arduino-info.wikispaces.com/RobotKitMenu-8 | |
// There is a conflict with the State Machine library and versions of Arduino > 1.6.5 | |
// This code eliminates the State Machine library. | |
/* YourDuino Basic Robot Kit V2 Collision-avoidance Test | |
(Rewritten using "Switch" statements to create the State Machine ) | |
This version is slow, waits to look around. | |
KIT here: http://yourduino.com/sunshop2/index.php?l=product_detail&p=400 | |
HOW-TO here: http://arduino-info.wikispaces.com/RobotKitMenu | |
- WHAT IT DOES: |
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
// Hook up a buzzer and use it to indicate when your robot is backing up | |
// source: http://forum.arduino.cc/index.php?topic=3757.0 | |
#define BZZR 4 //digital pin to hook buzzer's red wire to | |
void setup() { | |
pinMode(BZZR, OUTPUT); //set the buzzer as output | |
} | |
void loop() { |
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
// download library from: https://github.com/pololu/qtr-sensors-arduino | |
#include <QTRSensors.h> | |
#define NUM_SENSORS 6 // number of sensors used | |
#define TIMEOUT 2500 | |
#define EMITTER_PIN QTR_NO_EMITTER_PIN // digital pin 2 is often used, but not necessary | |
// sensor connected through analog pins A0 - A5 i.e. digital pins 14-19 | |
// note: the next two lines are really one line of code – it may be word-wrapped in your browser | |
QTRSensorsRC qtrrc((unsigned char[]) {14, 15, 16, 17, 18, 19}, NUM_SENSORS, TIMEOUT, EMITTER_PIN); |
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
// hint: see how this person changed the code for their robot: http://www.techbitar.com/fast-line-following-robot.html | |
#include <QTRSensors.h> | |
#include <YD_MotorDriver1.h> | |
#define NUM_SENSORS 6 // number of sensors used | |
#define TIMEOUT 2500 | |
#define EMITTER_PIN QTR_NO_EMITTER_PIN // or 2 if you want to use this feature | |
#define Motor1A 8 |