Skip to content

Instantly share code, notes, and snippets.

@arielchuri
arielchuri / arduinoprint.ino
Created December 10, 2020 00:55
arduinoprint
// arduino print
@arielchuri
arielchuri / _100leds_s.ino
Created September 30, 2015 14:34
The 100 LEDs without all of the serial printing so you can see how simple it is.
int leds[100];
int ledCount = 100;
int blinkFactor = 1;
void setup() {
Serial.begin(9600);
for (int blinkFactor = 1; blinkFactor <= 100; blinkFactor++) {
for (int thisLed = blinkFactor - 1; thisLed < ledCount; thisLed += blinkFactor) {
if (leds[thisLed] == 0) {
leds[thisLed] = 1;
} else {
@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();
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 / 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() {
// Binary Decoder Project
// Sparkle Labs
// Set a binary number with a DIP switch and decode it in the
// serial port monitor.
//
//
// +--------------------------------+
// | +----------------------------+ |
// | | +------------------------+ | |
// | | | +--------------------+ | | |
@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:
@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 / 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 / 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;