In this project, we are going to build a 3x3x3LED cube and connected to the Arduino UNO to get the different patterns of lights. For beginners, we will start with a simple pattern. A typical 3x3x3 LED cube that connected to the Arduino UNO is showing in the images the cube consists of 27 light-emitting diodes, these 27 light-emitting diodes are arranged in a row and the column-wise. so many cubes that can design, the simplest way of making is a 3x3x3 LED cube.
Advantage of 3 into 3 into 3 LED cube
There are some advantages to design the 3 into 3 into Arduino LED cube.
- The first one for this cube you don’t need to worry about the power consumption for dissipation.
- For the proper working low power supply needed.
- Here we won’t need to use any switching electronics for this cube.
- Withwith lesser logic terminals so we don’t need to shift resistors or anything like that.
The LED uses about 20 milliamps current the load consumption is very less than the number provided the maximum current allowed through the LED. Normally and LED work well from 2 milliamps to 5 milliamps anything higher than the current the LED will be burnout.
Components required for LED cube
- Arduino UNO or Arduino nano
- The resistor and 27 LEDs.
- Connecting wires.
Building construction of Arduino led cube
at the first step, you need to check all the 27 led is working properly once the cube is done if there is any faulty LED present in the cube it would be very difficult to replace so so be careful to do this step.
The second step takes a breadboard wire and peeled the area of the conductor. we can use any wires but breadboard connecting wires work great. after the peeling of this conducting wire. this wire is used for bridging the LED lights we will get this point shortly.
Take 27 LEDs and place them in a series manner and connect all the negative terminals. In this way connect the two pairs of LED and take a common negative.
After soldering all this connection you will get a tree common negative input and 9 positive input to the LED cube. connect LED negative and positive connections through the resistors. and properly attach this connection with the Arduino board.
Upload the given code in the Arduino board. And enjoy the working of the LED cube.
The working video is given below this article if any doubt you can check the working video and the working tutorial thank you.
Led cube Arduino circuit diagram
3x3x3 led cube arduino code
int neg1 = 13; //"neg1" is connected to the 13th digital pin of arduino
int neg2 = 12; //"neg2" is connected to the 12th digital pin of arduino
int neg3 = 11; //"neg3" is connected to the 11th digital pin of arduino
int neg4 = 10; //"neg4" is connected to the 10th digital pin of arduino
int neg5 = 9; //"neg5" is connected to the 9th digital pin of arduino
int neg6 = 8; //"neg6" is connected to the 8th digital pin of arduino
int neg7 = 7; //"neg7" is connected to the 7th digital pin of arduino
int neg8 = 6; //"neg8" is connected to the 6th digital pin of arduino
int neg9 = 5; //"neg9" is connected to the 5th digital pin of arduino
int pos1 = 4; //"pos1" is connected to the 4th digital pin of arduino
int pos2 = 3; //"pos2" is connected to the 3rd digital pin of arduino
int pos3 = 2; //"pos3" is connected to the 2nd digital pin of arduino
int delay_time=100, j=0;
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(neg1, OUTPUT);
pinMode(neg2, OUTPUT);
pinMode(neg3, OUTPUT);
pinMode(neg4, OUTPUT);
pinMode(neg5, OUTPUT);
pinMode(neg6, OUTPUT);
pinMode(neg7, OUTPUT);
pinMode(neg8, OUTPUT);
pinMode(neg9, OUTPUT);
pinMode(pos1, OUTPUT);
pinMode(pos2, OUTPUT);
pinMode(pos3, OUTPUT);
}
// the loop routine runs over and over again forever:
void loop() {
for(j=0;j<6;j++)
{
digitalWrite(pos1, HIGH);
digitalWrite(pos2, HIGH);
digitalWrite(pos3, LOW);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, HIGH);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, HIGH);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, HIGH);
delay(150);
digitalWrite(pos1, HIGH);
digitalWrite(pos2, LOW);
digitalWrite(pos3, HIGH);
digitalWrite(neg1, LOW);
digitalWrite(neg2, HIGH);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, HIGH);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, HIGH);
digitalWrite(neg9, LOW);
delay(150);
digitalWrite(pos1, LOW);
digitalWrite(pos2, HIGH);
digitalWrite(pos3, HIGH);
digitalWrite(neg1, HIGH);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, HIGH);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, HIGH);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(150);
digitalWrite(pos1, HIGH);
digitalWrite(pos2, LOW);
digitalWrite(pos3, HIGH);
digitalWrite(neg1, HIGH);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, HIGH);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, HIGH);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(150);
digitalWrite(pos1, HIGH);
digitalWrite(pos2, HIGH);
digitalWrite(pos3, LOW);
digitalWrite(neg1, HIGH);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, HIGH);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, HIGH);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(150);
digitalWrite(pos1, HIGH);
digitalWrite(pos2, LOW);
digitalWrite(pos3, HIGH);
digitalWrite(neg1, LOW);
digitalWrite(neg2, HIGH);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, HIGH);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, HIGH);
digitalWrite(neg9, LOW);
delay(150);
digitalWrite(pos1, LOW);
digitalWrite(pos2, HIGH);
digitalWrite(pos3, HIGH);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, HIGH);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, HIGH);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, HIGH);
delay(150);
digitalWrite(pos1, HIGH);
digitalWrite(pos2, LOW);
digitalWrite(pos3, HIGH);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, HIGH);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, HIGH);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, HIGH);
delay(150);
digitalWrite(pos1, HIGH);
digitalWrite(pos2, HIGH);
digitalWrite(pos3, LOW);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, HIGH);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, HIGH);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, HIGH);
delay(150);
digitalWrite(pos1, HIGH);
digitalWrite(pos2, HIGH);
digitalWrite(pos3, LOW);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, HIGH);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, HIGH);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, HIGH);
delay(150);
digitalWrite(pos1, HIGH);
digitalWrite(pos2, LOW);
digitalWrite(pos3, HIGH);
digitalWrite(neg1, LOW);
digitalWrite(neg2, HIGH);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, HIGH);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, HIGH);
digitalWrite(neg9, LOW);
delay(150);
digitalWrite(pos1, LOW);
digitalWrite(pos2, HIGH);
digitalWrite(pos3, HIGH);
digitalWrite(neg1, HIGH);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, HIGH);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, HIGH);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(150);
digitalWrite(pos1, HIGH);
digitalWrite(pos2, LOW);
digitalWrite(pos3, HIGH);
digitalWrite(neg1, HIGH);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, HIGH);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, HIGH);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(150);
digitalWrite(pos1, HIGH);
digitalWrite(pos2, HIGH);
digitalWrite(pos3, LOW);
digitalWrite(neg1, HIGH);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, HIGH);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, HIGH);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(150);
digitalWrite(pos1, HIGH);
digitalWrite(pos2, LOW);
digitalWrite(pos3, HIGH);
digitalWrite(neg1, LOW);
digitalWrite(neg2, HIGH);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, HIGH);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, HIGH);
digitalWrite(neg9, LOW);
delay(150);
digitalWrite(pos1, LOW);
digitalWrite(pos2, HIGH);
digitalWrite(pos3, HIGH);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, HIGH);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, HIGH);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, HIGH);
delay(150);
digitalWrite(pos1, HIGH);
digitalWrite(pos2, LOW);
digitalWrite(pos3, HIGH);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, HIGH);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, HIGH);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, HIGH);
delay(150);
digitalWrite(pos1, HIGH);
digitalWrite(pos2, HIGH);
digitalWrite(pos3, LOW);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, HIGH);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, HIGH);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, HIGH);
delay(150);
digitalWrite(pos1, LOW);
digitalWrite(pos2, HIGH);
digitalWrite(pos3, HIGH);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, HIGH);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(150);
digitalWrite(pos1, HIGH);
digitalWrite(pos2, LOW);
digitalWrite(pos3, HIGH);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, HIGH);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(150);
digitalWrite(pos1, HIGH);
digitalWrite(pos2, HIGH);
digitalWrite(pos3, LOW);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, HIGH);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(150);
digitalWrite(pos1, HIGH);
digitalWrite(pos2, HIGH);
digitalWrite(pos3, LOW);
digitalWrite(neg1, HIGH);
digitalWrite(neg2, LOW);
digitalWrite(neg3, HIGH);
digitalWrite(neg4, LOW);
digitalWrite(neg5, HIGH);
digitalWrite(neg6, LOW);
digitalWrite(neg7, HIGH);
digitalWrite(neg8, LOW);
digitalWrite(neg9, HIGH);
delay(150);
digitalWrite(pos1, HIGH);
digitalWrite(pos2, LOW);
digitalWrite(pos3, HIGH);
digitalWrite(neg1, HIGH);
digitalWrite(neg2, LOW);
digitalWrite(neg3, HIGH);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, HIGH);
digitalWrite(neg8, LOW);
digitalWrite(neg9, HIGH);
delay(150);
digitalWrite(pos1, LOW);
digitalWrite(pos2, HIGH);
digitalWrite(pos3, HIGH);
digitalWrite(neg1, HIGH);
digitalWrite(neg2, LOW);
digitalWrite(neg3, HIGH);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, HIGH);
digitalWrite(neg8, LOW);
digitalWrite(neg9, HIGH);
delay(150);
digitalWrite(pos1, LOW);
digitalWrite(pos2, HIGH);
digitalWrite(pos3, HIGH);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, HIGH);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(150);
digitalWrite(pos1, HIGH);
digitalWrite(pos2, LOW);
digitalWrite(pos3, HIGH);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, HIGH);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(150);
digitalWrite(pos1, HIGH);
digitalWrite(pos2, HIGH);
digitalWrite(pos3, LOW);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, HIGH);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(150);
digitalWrite(pos1, HIGH);
digitalWrite(pos2, HIGH);
digitalWrite(pos3, LOW);
digitalWrite(neg1, HIGH);
digitalWrite(neg2, LOW);
digitalWrite(neg3, HIGH);
digitalWrite(neg4, LOW);
digitalWrite(neg5, HIGH);
digitalWrite(neg6, LOW);
digitalWrite(neg7, HIGH);
digitalWrite(neg8, LOW);
digitalWrite(neg9, HIGH);
delay(150);
digitalWrite(pos1, HIGH);
digitalWrite(pos2, LOW);
digitalWrite(pos3, HIGH);
digitalWrite(neg1, HIGH);
digitalWrite(neg2, LOW);
digitalWrite(neg3, HIGH);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, HIGH);
digitalWrite(neg8, LOW);
digitalWrite(neg9, HIGH);
delay(150);
digitalWrite(pos1, LOW);
digitalWrite(pos2, HIGH);
digitalWrite(pos3, HIGH);
digitalWrite(neg1, HIGH);
digitalWrite(neg2, LOW);
digitalWrite(neg3, HIGH);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, HIGH);
digitalWrite(neg8, LOW);
digitalWrite(neg9, HIGH);
delay(150);
digitalWrite(pos1, LOW);
digitalWrite(pos2, HIGH);
digitalWrite(pos3, HIGH);
digitalWrite(neg1, HIGH);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(delay_time);
digitalWrite(neg1, LOW);
digitalWrite(neg2, HIGH);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(delay_time);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, HIGH);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(delay_time);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, HIGH);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(delay_time);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, HIGH);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(delay_time);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, HIGH);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(delay_time);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, HIGH);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(delay_time);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, HIGH);
digitalWrite(neg9, LOW);
delay(delay_time);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, HIGH);
delay(delay_time);
digitalWrite(pos1, HIGH);
digitalWrite(pos2, LOW);
digitalWrite(pos3, HIGH);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, HIGH);
delay(delay_time);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, HIGH);
digitalWrite(neg9, LOW);
delay(delay_time);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, HIGH);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(delay_time);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, HIGH);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(delay_time);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, HIGH);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(delay_time);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, HIGH);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(delay_time);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, HIGH);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(delay_time);
digitalWrite(neg1, LOW);
digitalWrite(neg2, HIGH);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(delay_time);
digitalWrite(neg1, HIGH);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(delay_time);
digitalWrite(pos1, HIGH);
digitalWrite(pos2, HIGH);
digitalWrite(pos3, LOW);
digitalWrite(neg1, HIGH);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(delay_time);
digitalWrite(neg1, LOW);
digitalWrite(neg2, HIGH);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(delay_time);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, HIGH);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(delay_time);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, HIGH);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(delay_time);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, HIGH);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(delay_time);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, HIGH);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(delay_time);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, HIGH);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(delay_time);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, HIGH);
digitalWrite(neg9, LOW);
delay(delay_time);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, HIGH);
delay(delay_time);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, HIGH);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(delay_time);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, HIGH);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(delay_time);
digitalWrite(neg1, LOW);
digitalWrite(neg2, HIGH);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(delay_time);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, HIGH);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(delay_time);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, HIGH);
digitalWrite(neg9, LOW);
delay(delay_time);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, HIGH);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(delay_time);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, HIGH);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(delay_time);
digitalWrite(neg1, HIGH);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(delay_time);
digitalWrite(pos1, HIGH);
digitalWrite(pos2, LOW);
digitalWrite(pos3, HIGH);
digitalWrite(neg1, HIGH);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(delay_time);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, HIGH);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(delay_time);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, HIGH);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(delay_time);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, HIGH);
digitalWrite(neg9, LOW);
delay(delay_time);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, HIGH);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(delay_time);
digitalWrite(neg1, LOW);
digitalWrite(neg2, HIGH);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(delay_time);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, HIGH);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(delay_time);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, HIGH);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(delay_time);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, HIGH);
delay(delay_time);
digitalWrite(pos1, LOW);
digitalWrite(pos2, HIGH);
digitalWrite(pos3, HIGH);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, HIGH);
delay(delay_time);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, HIGH);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(delay_time);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, HIGH);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(delay_time);
digitalWrite(neg1, LOW);
digitalWrite(neg2, HIGH);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(delay_time);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, HIGH);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(delay_time);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, HIGH);
digitalWrite(neg9, LOW);
delay(delay_time);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, HIGH);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(delay_time);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, HIGH);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(delay_time);
digitalWrite(neg1, HIGH);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(delay_time);
digitalWrite(pos1, LOW);
digitalWrite(pos2, LOW);
digitalWrite(pos3, LOW);
digitalWrite(neg1, HIGH);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, HIGH);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, HIGH);
delay(200);
digitalWrite(pos1, LOW);
digitalWrite(pos2, LOW);
digitalWrite(pos3, LOW);
digitalWrite(neg1, LOW);
digitalWrite(neg2, HIGH);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, HIGH);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, HIGH);
digitalWrite(neg9, LOW);
delay(200);
digitalWrite(pos1, LOW);
digitalWrite(pos2, LOW);
digitalWrite(pos3, LOW);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, HIGH);
digitalWrite(neg4, LOW);
digitalWrite(neg5, HIGH);
digitalWrite(neg6, LOW);
digitalWrite(neg7, HIGH);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(200);
digitalWrite(pos1, LOW);
digitalWrite(pos2, LOW);
digitalWrite(pos3, LOW);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, HIGH);
digitalWrite(neg5, HIGH);
digitalWrite(neg6, HIGH);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(200);
digitalWrite(pos1, LOW);
digitalWrite(pos2, LOW);
digitalWrite(pos3, LOW);
digitalWrite(neg1, HIGH);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, HIGH);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, HIGH);
delay(200);
digitalWrite(pos1, LOW);
digitalWrite(pos2, LOW);
digitalWrite(pos3, LOW);
digitalWrite(neg1, HIGH);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, HIGH);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, HIGH);
delay(200);
digitalWrite(pos1, LOW);
digitalWrite(pos2, LOW);
digitalWrite(pos3, LOW);
digitalWrite(neg1, LOW);
digitalWrite(neg2, HIGH);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, HIGH);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, HIGH);
digitalWrite(neg9, LOW);
delay(200);
digitalWrite(pos1, LOW);
digitalWrite(pos2, LOW);
digitalWrite(pos3, LOW);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, HIGH);
digitalWrite(neg4, LOW);
digitalWrite(neg5, HIGH);
digitalWrite(neg6, LOW);
digitalWrite(neg7, HIGH);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(200);
digitalWrite(pos1, LOW);
digitalWrite(pos2, LOW);
digitalWrite(pos3, LOW);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, HIGH);
digitalWrite(neg5, HIGH);
digitalWrite(neg6, HIGH);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(200);
digitalWrite(pos1, LOW);
digitalWrite(pos2, LOW);
digitalWrite(pos3, LOW);
digitalWrite(neg1, HIGH);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, HIGH);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, HIGH);
delay(200);
digitalWrite(pos1, LOW);
digitalWrite(pos2, LOW);
digitalWrite(pos3, LOW);
digitalWrite(neg1, HIGH);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, HIGH);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, HIGH);
delay(200);
digitalWrite(pos1, LOW);
digitalWrite(pos2, LOW);
digitalWrite(pos3, LOW);
digitalWrite(neg1, LOW);
digitalWrite(neg2, HIGH);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, HIGH);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, HIGH);
digitalWrite(neg9, LOW);
delay(200);
digitalWrite(pos1, LOW);
digitalWrite(pos2, LOW);
digitalWrite(pos3, LOW);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, HIGH);
digitalWrite(neg4, LOW);
digitalWrite(neg5, HIGH);
digitalWrite(neg6, LOW);
digitalWrite(neg7, HIGH);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(200);
digitalWrite(pos1, LOW);
digitalWrite(pos2, LOW);
digitalWrite(pos3, LOW);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, HIGH);
digitalWrite(neg5, HIGH);
digitalWrite(neg6, HIGH);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(200);
digitalWrite(pos1, LOW);
digitalWrite(pos2, LOW);
digitalWrite(pos3, LOW);
digitalWrite(neg1, HIGH);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, HIGH);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, HIGH);
delay(200);
digitalWrite(pos1, LOW);
digitalWrite(pos2, LOW);
digitalWrite(pos3, LOW);
digitalWrite(neg1, HIGH);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, HIGH);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, HIGH);
delay(200);
digitalWrite(pos1, LOW);
digitalWrite(pos2, LOW);
digitalWrite(pos3, LOW);
digitalWrite(neg1, LOW);
digitalWrite(neg2, HIGH);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, HIGH);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, HIGH);
digitalWrite(neg9, LOW);
delay(200);
digitalWrite(pos1, LOW);
digitalWrite(pos2, LOW);
digitalWrite(pos3, LOW);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, HIGH);
digitalWrite(neg4, LOW);
digitalWrite(neg5, HIGH);
digitalWrite(neg6, LOW);
digitalWrite(neg7, HIGH);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(200);
digitalWrite(pos1, LOW);
digitalWrite(pos2, LOW);
digitalWrite(pos3, LOW);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, HIGH);
digitalWrite(neg5, HIGH);
digitalWrite(neg6, HIGH);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(200);
digitalWrite(pos1, LOW);
digitalWrite(pos2, LOW);
digitalWrite(pos3, LOW);
digitalWrite(neg1, HIGH);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, HIGH);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, HIGH);
delay(200);
digitalWrite(pos1, LOW);
digitalWrite(pos2, LOW);
digitalWrite(pos3, LOW);
digitalWrite(neg1, HIGH);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, HIGH);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, HIGH);
delay(200);
digitalWrite(pos1, LOW);
digitalWrite(pos2, LOW);
digitalWrite(pos3, LOW);
digitalWrite(neg1, LOW);
digitalWrite(neg2, HIGH);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, HIGH);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, HIGH);
digitalWrite(neg9, LOW);
delay(200);
digitalWrite(pos1, LOW);
digitalWrite(pos2, LOW);
digitalWrite(pos3, LOW);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, HIGH);
digitalWrite(neg4, LOW);
digitalWrite(neg5, HIGH);
digitalWrite(neg6, LOW);
digitalWrite(neg7, HIGH);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(200);
digitalWrite(pos1, LOW);
digitalWrite(pos2, LOW);
digitalWrite(pos3, LOW);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, HIGH);
digitalWrite(neg5, HIGH);
digitalWrite(neg6, HIGH);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(200);
digitalWrite(pos1, LOW);
digitalWrite(pos2, LOW);
digitalWrite(pos3, LOW);
digitalWrite(neg1, HIGH);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, HIGH);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, HIGH);
delay(200);
digitalWrite(pos1, LOW);
digitalWrite(pos2, LOW);
digitalWrite(pos3, LOW);
digitalWrite(neg1, HIGH);
digitalWrite(neg2, HIGH);
digitalWrite(neg3, HIGH);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(150);
digitalWrite(pos1, LOW);
digitalWrite(pos2, LOW);
digitalWrite(pos3, LOW);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, HIGH);
digitalWrite(neg5, HIGH);
digitalWrite(neg6, HIGH);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(150);
digitalWrite(pos1, LOW);
digitalWrite(pos2, LOW);
digitalWrite(pos3, LOW);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, HIGH);
digitalWrite(neg8, HIGH);
digitalWrite(neg9, HIGH);
delay(150);
digitalWrite(pos1, LOW);
digitalWrite(pos2, LOW);
digitalWrite(pos3, LOW);
digitalWrite(neg1, HIGH);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, HIGH);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, HIGH);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(150);
digitalWrite(pos1, LOW);
digitalWrite(pos2, LOW);
digitalWrite(pos3, LOW);
digitalWrite(neg1, LOW);
digitalWrite(neg2, HIGH);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, HIGH);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, HIGH);
digitalWrite(neg9, LOW);
delay(150);
digitalWrite(pos1, LOW);
digitalWrite(pos2, LOW);
digitalWrite(pos3, LOW);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, HIGH);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, HIGH);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, HIGH);
delay(150);
digitalWrite(pos1, LOW);
digitalWrite(pos2, LOW);
digitalWrite(pos3, LOW);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, HIGH);
digitalWrite(neg8, HIGH);
digitalWrite(neg9, HIGH);
delay(150);
digitalWrite(pos1, LOW);
digitalWrite(pos2, LOW);
digitalWrite(pos3, LOW);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, HIGH);
digitalWrite(neg5, HIGH);
digitalWrite(neg6, HIGH);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(150);
digitalWrite(pos1, LOW);
digitalWrite(pos2, LOW);
digitalWrite(pos3, LOW);
digitalWrite(neg1, HIGH);
digitalWrite(neg2, HIGH);
digitalWrite(neg3, HIGH);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(150);
digitalWrite(pos1, LOW);
digitalWrite(pos2, LOW);
digitalWrite(pos3, LOW);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, HIGH);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, HIGH);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, HIGH);
delay(150);
digitalWrite(pos1, LOW);
digitalWrite(pos2, LOW);
digitalWrite(pos3, LOW);
digitalWrite(neg1, LOW);
digitalWrite(neg2, HIGH);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, HIGH);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, HIGH);
digitalWrite(neg9, LOW);
delay(150);
digitalWrite(pos1, LOW);
digitalWrite(pos2, LOW);
digitalWrite(pos3, LOW);
digitalWrite(neg1, HIGH);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, HIGH);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, HIGH);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(150);
digitalWrite(pos1, LOW);
digitalWrite(pos2, LOW);
digitalWrite(pos3, LOW);
digitalWrite(neg1, HIGH);
digitalWrite(neg2, HIGH);
digitalWrite(neg3, HIGH);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(150);
digitalWrite(pos1, LOW);
digitalWrite(pos2, LOW);
digitalWrite(pos3, LOW);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, HIGH);
digitalWrite(neg5, HIGH);
digitalWrite(neg6, HIGH);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(150);
digitalWrite(pos1, LOW);
digitalWrite(pos2, LOW);
digitalWrite(pos3, LOW);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, HIGH);
digitalWrite(neg8, HIGH);
digitalWrite(neg9, HIGH);
delay(150);
digitalWrite(pos1, LOW);
digitalWrite(pos2, LOW);
digitalWrite(pos3, LOW);
digitalWrite(neg1, HIGH);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, HIGH);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, HIGH);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(150);
digitalWrite(pos1, LOW);
digitalWrite(pos2, LOW);
digitalWrite(pos3, LOW);
digitalWrite(neg1, LOW);
digitalWrite(neg2, HIGH);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, HIGH);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, HIGH);
digitalWrite(neg9, LOW);
delay(150);
digitalWrite(pos1, LOW);
digitalWrite(pos2, LOW);
digitalWrite(pos3, LOW);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, HIGH);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, HIGH);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, HIGH);
delay(150);
digitalWrite(pos1, LOW);
digitalWrite(pos2, LOW);
digitalWrite(pos3, LOW);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, HIGH);
digitalWrite(neg8, HIGH);
digitalWrite(neg9, HIGH);
delay(150);
digitalWrite(pos1, LOW);
digitalWrite(pos2, LOW);
digitalWrite(pos3, LOW);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, HIGH);
digitalWrite(neg5, HIGH);
digitalWrite(neg6, HIGH);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(150);
digitalWrite(pos1, LOW);
digitalWrite(pos2, LOW);
digitalWrite(pos3, LOW);
digitalWrite(neg1, HIGH);
digitalWrite(neg2, HIGH);
digitalWrite(neg3, HIGH);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(150);
digitalWrite(pos1, LOW);
digitalWrite(pos2, LOW);
digitalWrite(pos3, LOW);
digitalWrite(neg1, LOW);
digitalWrite(neg2, LOW);
digitalWrite(neg3, HIGH);
digitalWrite(neg4, LOW);
digitalWrite(neg5, LOW);
digitalWrite(neg6, HIGH);
digitalWrite(neg7, LOW);
digitalWrite(neg8, LOW);
digitalWrite(neg9, HIGH);
delay(150);
digitalWrite(pos1, LOW);
digitalWrite(pos2, LOW);
digitalWrite(pos3, LOW);
digitalWrite(neg1, LOW);
digitalWrite(neg2, HIGH);
digitalWrite(neg3, LOW);
digitalWrite(neg4, LOW);
digitalWrite(neg5, HIGH);
digitalWrite(neg6, LOW);
digitalWrite(neg7, LOW);
digitalWrite(neg8, HIGH);
digitalWrite(neg9, LOW);
delay(150);
digitalWrite(pos1, LOW);
digitalWrite(pos2, LOW);
digitalWrite(pos3, LOW);
digitalWrite(neg1, HIGH);
digitalWrite(neg2, LOW);
digitalWrite(neg3, LOW);
digitalWrite(neg4, HIGH);
digitalWrite(neg5, LOW);
digitalWrite(neg6, LOW);
digitalWrite(neg7, HIGH);
digitalWrite(neg8, LOW);
digitalWrite(neg9, LOW);
delay(150);
}
}