Skip to content

Instantly share code, notes, and snippets.

/* This is a simple way to use one potentiometer to get varying colors out of a common-cathode RGB LED
Check out this sketch to cycle through millions of colors: https://gist.github.com/jamesotron/766994
*/
int sensorPin = A0; // connect a sensor or potentiometer to analog input A0
int sensorValue = 0;
int redPin = 3; // use PWM outputs on digital pins 3, 5, 6 - connect to RGB LED via 220 Ohm resistors
int greenPin = 5;
int bluePin = 6;
// a project by Glen p yeldho
// for more info and updates https://www.facebook.com/glenp.yeldho
// http://www.instructables.com/id/Simple-Arduino-POV-/
// Edited by GreenMoonArt to spell "TECH_"
// Connect 5 LEDs to Arduino digital pins 2, 3, 4, 5, and 6 via 200 Ohm resistors
// Upload the code and shake the breadboard with the LEDs on it.
// Vary the shaking frequency until you can see text formed by the LEDs.
int _[] = {0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0};
int A[] = {0,1,1,1,1, 1,0,1,0,0, 0,1,1,1,1};
// 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
/* 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.
- SEE the comments after "//" on each line below
- V2.20 3/27/2015 maryalice@yourduino.com
Questions: terry@yourduino.com */
/* YourDuino Basic Robot Kit V2 Motor Speed Test
http://yourduino.com/sunshop2/index.php?l=product_detail&p=400
source: https://arduino-info.wikispaces.com/YourDuino-Basic-Robot-Kit-Software-Version2
- WHAT IT DOES:
- Runs the robot motors at different speeds. Helps adjust Right-Left offsets
- SEE the comments after "//" on each line below
This test sketch will run the robot in slow, medium and fast speeds. You should place it on a smooth floor if possible.
// Install motor driver library: http://yourduino.com/docs/A_YD_Motor1.zip
/* YourDuino.com Example Software Sketch
MotorDriverDEV
YD_MotorDriver1 Library Test
source: https://arduino-info.wikispaces.com/YourDuino-Basic-Robot-Kit-Software-Version2
terry@yourduino.com
Note: If you have the motors connected properly you should first see the right-hand motor go forward and then reverse,
followed by the left-hand motor going forward and then reverse. If a motor is rotating in the wrong direction,
// Install NewPing library: https://bitbucket.org/teckel12/arduino-new-ping/downloads/NewPing_v1.7.zip
// https://bitbucket.org/teckel12/arduino-new-ping/wiki/Home
/* YourDuino Basic Robot Kit V2: Ultrasonic Sensor Test
- WHAT IT DOES
- Tests the operation of the Ultrasonic Sensor
- SEE the comments after "//" on each line below
- CONNECTIONS: (suggest cable with 4 wires: Red,Orange,Yellow,Green )
- Sensor Vcc to RoboRED Vcc (Red)
/* YourDuino Basic Robot Kit V2: Test Servo movement
- WHAT IT DOES: Tests the servo by commanding it to go to several different directions
to "Look Around". You may want to reposition the servo arm on the servo to get the
positions to look around correctly.
- SEE the comments after "//" on each line below
- CONNECTIONS:
-
-
- V2.10 11/10/2014
Questions: terry@yourduino.com */
// Info on this sensor: https://www.pololu.com/docs/0J19/all
// Sensor library: https://github.com/pololu/qtr-sensors-arduino
#include <QTRSensors.h>
#define NUM_SENSORS 6 // number of sensors used
#define TIMEOUT 2500
#define EMITTER_PIN 2
// 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 word-wrapped
@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