#arch497
Explore tagged Tumblr posts
Photo
Flash Detector with Analog Interrupt Code
int flashes = 0;
int wait = 1000;
void setup()
{
pinMode(7,INPUT);
pinMode(13, OUTPUT);
Serial.begin(9600);
ACSR = B01011010; // comparator interrupt enabled and tripped on falling edge.
digitalWrite(13, HIGH);
}
void loop()
{
for(int i=0; i<flashes; i++)
{
digitalWrite(13, LOW);
delay(100);
digitalWrite(13, HIGH);
delay(100);
}
delay(1000);
}
ISR(ANALOG_COMP_vect)
{
flashes++;
Serial.print("Number of Flashes: ");
Serial.println(flashes);
delay(wait);
}
0 notes
Video
tumblr
int ledPins[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 }; // an array of pin numbers to which LEDs are attached int pinCount = 9; void setup (){ pinMode (1, OUTPUT); // different led patterns pinMode (2, OUTPUT); pinMode (3, OUTPUT); pinMode (4, OUTPUT); pinMode (5, OUTPUT); pinMode (6, OUTPUT); pinMode (8, OUTPUT); pinMode (7, OUTPUT); pinMode (9, OUTPUT); pinMode (10, OUTPUT); pinMode (11, OUTPUT); pinMode (12, OUTPUT); } void loop (){ digitalWrite (1, LOW); delay (60); digitalWrite (2, LOW); delay (59); digitalWrite (3, LOW); delay (58); digitalWrite (4, LOW); delay (57); digitalWrite (5, LOW); delay (56); digitalWrite (6, LOW); delay (55); digitalWrite (7, LOW); delay (54); digitalWrite (8, LOW); delay (53); digitalWrite (9, LOW); delay (52); digitalWrite (10, LOW); delay (51); digitalWrite (11, LOW); delay (50); digitalWrite (12, LOW); delay (49); digitalWrite (1, HIGH); delay (48); digitalWrite (2, HIGH); delay (47); digitalWrite (3, HIGH); delay (46); digitalWrite (4, HIGH); delay (45); digitalWrite (5, HIGH); delay (44); digitalWrite (6, HIGH); delay (43); digitalWrite (7, HIGH); delay (42); digitalWrite (8, HIGH); delay (41); digitalWrite (9, HIGH); delay (40); digitalWrite (10, HIGH); delay (39); digitalWrite (11, HIGH); delay (38); digitalWrite (12, HIGH); delay (37); digitalWrite (12, LOW); delay (60); digitalWrite (11, LOW); delay (59); digitalWrite (10, LOW); delay (58); digitalWrite (9, LOW); delay (57); digitalWrite (8, LOW); delay (56); digitalWrite (7, LOW); delay (55); digitalWrite (6, LOW); delay (54); digitalWrite (5, LOW); delay (53); digitalWrite (4, LOW); delay (52); digitalWrite (3, LOW); delay (51); digitalWrite (2, LOW); delay (50); digitalWrite (1, LOW); delay (49); digitalWrite (12, HIGH); delay (48); digitalWrite (11, HIGH); delay (47); digitalWrite (10, HIGH); delay (46); digitalWrite (9, HIGH); delay (45); digitalWrite (8, HIGH); delay (44); digitalWrite (7, HIGH); delay (43); digitalWrite (6, HIGH); delay (42); digitalWrite (5, HIGH); delay (41); digitalWrite (4, HIGH); delay (40); digitalWrite (3, HIGH); delay (39); digitalWrite (2, HIGH); delay (38); digitalWrite (1, HIGH); delay (37); digitalWrite (12, HIGH); delay (60); digitalWrite (11, HIGH); delay (59); digitalWrite (10, HIGH); delay (58); digitalWrite (9, HIGH); delay (57); digitalWrite (8, HIGH); delay (56); digitalWrite (7, HIGH); delay (55); digitalWrite (6, HIGH); delay (54); digitalWrite (5, HIGH); delay (53); digitalWrite (4, HIGH); delay (52); digitalWrite (3, HIGH); delay (51); digitalWrite (2, HIGH); delay (50); digitalWrite (1, HIGH); delay (49); digitalWrite (12, LOW); delay (48); digitalWrite (11, LOW); delay (47); digitalWrite (10, LOW); delay (46); digitalWrite (9, LOW); delay (45); digitalWrite (8, LOW); delay (44); digitalWrite (7, LOW); delay (43); digitalWrite (6, LOW); delay (42); digitalWrite (5, LOW); delay (41); digitalWrite (4, LOW); delay (40); digitalWrite (3, LOW); delay (39); digitalWrite (2, LOW); delay (38); digitalWrite (1, LOW); delay (37); digitalWrite (12, HIGH); delay (60); digitalWrite (10, HIGH); delay (59); digitalWrite (8, HIGH); delay (58); digitalWrite (6, HIGH); delay (57); digitalWrite (4, HIGH); delay (56); digitalWrite (2, HIGH); delay (55); digitalWrite (1, HIGH); delay (54); digitalWrite (3, HIGH); delay (53); digitalWrite (5, HIGH); delay (52); digitalWrite (7, HIGH); delay (51); digitalWrite (9, HIGH); delay (50); digitalWrite (11, HIGH); delay (49); digitalWrite (11, LOW); delay (48); digitalWrite (9, LOW); delay (47); digitalWrite (7, LOW); delay (46); digitalWrite (5, LOW); delay (45); digitalWrite (3, LOW); delay (44); digitalWrite (1, LOW); delay (43); digitalWrite (2, LOW); delay (42); digitalWrite (4, LOW); delay (41); digitalWrite (6, LOW); delay (40); digitalWrite (8, LOW); delay (39); digitalWrite (10, LOW); delay (38); digitalWrite (12, LOW); delay (37); digitalWrite (2, HIGH); delay (60); digitalWrite (4, HIGH); delay (59); digitalWrite (6, HIGH); delay (58); digitalWrite (8, HIGH); delay (57); digitalWrite (10, HIGH); delay (56); digitalWrite (12, HIGH); delay (55); digitalWrite (1, HIGH); delay (54); digitalWrite (3, HIGH); delay (53); digitalWrite (5, HIGH); delay (52); digitalWrite (7, HIGH); delay (51); digitalWrite (9, HIGH); delay (50); digitalWrite (11, HIGH); delay (49); digitalWrite (1, LOW); delay (48); digitalWrite (3, LOW); delay (47); digitalWrite (5, LOW); delay (46); digitalWrite (7, LOW); delay (45); digitalWrite (9, LOW); delay (44); digitalWrite (11, LOW); delay (43); digitalWrite (2, LOW); delay (42); digitalWrite (4, LOW); delay (41); digitalWrite (6, LOW); delay (40); digitalWrite (8, LOW); delay (39); digitalWrite (10, LOW); delay (38); digitalWrite (12, LOW); delay (37); digitalWrite (12, LOW); delay (60); digitalWrite (11, HIGH); delay (59); digitalWrite (10, LOW); delay (58); digitalWrite (9, HIGH); delay (57); digitalWrite (8, LOW); delay (56); digitalWrite (7, HIGH); delay (55); digitalWrite (6, LOW); delay (54); digitalWrite (5, HIGH); delay (53); digitalWrite (4, LOW); delay (52); digitalWrite (3, HIGH); delay (51); digitalWrite (2, LOW); delay (50); digitalWrite (1, HIGH); delay (49); digitalWrite (12, LOW); delay (48); digitalWrite (11, HIGH); delay (47); digitalWrite (10, LOW); delay (46); digitalWrite (9, HIGH); delay (45); digitalWrite (8, LOW); delay (44); digitalWrite (7, HIGH); delay (43); digitalWrite (6, LOW); delay (42); digitalWrite (5, HIGH); delay (41); digitalWrite (4, LOW); delay (40); digitalWrite (3, HIGH); delay (39); digitalWrite (2, LOW); delay (38); digitalWrite (1, HIGH); delay (37); digitalWrite (12, HIGH); delay (60); digitalWrite (11, LOW); delay (59); digitalWrite (10, HIGH); delay (58); digitalWrite (9, LOW); delay (57); digitalWrite (8, HIGH); delay (56); digitalWrite (7, LOW); delay (55); digitalWrite (6, HIGH); delay (54); digitalWrite (5, LOW); delay (53); digitalWrite (4, HIGH); delay (52); digitalWrite (3, LOW); delay (51); digitalWrite (2, HIGH); delay (50); digitalWrite (1, LOW); delay (49); digitalWrite (12, HIGH); delay (48); digitalWrite (11, LOW); delay (47); digitalWrite (10, HIGH); delay (46); digitalWrite (9, LOW); delay (45); digitalWrite (8, HIGH); delay (44); digitalWrite (7, LOW); delay (43); digitalWrite (6, HIGH); delay (42); digitalWrite (5, LOW); delay (41); digitalWrite (4, HIGH); delay (40); digitalWrite (3, LOW); delay (39); digitalWrite (2, HIGH); delay (38); digitalWrite (1, LOW); delay (37); digitalWrite (1, LOW); delay (60); digitalWrite (12, LOW); delay (59); digitalWrite (2, LOW); delay (58); digitalWrite (11, LOW); delay (57); digitalWrite (3, LOW); delay (56); digitalWrite (10, LOW); delay (55); digitalWrite (4, LOW); delay (54); digitalWrite (9, LOW); delay (53); digitalWrite (5, LOW); delay (52); digitalWrite (8, LOW); delay (51); digitalWrite (6, LOW); delay (50); digitalWrite (7, LOW); delay (49); digitalWrite (12, HIGH); delay (48); digitalWrite (1, HIGH); delay (47); digitalWrite (11, HIGH); delay (46); digitalWrite (2, HIGH); delay (45); digitalWrite (10, HIGH); delay (44); digitalWrite (3, HIGH); delay (43); digitalWrite (9, HIGH); delay (42); digitalWrite (4, HIGH); delay (41); digitalWrite (8, HIGH); delay (40); digitalWrite (5, HIGH); delay (39); digitalWrite (7, HIGH); delay (38); digitalWrite (6, HIGH); digitalWrite (12, LOW); delay (60); digitalWrite (1, LOW); delay (59); digitalWrite (11, LOW); delay (58); digitalWrite (2, LOW); delay (57); digitalWrite (10, LOW); delay (56); digitalWrite (3, LOW); delay (55); digitalWrite (9, LOW); delay (54); digitalWrite (4, LOW); delay (53); digitalWrite (8, LOW); delay (52); digitalWrite (5, LOW); delay (51); digitalWrite (7, LOW); delay (50); digitalWrite (6, LOW); delay (49); digitalWrite (1, HIGH); delay (48); digitalWrite (12, HIGH); delay (47); digitalWrite (2, HIGH); delay (46); digitalWrite (11, HIGH); delay (45); digitalWrite (3, HIGH); delay (44); digitalWrite (10, HIGH); delay (43); digitalWrite (4, HIGH); delay (42); digitalWrite (9, HIGH); delay (41); digitalWrite (5, HIGH); delay (40); digitalWrite (8, HIGH); delay (39); digitalWrite (6, HIGH); delay (38); digitalWrite (7, HIGH); }
0 notes
Video
tumblr
Blick - 5 LEDs blick as the 9th symphony of Beethoven
//9th sinphony - Beethoven
//naming time delay according to musical terms
int crotchet = 250;
int quaver = (crotchet / 2);
int minim = (crotchet + crotchet);
//naming LEDs to a musical note
int C = 8;
int D = 9;
int E = 10;
int F = 11;
int G = 12;
void setup()
{
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
pinMode(11, OUTPUT);
pinMode(12, OUTPUT);
}
void loop()
{
//E E F G G F E D C C D E E. D D.
digitalWrite(E, HIGH);
delay(crotchet);
digitalWrite(E, LOW);
delay(crotchet);
digitalWrite(E, HIGH);
delay(crotchet);
digitalWrite(E, LOW);
delay(crotchet);
digitalWrite(F, HIGH);
delay(crotchet);
digitalWrite(F, LOW);
delay(crotchet);
digitalWrite(G, HIGH);
delay(crotchet);
digitalWrite(G, LOW);
delay(crotchet);
digitalWrite(G, HIGH);
delay(crotchet);
digitalWrite(G, LOW);
delay(crotchet);
digitalWrite(F, HIGH);
delay(crotchet);
digitalWrite(F, LOW);
delay(crotchet);
digitalWrite(E, HIGH);
delay(crotchet);
digitalWrite(E, LOW);
delay(crotchet);
digitalWrite(D, HIGH);
delay(crotchet);
digitalWrite(D, LOW);
delay(crotchet);
digitalWrite(C, HIGH);
delay(crotchet);
digitalWrite(C, LOW);
delay(crotchet);
digitalWrite(C, HIGH);
delay(crotchet);
digitalWrite(C, LOW);
delay(crotchet);
digitalWrite(D, HIGH);
delay(crotchet);
digitalWrite(D, LOW);
delay(crotchet);
digitalWrite(E, HIGH);
delay(crotchet);
digitalWrite(E, LOW);
delay(crotchet);
digitalWrite(E, HIGH);
delay(minim);
digitalWrite(E, LOW);
delay(crotchet);
digitalWrite(D, HIGH);
delay(quaver);
digitalWrite(D, LOW);
delay(quaver);
digitalWrite(D, HIGH);
delay(minim);
digitalWrite(D, LOW);
delay(crotchet);
}
0 notes
Video
tumblr
blinking led experiments
0 notes
Video
tumblr
Camera Flash around Crown Hall
0 notes
Video
tumblr
Assignment #1
blick light with delay variation
0 notes
Photo
light and shadow on glass
reflection image on floor
8 notes
·
View notes
Link
Brooklyn artist Ted Lawson hooked himself up to a robotic painting machine that used his blood as ink to draw a nude portrait of himself.
0 notes