Showing posts with label Hardware. Show all posts
Showing posts with label Hardware. Show all posts

Saturday, January 26, 2013

Thursday, January 24, 2013

Jeremy Blum - Arduino Tutorial Lessons 1-3

Tutorial 01 for Arduino: Getting Acquainted with Arduino


http://youtu.be/fCxzA9_kg6s

Tutorial 02 for Arduino: Buttons, PWM, and Functions


http://youtu.be/_LCCGFSMOr4

Tutorial 03 for Arduino: Electrical Engineering Basics


http://youtu.be/abWCy_aOSwY

Monday, January 21, 2013

Arduino Micro - Counting In Binary With LEDs

Step one for making a binary clock accomplished. Now I just need some more LEDs to finish the project. I had a lot of fun with this 2 hour project so I'll be nice and share. I present the 4 LED array schematic.


Arduino Micro - The Setup


Arduino Micro 4 LED Array Schematic


And here's the code to run it. Im running off pins 4-7 in the code, so this should port over to other Arduino models with no problem; ignore the 3bit and 4bit bit methods, just me prepping for the final project.


LED Array Binary Counting Code


[sourcecode language="java"]
int timeDigits[4][4] = {
{4,5,6,7},
{4,5,6,7}, // Fill these in later
{4,5,6,7},// with the proper pins
{4,5,6,7}
};

void setup() {
Serial.begin(9600);
pinMode(timeDigits[1][1], OUTPUT);
pinMode(timeDigits[1][2], OUTPUT);
pinMode(timeDigits[1][3], OUTPUT);
pinMode(timeDigits[1][4], OUTPUT);
}

void set4BitBinaryDigit(int timeDigits[], int binaryRow[], int index) {
Serial.print("Binary ");
Serial.print(index);
Serial.print(": ");
Serial.print(binaryRow[0]);
Serial.print(binaryRow[1]);
Serial.print(binaryRow[2]);
Serial.println(binaryRow[3]);
Serial.println(" ");

digitalWrite(timeDigits[0], binaryRow[0]);
digitalWrite(timeDigits[1], binaryRow[1]);
digitalWrite(timeDigits[2], binaryRow[2]);
digitalWrite(timeDigits[3], binaryRow[3]);
}

void set3BitBinaryDigit(int timeDigits[], int binaryRow[]) {
digitalWrite(timeDigits[1], binaryRow[1]);
digitalWrite(timeDigits[2], binaryRow[2]);
digitalWrite(timeDigits[3], binaryRow[3]);
}

void set2BitBinaryDigit(int timeDigits[], int binaryRow[]) {
digitalWrite(timeDigits[2], binaryRow[2]);
digitalWrite(timeDigits[3], binaryRow[3]);
}

void loop() {
int binaryMatrix[10][4] = {
{0,0,0,0}, // 0
{0,0,0,1}, // 1
{0,0,1,0}, // 2
{0,0,1,1}, // 3
{0,1,0,0}, // 4
{0,1,0,1}, // 5
{0,1,1,0}, // 6
{0,1,1,1}, // 7
{1,0,0,0}, // 8
{1,0,0,1},// 9
};



for (int i = 0; i < 1000; ++i)
{
for (int i = 0; i <= 9; ++i) {
set4BitBinaryDigit(timeDigits[1], binaryMatrix[i], i);
delay(800);
}
}
}
[/sourcecode]


And a little video footage showing it in action.

Binary Counting With LEDs - Video Footage


http://youtu.be/hRk3L37uTxs

Saturday, January 19, 2013

Late Night Hardware Hacking - Self Aware LED Array

Late Night Hardware Hacking - Self Aware LED Array
http://youtu.be/0tCH0Vq0Uok

Self Aware LED Array Arduino Code


[sourcecode language="java"]
int led1 = 13;
int led2 = 12;
int led3 = 11;
int led4 = 10;
int pcpin = 0;
int pcread;
int x = 0;

void setup() {
Serial.begin(9600);
pinMode(led1, OUTPUT);
pinMode(led2, OUTPUT);
pinMode(led3, OUTPUT);
pinMode(led4, OUTPUT);
pinMode(pcpin, INPUT);
}

void log() {
pcread = analogRead(pcpin);
Serial.print("Photocell light level = ");
Serial.println(pcread);
delay(150);
}

void loop() {
log();
digitalWrite(led1, HIGH);
log();
digitalWrite(led1, LOW);

log();
digitalWrite(led2, HIGH);
log();
digitalWrite(led2, LOW);

log();
digitalWrite(led3, HIGH);
log();
digitalWrite(led3, LOW);

log();
digitalWrite(led4, HIGH);
log();
digitalWrite(led4, LOW);
}
[/sourcecode]

Just open up a serial monitor to watch your Arduino watch itself o_0

Second Build - Arduino Uno Photocell LED Controller

Second Build - Arduino Uno Photocell LED Controller

Here's the Arduino code to control this, I'm using A0 for the photocell and the LED requires a PWM pin for this application so I used ~11. The photocell detects if the light source drops below a certain level and turns on the LED if so.

[sourcecode language="java"]
int ledPin = 11;
int pcPin = 0;
int pcIn;

void setup(void) {
Serial.begin(9600);
}

void loop(void) {
pcIn = analogRead(pcPin);
Serial.print("Analog reading = ");
Serial.println(pcIn);
pcIn = 1023 - pcIn;

if (pcIn > 400) analogWrite(ledPin, 255);
else analogWrite(ledPin, 0);

delay(100);
}
[/sourcecode]

Here's some video footage of it in action:

http://www.youtube.com/watch?v=55GxkP6wnqM

Thursday, January 10, 2013

Picture frame that scrapes train times from the web

Being someone who takes the train everyday this is beyond geeky fun it's actually damn utilitarian. I might have to make this a secondary project after I finish my Arduino binary clock.

Wednesday, January 9, 2013

“Papertab” Paper Tablet Is Your Flexible Friend

“Papertab” Paper Tablet Is Your Flexible Friend




Bending the corner up or down allows you to “turn” pages back and forward, which is nice, but perhaps more interesting is the idea of combining multiple Papertabs (ten and upwards), with each showing different documents or running different apps. The Papertabs are designed to keep track of their location relative to other Papertabs, so you can show larger images by putting one next to another and having the image display across both. Take a look at the video below to see it in action.


Full Article on Stuff.tv

http://youtu.be/81iiGWdsJgg