Skip to content

Instantly share code, notes, and snippets.

@GreenMoonArt
GreenMoonArt / Collision Avoidance - without State Machine Library
Last active August 7, 2016 21:01
updated to remove the need to use the state machine library
// 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:
@GreenMoonArt
GreenMoonArt / Experiment with Robot Movement
Last active August 7, 2016 21:02
Experiment with Robot Movement
/* YourDuino Basic Robot Kit V2 User EDitable Software Sketch
How To Page that goes with this Software Sketch:
http://arduino-info.wikispaces.com/Robot+Commands
WHAT IT DOES:
- Runs the robot motors
- Program the robot to make different moves such as Forward, SpinRight, Back etc.
- Experiment with moving the robot in different ways
- SEE the comments after "//" on each line below
- V2.20 3/27/2015 maryalice@yourduino.com
// Install State Machine library: http://playground.arduino.cc/uploads/Code/SM.zip
// **** NOTE: State Machine Library does NOT work with Arduino versions later than 1.6.5 ****
// **** see updated collision avoidance code which does not use SM library:
// https://gist.github.com/GreenMoonArt/32741b08b939c99c7b11080968539d89
/* YourDuino Basic Robot Kit Collision-avoidance Test
@GreenMoonArt
GreenMoonArt / Modify The HC-05 Bluetooth Module Defaults
Last active September 15, 2016 00:10
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
@GreenMoonArt
GreenMoonArt / 8x8 LED matrix moving eyes and mouth
Last active October 15, 2016 14:52
RoboFace - modified from Adafruit_LED_Backpack Example
// 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
@GreenMoonArt
GreenMoonArt / LCD5110_Temperature_Graph
Created November 10, 2016 17:27
Display a real time temperature graph using the Nokia LCD5110 monochrome display
// 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[];
// 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
// 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
// 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
@GreenMoonArt
GreenMoonArt / Faerie_Twinkle.ino
Last active December 30, 2016 15:06
Random Individual NeoPixels, color, delay
/*
Blink NeoPixels randomly: vary color and on/off timing
by @GreenMoonArt
*/
#include <Adafruit_NeoPixel.h>
#define PIN 6
#define numPIXELS 8
#define numCOLORS 7