Skip to content

Instantly share code, notes, and snippets.

@arielchuri
arielchuri / LEDtest.ino
Last active August 29, 2015 13:56
Code for testing your 6 LEDs with some additional debugging.
//
// +--------+
// | TOUCH |
// | SENSOR |
// | |
// +------ |
// ARDUINO |
// +-----------+ |
// | GND|-----------------+ |
// | | | |
@arielchuri
arielchuri / LEDtestSIMPLE.ino
Created February 10, 2014 21:42
Code for testing your 6 LEDs
int timer = 60; // The higher the number, the slower the timing.
int ledPins[] = {
11, 10, 9, 6, 5, 3 }; // an array of pin numbers to which LEDs are attached
int pinCount = 6; // the number of pins (i.e. the length of the array)
void setup() {
// the array elements are numbered from 0 to (pinCount - 1).
// use a for loop to initialize each pin as an output:
for (int thisPin = 0; thisPin < pinCount; thisPin++) {
@arielchuri
arielchuri / testLightSensor.ino
Last active August 29, 2015 13:56
Code for testing your light sensor
int ledPins[] = {
11, 10, 9, 6, 5, 3 };
int pinCount = 6;
int lightPin = A0; // A variable for which pin has the light sensor.
int lightValue = 0; // A variable to keep track of the value we get from the light sensor.
int aLED = 13;
boolean aLEDstate;
@arielchuri
arielchuri / sparkleascii.ino
Last active August 29, 2015 13:56
Ascii art Sparkle Labs logo for the serial port monitor
void logo() {
Serial.println(" ----- ");
Serial.println(" ----- ( ) ");
Serial.println(" ------- ( ) ----- ");
Serial.println(" -/ \\- | ------ ------------- -+ ");
Serial.println(" / * \\/ \\--- ----/ \\/ \\+ ");
Serial.println(" _ | * \\--/ \\-+");
Serial.println("( ) -\\ * * \\ ");
Serial.println(" ` --/ * \\");
Serial.println(" / +-+ _ _ _ _ \\");
@arielchuri
arielchuri / testTouchSensor.ino
Created February 11, 2014 20:41
Code to see the value from the touch sensor.
#include <CapacitiveSensor.h> //Load the capSense Library which the touch sensor uses.
CapacitiveSensor cs_4_2 = CapacitiveSensor(4,2); // Set up the touch sensor on pins 4 and 2.
long capSense; // A variable to store the value from the touch sensor.
int ledPins[] = {
11, 10, 9, 6, 5, 3 };
int pinCount = 6;
int lightPin = A0;
int lightValue = 0;
@arielchuri
arielchuri / ledmeter.ino
Created March 6, 2014 21:36
Code for the LED meter project. Sparkle Labs / Discover Arduino Bundle
// Sparkle Labs / Discover Arduino Bundle
// LED Meter Project
// ---------------------------------------
// Increment 3 LEDs by turning a knob.
//
// Circuit:
// Pins 0, 1, 2 are connected to ground through 3 LED drivers.
// A potentiometer is connected to power and ground on either side with the center pin (wiper) connected to Pin A0 on the Arduino.
//
// Parts:
// Binary Decoder Project
// Sparkle Labs
// Set a binary number with a DIP switch and decode it in the
// serial port monitor.
//
//
// +--------------------------------+
// | +----------------------------+ |
// | | +------------------------+ | |
// | | | +--------------------+ | | |
@arielchuri
arielchuri / Core_Object3_1.ino
Last active September 23, 2015 22:51
Sample code for Core Object Week 3-1
Moved to the class repo at https://github.com/coreobject/class
const int buttonPin = 2;
const int ledPin = 12;
const int fadeLed = 11;
int ledState = LOW;
int buttonState = 0;
int fadeLevel = 0;
boolean pressed = false;
void setup() {
Moved to the class repo at https://github.com/coreobject/class
//create variables for pins
const int buttonPin = 2;
const int ledPin = 12;
const int fadeLed = 11;
const int potPin = 0;
const int lightPin = 1;
// LED fading variables
@arielchuri
arielchuri / _100leds.ino
Created September 30, 2015 14:33
100 Lockers puzzle in Arduino form
int leds[100];
int ledCount = 100;
int blinkFactor = 1;
void setup() {
Serial.begin(9600);
Serial.println();
Serial.println();
Serial.println("*********Begin**********");
for (int blinkFactor = 1; blinkFactor <= 100; blinkFactor++) {
Serial.println();