Friday, May 15, 2020
Sunday, December 23, 2018
4*4*4 LED Cube
int layer[4]={A3,A2,A1,A0}; //initializing and declaring led layers
int column[16]={13,12,11,10,9,8,7,6,5,4,3,2,1,0,A5,A4}; //initializing and declaring led rows
int time = 250;
void setup()
{
for(int i = 0; i<16; i++)
{
pinMode(column[i], OUTPUT); //setting rows to ouput
}
for(int i = 0; i<4; i++)
{
pinMode(layer[i], OUTPUT); //setting layers to output
}
randomSeed(analogRead(10)); //seeding random for random pattern
}
void loop()
{
turnEverythingOff();
flickerOn();
turnEverythingOn();
delay(time);
turnOnAndOffAllByLayerUpAndDownNotTimed();
layerstompUpAndDown();
spiralInAndOut();
turnOnAndOffAllByColumnSideways();
delay(time);
aroundEdgeDown();
turnEverythingOff();
randomflicker();
randomRain();
diagonalRectangle();
goThroughAllLedsOneAtATime();
propeller();
spiralInAndOut();
flickerOff();
turnEverythingOff();
delay(2000);
}
//turn all off
void turnEverythingOff()
{
for(int i = 0; i<16; i++)
{
digitalWrite(column[i], 1);
}
for(int i = 0; i<4; i++)
{
digitalWrite(layer[i], 0);
}
}
//turn all on
void turnEverythingOn()
{
for(int i = 0; i<16; i++)
{
digitalWrite(column[i], 0);
}
//turning on layers
for(int i = 0; i<4; i++)
{
digitalWrite(layer[i], 1);
}
}
//turn columns off
void turnColumnsOff()
{
for(int i = 0; i<16; i++)
{
digitalWrite(column[i], 1);
}
}
//flicker on
void flickerOn()
{
int i = 150;
while(i != 0)
{
turnEverythingOn();
delay(i);
turnEverythingOff();
delay(i);
i-= 5;
}
}
//turn everything on and off by layer up and down NOT TIMED
void turnOnAndOffAllByLayerUpAndDownNotTimed()
{
int x = 75;
for(int i = 5; i != 0; i--)
{
turnEverythingOn();
for(int i = 4; i!=0; i--)
{
digitalWrite(layer[i-1], 0);
delay(x);
}
for(int i = 0; i<4; i++)
{
digitalWrite(layer[i], 1);
delay(x);
}
for(int i = 0; i<4; i++)
{
digitalWrite(layer[i], 0);
delay(x);
}
for(int i = 4; i!=0; i--)
{
digitalWrite(layer[i-1], 1);
delay(x);
}
}
}
//turn everything on and off by column sideways
void turnOnAndOffAllByColumnSideways()
{
int x = 75;
turnEverythingOff();
//turn on layers
for(int i = 0; i<4; i++)
{
digitalWrite(layer[i], 1);
}
for(int y = 0; y<3; y++)
{
//turn on 0-3
for(int i = 0; i<4; i++)
{
digitalWrite(column[i], 0);
delay(x);
}
//turn on 4-7
for(int i = 4; i<8; i++)
{
digitalWrite(column[i], 0);
delay(x);
}
//turn on 8-11
for(int i = 8; i<12; i++)
{
digitalWrite(column[i], 0);
delay(x);
}
//turn on 12-15
for(int i = 12; i<16; i++)
{
digitalWrite(column[i], 0);
delay(x);
}
//turn off 0-3
for(int i = 0; i<4; i++)
{
digitalWrite(column[i], 1);
delay(x);
}
//turn off 4-7
for(int i = 4; i<8; i++)
{
digitalWrite(column[i], 1);
delay(x);
}
//turn off 8-11
for(int i = 8; i<12; i++)
{
digitalWrite(column[i], 1);
delay(x);
}
//turn off 12-15
for(int i = 12; i<16; i++)
{
digitalWrite(column[i], 1);
delay(x);
}
//turn on 12-15
for(int i = 12; i<16; i++)
{
digitalWrite(column[i], 0);
delay(x);
}
//turn on 8-11
for(int i = 8; i<12; i++)
{
digitalWrite(column[i], 0);
delay(x);
}
//turn on 4-7
for(int i = 4; i<8; i++)
{
digitalWrite(column[i], 0);
delay(x);
}
//turn on 0-3
for(int i = 0; i<4; i++)
{
digitalWrite(column[i], 0);
delay(x);
}
//turn off 12-15
for(int i = 12; i<16; i++)
{
digitalWrite(column[i], 1);
delay(x);
}
//turn off 8-11
for(int i = 8; i<12; i++)
{
digitalWrite(column[i], 1);
delay(x);
}
//turn off 4-7
for(int i = 4; i<8; i++)
{
digitalWrite(column[i], 1);
delay(x);
}
//turn off 0-3
for(int i = 0; i<4; i++)
{
digitalWrite(column[i], 1);
delay(x);
}
}
}
//up and down single layer stomp
void layerstompUpAndDown()
{
int x = 75;
for(int i = 0; i<4; i++)
{
digitalWrite(layer[i], 0);
}
for(int y = 0; y<5; y++)
{
for(int count = 0; count<1; count++)
{
for(int i = 0; i<4; i++)
{
digitalWrite(layer[i], 1);
delay(x);
digitalWrite(layer[i], 0);
}
for(int i = 4; i !=0; i--)
{
digitalWrite(layer[i-1], 1);
delay(x);
digitalWrite(layer[i-1], 0);
}
}
for(int i = 0; i<4; i++)
{
digitalWrite(layer[i], 1);
delay(x);
}
for(int i = 4; i!=0; i--)
{
digitalWrite(layer[i-1], 0);
delay(x);
}
}
}
//flicker off
void flickerOff()
{
turnEverythingOn();
for(int i = 0; i!= 150; i+=5)
{
turnEverythingOff();
delay(i+50);
turnEverythingOn();
delay(i);
}
}
//around edge of the cube down
void aroundEdgeDown()
{
for(int x = 200; x != 0; x -=50)
{
turnEverythingOff();
for(int i = 4; i != 0; i--)
{
digitalWrite(layer[i-1], 1);
digitalWrite(column[5], 0);
digitalWrite(column[6], 0);
digitalWrite(column[9], 0);
digitalWrite(column[10], 0);
digitalWrite(column[0], 0);
delay(x);
digitalWrite(column[0], 1);
digitalWrite(column[4], 0);
delay(x);
digitalWrite(column[4], 1);
digitalWrite(column[8], 0);
delay(x);
digitalWrite(column[8], 1);
digitalWrite(column[12], 0);
delay(x);
digitalWrite(column[12], 1);
digitalWrite(column[13], 0);
delay(x);
digitalWrite(column[13], 1);
digitalWrite(column[15], 0);
delay(x);
digitalWrite(column[15], 1);
digitalWrite(column[14], 0);
delay(x);
digitalWrite(column[14], 1);
digitalWrite(column[11], 0);
delay(x);
digitalWrite(column[11], 1);
digitalWrite(column[7], 0);
delay(x);
digitalWrite(column[7], 1);
digitalWrite(column[3], 0);
delay(x);
digitalWrite(column[3], 1);
digitalWrite(column[2], 0);
delay(x);
digitalWrite(column[2], 1);
digitalWrite(column[1], 0);
delay(x);
digitalWrite(column[1], 1);
}
}
}
//random flicker
void randomflicker()
{
turnEverythingOff();
int x = 10;
for(int i = 0; i !=750; i+=2)
{
int randomLayer = random(0,4);
int randomColumn = random(0,16);
digitalWrite(layer[randomLayer], 1);
digitalWrite(column[randomColumn], 0);
delay(x);
digitalWrite(layer[randomLayer], 0);
digitalWrite(column[randomColumn], 1);
delay(x);
}
}
//random rain
void randomRain()
{
turnEverythingOff();
int x = 100;
for(int i = 0; i!=60; i+=2)
{
int randomColumn = random(0,16);
digitalWrite(column[randomColumn], 0);
digitalWrite(layer[0], 1);
delay(x+50);
digitalWrite(layer[0], 0);
digitalWrite(layer[1], 1);
delay(x);
digitalWrite(layer[1], 0);
digitalWrite(layer[2], 1);
delay(x);
digitalWrite(layer[2], 0);
digitalWrite(layer[3], 1);
delay(x+50);
digitalWrite(layer[3], 0);
digitalWrite(column[randomColumn], 1);
}
}
//diagonal rectangle
void diagonalRectangle()
{
int x = 350;
turnEverythingOff();
for(int count = 0; count<5; count++)
{
//top left
for(int i = 0; i<8; i++)
{
digitalWrite(column[i], 0);
}
digitalWrite(layer[3], 1);
digitalWrite(layer[2], 1);
delay(x);
turnEverythingOff();
//middle middle
for(int i = 4; i<12; i++)
{
digitalWrite(column[i], 0);
}
digitalWrite(layer[1], 1);
digitalWrite(layer[2], 1);
delay(x);
turnEverythingOff();
//bottom right
for(int i = 8; i<16; i++)
{
digitalWrite(column[i], 0);
}
digitalWrite(layer[0], 1);
digitalWrite(layer[1], 1);
delay(x);
turnEverythingOff();
//bottom middle
for(int i = 4; i<12; i++)
{
digitalWrite(column[i], 0);
}
digitalWrite(layer[0], 1);
digitalWrite(layer[1], 1);
delay(x);
turnEverythingOff();
//bottom left
for(int i = 0; i<8; i++)
{
digitalWrite(column[i], 0);
}
digitalWrite(layer[0], 1);
digitalWrite(layer[1], 1);
delay(x);
turnEverythingOff();
//middle middle
for(int i = 4; i<12; i++)
{
digitalWrite(column[i], 0);
}
digitalWrite(layer[1], 1);
digitalWrite(layer[2], 1);
delay(x);
turnEverythingOff();
//top right
for(int i = 8; i<16; i++)
{
digitalWrite(column[i], 0);
}
digitalWrite(layer[2], 1);
digitalWrite(layer[3], 1);
delay(x);
turnEverythingOff();
//top middle
for(int i = 4; i<12; i++)
{
digitalWrite(column[i], 0);
}
digitalWrite(layer[2], 1);
digitalWrite(layer[3], 1);
delay(x);
turnEverythingOff();
}
//top left
for(int i = 0; i<8; i++)
{
digitalWrite(column[i], 0);
}
digitalWrite(layer[3], 1);
digitalWrite(layer[2], 1);
delay(x);
turnEverythingOff();
}
//propeller
void propeller()
{
turnEverythingOff();
int x = 90;
for(int y = 4; y>0; y--)
{
for(int i = 0; i<6; i++)
{
//turn on layer
digitalWrite(layer[y-1], 1);
//a1
turnColumnsOff();
digitalWrite(column[0], 0);
digitalWrite(column[5], 0);
digitalWrite(column[10], 0);
digitalWrite(column[15], 0);
delay(x);
//b1
turnColumnsOff();
digitalWrite(column[4], 0);
digitalWrite(column[5], 0);
digitalWrite(column[10], 0);
digitalWrite(column[11], 0);
delay(x);
//c1
turnColumnsOff();
digitalWrite(column[6], 0);
digitalWrite(column[7], 0);
digitalWrite(column[8], 0);
digitalWrite(column[9], 0);
delay(x);
//d1
turnColumnsOff();
digitalWrite(column[3], 0);
digitalWrite(column[6], 0);
digitalWrite(column[9], 0);
digitalWrite(column[12], 0);
delay(x);
//d2
turnColumnsOff();
digitalWrite(column[2], 0);
digitalWrite(column[6], 0);
digitalWrite(column[9], 0);
digitalWrite(column[13], 0);
delay(x);
//d3
turnColumnsOff();
digitalWrite(column[1], 0);
digitalWrite(column[5], 0);
digitalWrite(column[10], 0);
digitalWrite(column[14], 0);
delay(x);
}
}
//d4
turnColumnsOff();
digitalWrite(column[0], 0);
digitalWrite(column[5], 0);
digitalWrite(column[10], 0);
digitalWrite(column[15], 0);
delay(x);
}
//spiral in and out
void spiralInAndOut()
{
turnEverythingOn();
int x = 60;
for(int i = 0; i<6; i++)
{
//spiral in clockwise
digitalWrite(column[0], 1);
delay(x);
digitalWrite(column[1], 1);
delay(x);
digitalWrite(column[2], 1);
delay(x);
digitalWrite(column[3], 1);
delay(x);
digitalWrite(column[7], 1);
delay(x);
digitalWrite(column[11], 1);
delay(x);
digitalWrite(column[15], 1);
delay(x);
digitalWrite(column[14], 1);
delay(x);
digitalWrite(column[13], 1);
delay(x);
digitalWrite(column[12], 1);
delay(x);
digitalWrite(column[8], 1);
delay(x);
digitalWrite(column[4], 1);
delay(x);
digitalWrite(column[5], 1);
delay(x);
digitalWrite(column[6], 1);
delay(x);
digitalWrite(column[10], 1);
delay(x);
digitalWrite(column[9], 1);
delay(x);
//spiral out counter clockwise
digitalWrite(column[9], 0);
delay(x);
digitalWrite(column[10], 0);
delay(x);
digitalWrite(column[6], 0);
delay(x);
digitalWrite(column[5], 0);
delay(x);
digitalWrite(column[4], 0);
delay(x);
digitalWrite(column[8], 0);
delay(x);
digitalWrite(column[12], 0);
delay(x);
digitalWrite(column[13], 0);
delay(x);
digitalWrite(column[14], 0);
delay(x);
digitalWrite(column[15], 0);
delay(x);
digitalWrite(column[11], 0);
delay(x);
digitalWrite(column[7], 0);
delay(x);
digitalWrite(column[3], 0);
delay(x);
digitalWrite(column[2], 0);
delay(x);
digitalWrite(column[1], 0);
delay(x);
digitalWrite(column[0], 0);
delay(x);
//spiral in counter clock wise
digitalWrite(column[0], 1);
delay(x);
digitalWrite(column[4], 1);
delay(x);
digitalWrite(column[8], 1);
delay(x);
digitalWrite(column[12], 1);
delay(x);
digitalWrite(column[13], 1);
delay(x);
digitalWrite(column[14], 1);
delay(x);
digitalWrite(column[15], 1);
delay(x);
digitalWrite(column[11], 1);
delay(x);
digitalWrite(column[7], 1);
delay(x);
digitalWrite(column[3], 1);
delay(x);
digitalWrite(column[2], 1);
delay(x);
digitalWrite(column[1], 1);
delay(x);
digitalWrite(column[5], 1);
delay(x);
digitalWrite(column[9], 1);
delay(x);
digitalWrite(column[10], 1);
delay(x);
digitalWrite(column[6], 1);
delay(x);
//spiral out clock wise
digitalWrite(column[6], 0);
delay(x);
digitalWrite(column[10], 0);
delay(x);
digitalWrite(column[9], 0);
delay(x);
digitalWrite(column[5], 0);
delay(x);
digitalWrite(column[1], 0);
delay(x);
digitalWrite(column[2], 0);
delay(x);
digitalWrite(column[3], 0);
delay(x);
digitalWrite(column[7], 0);
delay(x);
digitalWrite(column[11], 0);
delay(x);
digitalWrite(column[15], 0);
delay(x);
digitalWrite(column[14], 0);
delay(x);
digitalWrite(column[13], 0);
delay(x);
digitalWrite(column[12], 0);
delay(x);
digitalWrite(column[8], 0);
delay(x);
digitalWrite(column[4], 0);
delay(x);
digitalWrite(column[0], 0);
delay(x);
}
}
//go through all leds one at a time
void goThroughAllLedsOneAtATime()
{
int x = 15;
turnEverythingOff();
for(int y = 0; y<5; y++)
{
//0-3
for(int count = 4; count != 0; count--)
{
digitalWrite(layer[count-1], 1);
for(int i = 0; i<4; i++)
{
digitalWrite(column[i], 0);
delay(x);
digitalWrite(column[i], 1);
delay(x);
}
digitalWrite(layer[count-1], 0);
}
//4-7
for(int count = 0; count < 4; count++)
{
digitalWrite(layer[count], 1);
for(int i = 4; i<8; i++)
{
digitalWrite(column[i], 0);
delay(x);
digitalWrite(column[i], 1);
delay(x);
}
digitalWrite(layer[count], 0);
}
//8-11
for(int count = 4; count != 0; count--)
{
digitalWrite(layer[count-1], 1);
for(int i = 8; i<12; i++)
{
digitalWrite(column[i], 0);
delay(x);
digitalWrite(column[i], 1);
delay(x);
}
digitalWrite(layer[count-1], 0);
}
//12-15
for(int count = 0; count < 4; count++)
{
digitalWrite(layer[count], 1);
for(int i = 12; i<16; i++)
{
digitalWrite(column[i], 0);
delay(x);
digitalWrite(column[i], 1);
delay(x);
}
digitalWrite(layer[count], 0);
}
}
}
Thursday, November 22, 2018
12 LED Chaser Program code
void setup(){
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
pinMode(11, OUTPUT);
pinMode(12, OUTPUT);
pinMode(13, OUTPUT);
}
void loop(){
digitalWrite(4, HIGH);
delay(100);
digitalWrite(4, LOW);
delay(100);
digitalWrite(4, HIGH);
delay(100);
digitalWrite(4, LOW);
delay(100);
digitalWrite(8, HIGH);
delay(100);
digitalWrite(8, LOW);
delay(100);
digitalWrite(8, HIGH);
delay(100);
digitalWrite(8, LOW);
delay(100);
digitalWrite(2, HIGH);
delay(100);
digitalWrite(2, LOW);
delay(100);
digitalWrite(2, HIGH);
delay(100);
digitalWrite(2, LOW);
delay(100);
digitalWrite(10, HIGH);
delay(100);
digitalWrite(10, LOW);
delay(100);
digitalWrite(10, HIGH);
delay(100);
digitalWrite(10, LOW);
delay(100);
digitalWrite(3, HIGH);
delay(100);
digitalWrite(3, LOW);
delay(100);
digitalWrite(3, HIGH);
delay(100);
digitalWrite(3, LOW);
delay(100);
digitalWrite(13, HIGH);
delay(100);
digitalWrite(13, LOW);
delay(100);
digitalWrite(13, HIGH);
delay(100);
digitalWrite(13, LOW);
delay(100);
digitalWrite(7, HIGH);
delay(100);
digitalWrite(7, LOW);
delay(100);
digitalWrite(7, HIGH);
delay(100);
digitalWrite(7, LOW);
delay(100);
digitalWrite(12, HIGH);
delay(100);
digitalWrite(12, LOW);
delay(100);
digitalWrite(12, HIGH);
delay(100);
digitalWrite(12, LOW);
delay(100);
digitalWrite(5, HIGH);
delay(100);
digitalWrite(5, LOW);
delay(100);
digitalWrite(5, HIGH);
delay(100);
digitalWrite(5, LOW);
delay(100);
digitalWrite(11, HIGH);
delay(100);
digitalWrite(11, LOW);
delay(100);
digitalWrite(11, HIGH);
delay(100);
digitalWrite(11, LOW);
delay(100);
digitalWrite(6, HIGH);
delay(100);
digitalWrite(6, LOW);
delay(100);
digitalWrite(6, HIGH);
delay(100);
digitalWrite(6, LOW);
delay(100);
digitalWrite(9, HIGH);
delay(100);
digitalWrite(9, LOW);
delay(100);
digitalWrite(9, HIGH);
delay(100);
digitalWrite(9, LOW);
delay(100);
digitalWrite(13, HIGH);
delay(100);
digitalWrite(13, LOW);
delay(100);
digitalWrite(12, HIGH);
delay(100);
digitalWrite(12, LOW);
delay(100);
digitalWrite(11, HIGH);
delay(100);
digitalWrite(11, LOW);
delay(100);
digitalWrite(10, HIGH);
delay(100);
digitalWrite(10, LOW);
delay(100);
digitalWrite(9, HIGH);
delay(100);
digitalWrite(9, LOW);
delay(100);
digitalWrite(8, HIGH);
delay(100);
digitalWrite(8, LOW);
delay(100);
digitalWrite(7, HIGH);
delay(100);
digitalWrite(7, LOW);
delay(100);
digitalWrite(6, HIGH);
delay(100);
digitalWrite(6, LOW);
delay(100);
digitalWrite(5, HIGH);
delay(100);
digitalWrite(5, LOW);
delay(100);
digitalWrite(4, HIGH);
delay(100);
digitalWrite(4, LOW);
delay(100);
digitalWrite(3, HIGH);
delay(100);
digitalWrite(3, LOW);
delay(100);
digitalWrite(2, HIGH);
delay(100);
digitalWrite(2, LOW);
delay(100);
digitalWrite(2, HIGH);
delay(100);
digitalWrite(3, HIGH);
delay(100);
digitalWrite(4, HIGH);
delay(100);
digitalWrite(5, HIGH);
delay(100);
digitalWrite(6, HIGH);
delay(100);
digitalWrite(7, HIGH);
delay(100);
digitalWrite(8, HIGH);
delay(100);
digitalWrite(9, HIGH);
delay(100);
digitalWrite(10, HIGH);
delay(100);
digitalWrite(11, HIGH);
delay(100);
digitalWrite(12, HIGH);
delay(100);
digitalWrite(13, HIGH);
delay(100);
digitalWrite(2,LOW);
delay(100);
digitalWrite(3,LOW);
delay(100);
digitalWrite(4,LOW);
delay(100);
digitalWrite(5,LOW);
delay(100);
digitalWrite(6,LOW);
delay(100);
digitalWrite(7,LOW);
delay(100);
digitalWrite(8,LOW);
delay(100);
digitalWrite(9,LOW);
delay(100);
digitalWrite(10,LOW);
delay(100);
digitalWrite(11,LOW);
delay(100);
digitalWrite(12,LOW);
delay(100);
digitalWrite(13,LOW);
delay(100);
digitalWrite(13,HIGH);
delay(100);
digitalWrite(2,HIGH);
delay(100);
digitalWrite(12,HIGH);
delay(100);
digitalWrite(3,HIGH);
delay(100);
digitalWrite(11,HIGH);
delay(100);
digitalWrite(4,HIGH);
delay(100);
digitalWrite(10,HIGH);
delay(100);
digitalWrite(5,HIGH);
delay(100);
digitalWrite(9,HIGH);
delay(100);
digitalWrite(6,HIGH);
delay(100);
digitalWrite(8,HIGH);
delay(100);
digitalWrite(7,HIGH);
delay(100);
digitalWrite(2, HIGH);
delay(100);
digitalWrite(2, LOW);
delay(100);
digitalWrite(3, HIGH);
delay(100);
digitalWrite(3, LOW);
delay(100);
digitalWrite(4, HIGH);
delay(100);
digitalWrite(4, LOW);
delay(100);
digitalWrite(5, HIGH);
delay(100);
digitalWrite(5, LOW);
delay(100);
digitalWrite(6, HIGH);
delay(100);
digitalWrite(6, LOW);
delay(100);
digitalWrite(7, HIGH);
delay(100);
digitalWrite(7, LOW);
delay(100);
digitalWrite(8, HIGH);
delay(100);
digitalWrite(8, LOW);
delay(100);
digitalWrite(9, HIGH);
delay(100);
digitalWrite(9, LOW);
delay(100);
digitalWrite(10, HIGH);
delay(100);
digitalWrite(10, LOW);
delay(100);
digitalWrite(11, HIGH);
delay(100);
digitalWrite(11, LOW);
delay(100);
digitalWrite(12, HIGH);
delay(100);
digitalWrite(12, LOW);
delay(100);
digitalWrite(13, HIGH);
delay(100);
digitalWrite(13, LOW);
delay(100);
digitalWrite(2, HIGH);
delay(100);
digitalWrite(3, HIGH);
delay(100);
digitalWrite(4, HIGH);
delay(100);
digitalWrite(5, HIGH);
delay(100);
digitalWrite(6, HIGH);
delay(100);
digitalWrite(7, HIGH);
delay(100);
digitalWrite(8, HIGH);
delay(100);
digitalWrite(9, HIGH);
delay(100);
digitalWrite(10, HIGH);
delay(100);
digitalWrite(11, HIGH);
delay(100);
digitalWrite(12, HIGH);
delay(100);
digitalWrite(13, HIGH);
delay(100);
digitalWrite(13,LOW);
delay(100);
digitalWrite(12,LOW);
delay(100);
digitalWrite(11,LOW);
delay(100);
digitalWrite(10,LOW);
delay(100);
digitalWrite(9,LOW);
delay(100);
digitalWrite(8,LOW);
delay(100);
digitalWrite(7,LOW);
delay(100);
digitalWrite(6,LOW);
delay(100);
digitalWrite(5,LOW);
delay(100);
digitalWrite(4,LOW);
delay(100);
digitalWrite(3,LOW);
delay(100);
digitalWrite(2,LOW);
delay(100);
digitalWrite(2, HIGH);
delay(100);
digitalWrite(2, LOW);
delay(100);
digitalWrite(3, HIGH);
delay(100);
digitalWrite(3, LOW);
delay(100);
digitalWrite(4, HIGH);
delay(100);
digitalWrite(4, LOW);
delay(100);
digitalWrite(5, HIGH);
delay(100);
digitalWrite(5, LOW);
delay(100);
digitalWrite(6, HIGH);
delay(100);
digitalWrite(6, LOW);
delay(100);
digitalWrite(7, HIGH);
delay(100);
digitalWrite(7, LOW);
delay(100);
digitalWrite(8, HIGH);
delay(100);
digitalWrite(8, LOW);
delay(100);
digitalWrite(9, HIGH);
delay(100);
digitalWrite(9, LOW);
delay(100);
digitalWrite(10, HIGH);
delay(100);
digitalWrite(10, LOW);
delay(100);
digitalWrite(11, HIGH);
delay(100);
digitalWrite(11, LOW);
delay(100);
digitalWrite(12, HIGH);
delay(100);
digitalWrite(12, LOW);
delay(100);
digitalWrite(13, HIGH);
delay(100);
digitalWrite(13, LOW);
delay(100);
digitalWrite(13, HIGH);
delay(100);
digitalWrite(12, HIGH);
delay(100);
digitalWrite(11, HIGH);
delay(100);
digitalWrite(10, HIGH);
delay(100);
digitalWrite(9, HIGH);
delay(100);
digitalWrite(8, HIGH);
delay(100);
digitalWrite(7, HIGH);
delay(100);
digitalWrite(6, HIGH);
delay(100);
digitalWrite(5, HIGH);
delay(100);
digitalWrite(4, HIGH);
delay(100);
digitalWrite(3, HIGH);
delay(100);
digitalWrite(2, HIGH);
delay(100);
digitalWrite(13,LOW);
delay(100);
digitalWrite(2,LOW);
delay(100);
digitalWrite(12,LOW);
delay(100);
digitalWrite(3,LOW);
delay(100);
digitalWrite(11,LOW);
delay(100);
digitalWrite(4,LOW);
delay(100);
digitalWrite(10,LOW);
delay(100);
digitalWrite(5,LOW);
delay(100);
digitalWrite(9,LOW);
delay(100);
digitalWrite(6,LOW);
delay(100);
digitalWrite(8,LOW);
delay(100);
digitalWrite(7,LOW);
delay(100);
digitalWrite(13, HIGH);
delay(100);
digitalWrite(12, HIGH);
delay(100);
digitalWrite(11, HIGH);
delay(100);
digitalWrite(11,LOW);
delay(100);
digitalWrite(12,LOW);
delay(100);
digitalWrite(13,LOW);
delay(100);
digitalWrite(10, HIGH);
delay(100);
digitalWrite(9, HIGH);
delay(100);
digitalWrite(8, HIGH);
delay(100);
digitalWrite(8,LOW);
delay(100);
digitalWrite(9,LOW);
delay(100);
digitalWrite(10,LOW);
delay(100);
digitalWrite(7, HIGH);
delay(100);
digitalWrite(6, HIGH);
delay(100);
digitalWrite(5, HIGH);
delay(100);
digitalWrite(5,LOW);
delay(100);
digitalWrite(6,LOW);
delay(100);
digitalWrite(7,LOW);
delay(100);
digitalWrite(4, HIGH);
delay(100);
digitalWrite(3, HIGH);
delay(100);
digitalWrite(2, HIGH);
delay(100);
digitalWrite(2,LOW);
delay(100);
digitalWrite(3,LOW);
delay(100);
digitalWrite(4,LOW);
delay(100);
digitalWrite(13, HIGH);
delay(100);
digitalWrite(13, LOW);
delay(100);
digitalWrite(13, HIGH);
delay(100);
digitalWrite(13, LOW);
delay(100);
digitalWrite(12, HIGH);
delay(100);
digitalWrite(12, LOW);
delay(100);
digitalWrite(12, HIGH);
delay(100);
digitalWrite(12, LOW);
delay(100);
digitalWrite(11, HIGH);
delay(100);
digitalWrite(11, LOW);
delay(100);
digitalWrite(11, HIGH);
delay(100);
digitalWrite(11, LOW);
delay(100);
digitalWrite(10, HIGH);
delay(100);
digitalWrite(10, LOW);
delay(100);
digitalWrite(10, HIGH);
delay(100);
digitalWrite(10, LOW);
delay(100);
digitalWrite(9, HIGH);
delay(100);
digitalWrite(9, LOW);
delay(100);
digitalWrite(9, HIGH);
delay(100);
digitalWrite(9, LOW);
delay(100);
digitalWrite(8, HIGH);
delay(100);
digitalWrite(8, LOW);
delay(100);
digitalWrite(8, HIGH);
delay(100);
digitalWrite(8, LOW);
delay(100);
digitalWrite(7, HIGH);
delay(100);
digitalWrite(7, LOW);
delay(100);
digitalWrite(7, HIGH);
delay(100);
digitalWrite(7, LOW);
delay(100);
digitalWrite(6, HIGH);
delay(100);
digitalWrite(6, LOW);
delay(100);
digitalWrite(6, HIGH);
delay(100);
digitalWrite(6, LOW);
delay(100);
digitalWrite(5, HIGH);
delay(100);
digitalWrite(5, LOW);
delay(100);
digitalWrite(5, HIGH);
delay(100);
digitalWrite(5, LOW);
delay(100);
digitalWrite(4, HIGH);
delay(100);
digitalWrite(4, LOW);
delay(100);
digitalWrite(4, HIGH);
delay(100);
digitalWrite(4, LOW);
delay(100);
digitalWrite(3, HIGH);
delay(100);
digitalWrite(3, LOW);
delay(100);
digitalWrite(3, HIGH);
delay(100);
digitalWrite(3, LOW);
delay(100);
digitalWrite(2, HIGH);
delay(100);
digitalWrite(2, LOW);
delay(100);
digitalWrite(2, HIGH);
delay(100);
digitalWrite(2, LOW);
delay(100);
digitalWrite(2, HIGH);
delay(100);
digitalWrite(3, HIGH);
delay(100);
digitalWrite(4, HIGH);
delay(100);
digitalWrite(5, HIGH);
delay(100);
digitalWrite(6, HIGH);
delay(100);
digitalWrite(7, HIGH);
delay(100);
digitalWrite(8, HIGH);
delay(100);
digitalWrite(9, HIGH);
delay(100);
digitalWrite(10, HIGH);
delay(100);
digitalWrite(11, HIGH);
delay(100);
digitalWrite(12, HIGH);
delay(100);
digitalWrite(13, HIGH);
delay(100);
digitalWrite(2, LOW);
delay(100);
digitalWrite(2, HIGH);
delay(100);
digitalWrite(3, LOW);
delay(100);
digitalWrite(3, HIGH);
delay(100);
digitalWrite(4, LOW);
delay(100);
digitalWrite(4, HIGH);
delay(100);
digitalWrite(5, LOW);
delay(100);
digitalWrite(5, HIGH);
delay(100);
digitalWrite(6, LOW);
delay(100);
digitalWrite(6, HIGH);
delay(100);
digitalWrite(7, LOW);
delay(100);
digitalWrite(7, HIGH);
delay(100);
digitalWrite(8, LOW);
delay(100);
digitalWrite(8, HIGH);
delay(100);
digitalWrite(9, LOW);
delay(100);
digitalWrite(9, HIGH);
delay(100);
digitalWrite(10, LOW);
delay(100);
digitalWrite(10, HIGH);
delay(100);
digitalWrite(11, LOW);
delay(100);
digitalWrite(11, HIGH);
delay(100);
digitalWrite(12, LOW);
delay(100);
digitalWrite(12, HIGH);
delay(100);
digitalWrite(13, LOW);
delay(100);
digitalWrite(13, HIGH);
delay(100);
digitalWrite(13,LOW);
delay(100);
digitalWrite(12,LOW);
delay(100);
digitalWrite(11,LOW);
delay(100);
digitalWrite(10,LOW);
delay(100);
digitalWrite(9,LOW);
delay(100);
digitalWrite(8,LOW);
delay(100);
digitalWrite(7,LOW);
delay(100);
digitalWrite(6,LOW);
delay(100);
digitalWrite(5,LOW);
delay(100);
digitalWrite(4,LOW);
delay(100);
digitalWrite(3,LOW);
delay(100);
digitalWrite(2,LOW);
delay(100);
}
Tuesday, November 13, 2018
POV Display
//YOUTUBE.COM/TAMILCREATOR007
//FACEBOOK.COM/TAMILCREATOR007
int NUMBER9[]={1,1,1,1,0,0,0,1, 1,0,0,1,0,0,0,1, 1,0,0,1,0,0,0,1, 1,0,0,1,0,0,0,1, 1,1,1,1,1,1,1,1};
int NUMBER8[]={0,1,1,0,1,1,1,0, 1,0,0,1,0,0,0,1, 1,0,0,1,0,0,0,1, 1,0,0,1,0,0,0,1, 0,1,1,0,1,1,1,0};
int NUMBER7[]={1,0,0,0,0,0,0,0, 1,0,0,0,1,0,0,0, 1,0,0,0,1,0,0,0, 1,0,0,1,1,1,1,1, 1,1,1,0,1,0,0,0};
int NUMBER6[]={1,1,1,1,1,1,1,1, 1,0,0,0,1,0,0,1, 1,0,0,0,1,0,0,1, 1,0,0,0,1,0,0,1, 1,0,0,0,1,1,1,1};
int NUMBER5[]={1,1,1,1,1,0,0,1, 1,0,0,0,1,0,0,1, 1,0,0,0,1,0,0,1, 1,0,0,0,1,0,0,1, 1,0,0,0,1,1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,0,0,0,1,0,0,1, 1,0,0,0,1,0,0,1, 1,0,0,0,1,0,0,1, 1,0,0,0,1,1,1,0};
int T[] = {1,0,0,0,0,0,0,0, 1,0,0,0,0,0,0,0, 1,1,1,1,1,1,1,1, 1,0,0,0,0,0,0,0, 1,0,0,0,0,0,0,0};
int U[] = {1,1,1,1,1,1,1,0, 0,0,0,0,0,0,0,1, 0,0,0,0,0,0,0,1, 0,0,0,0,0,0,0,1, 1,1,1,1,1,1,1,0};
int V[] = {1,1,1,1,1,1,0,0, 0,0,0,0,0,0,1,0, 0,0,0,0,0,0,0,1, 0,0,0,0,0,0,1,0, 1,1,1,1,1,1,0,0};
int W[] = {1,1,1,1,1,1,1,1, 0,0,0,0,0,0,1,0, 0,0,0,0,0,1,0,0, 0,0,0,0,0,0,1,0, 1,1,1,1,1,1,1,1};
int X[] = {1,1,0,0,0,0,1,1, 0,0,1,0,0,1,0,0, 0,0,0,1,1,0,0,0, 0,0,1,0,0,1,0,0, 1,1,0,0,0,0,1,1};
int Y[] = {1,1,0,0,0,0,0,0, 0,0,1,0,0,0,0,0, 0,0,0,1,1,1,1,1, 0,0,1,0,0,0,0,0, 1,1,0,0,0,0,0,0};
int Z[] = {1,0,0,0,0,1,1,1, 1,0,0,0,1,0,0,1, 1,0,0,1,0,0,0,1, 1,0,1,0,0,0,0,1, 1,1,0,0,0,0,0,1};
int* alpha[]= {A,B,C,D,e,F,G,H,I,J,K,l,M,N};//,T,U,V,W,X,Y,Z};
int letterSpace;
int dotTime;
void setup()
{ Serial.begin(9600);
// setting the ports of the leds to OUTPUT
for( int i = 2; i<10 ;i++ )
{ pinMode(i, OUTPUT);
}
// defining the space between the letters (ms)
letterSpace = 3;
// defining the time dots appear (ms)
dotTime =1;
}
void printLetter(int letter[])
{
int y;
// printing the first y row of the letter
for (y=0; y<8; y++)
{
digitalWrite(y+2, letter[y]);
}
delay(dotTime);
// printing the second y row of the letter
for (y=0; y<8; y++)
{
digitalWrite(y+2, letter[y+8]);
}
delay(dotTime);
// printing the third y row of the letter
for (y=0; y<8; y++)
{
digitalWrite(y+2, letter[y+16]);
}
delay(dotTime);
for(y = 0; y<8; y++) {
digitalWrite(y+2, letter[y+24]);
}
delay(dotTime);
for(y = 0; y<8; y++) {
digitalWrite(y+2, letter[y+32]);
}
delay(dotTime);
// printing the sspace between the letters
for (y=0; y<8; y++)
{
digitalWrite(y+2, 0);
}
delay(letterSpace);
}
void loop()//write here =) enjoy subscribe to my channel if you like the project
{
printLetter (H);
printLetter (I);
printLetter (_);
}
Friday, September 28, 2018
Thursday, March 29, 2018
Subscribe to:
Posts (Atom)