int t1[]={48, 47, 46, 45, 44, 43, 41, 40, 39, 37, 36, 34, 33, 31, 30, 28, 26, 25, 23, 21, 19, 17, 16, 14, 12, 10, 8, 6, 4, 2};
int t2[]={0, 2, 4, 6, 8, 10, 12, 14, 16, 17, 19, 21, 23, 25, 26, 28, 30, 31, 33, 34, 36, 37, 39, 40, 41, 43, 44, 45, 46};
int tz[]={8, 7, 6, 5, 5, 4, 3, 2, 2, 2, 1, 1, 1, 0, 0, -1, 0, 0, 1, 1, 1, 2, 2, 2, 3, 4, 5, 5, 6};
int volt[]={0x70, 0x61, 0x43, 0x52, 0x16, 0x34, 0x25, 0x07};
int i;
void setup() {
// put your setup code here, to run once:
DDRD = B11111111;
}
void loop() {
//sector1
for (i = 0; i < 30; i++) {
PORTD = volt[0];
delayMicroseconds(tz[i]);
PORTD = volt[1];
delayMicroseconds(t1[i]);
PORTD = volt[2];
delayMicroseconds(t2[i]);
PORTD = volt[7];
delayMicroseconds(tz[i]);
PORTD = volt[2];
delayMicroseconds(t2[i]);
PORTD = volt[1];
delayMicroseconds(t1[i]);
}
//sector2
for (i = 0; i < 30; i++) {
PORTD = volt[0];
delayMicroseconds(tz[i]);
PORTD = volt[3];
delayMicroseconds(t1[i]);
PORTD = volt[2];
delayMicroseconds(t2[i]);
PORTD = volt[7];
delayMicroseconds(tz[i]);
PORTD = volt[2];
delayMicroseconds(t2[i]);
PORTD = volt[3];
delayMicroseconds(t1[i]);
}
//sector3
for (i = 0; i < 30; i++) {
PORTD = volt[0];
delayMicroseconds(tz[i]);
PORTD = volt[3];
delayMicroseconds(t1[i]);
PORTD = volt[4];
delayMicroseconds(t2[i]);
PORTD = volt[7];
delayMicroseconds(tz[i]);
PORTD = volt[4];
delayMicroseconds(t2[i]);
PORTD = volt[3];
delayMicroseconds(t1[i]);
}
//sector4
for (i = 0; i < 30; i++) {
PORTD = volt[0];
delayMicroseconds(tz[i]);
PORTD = volt[5];
delayMicroseconds(t1[i]);
PORTD = volt[4];
delayMicroseconds(t2[i]);
PORTD = volt[7];
delayMicroseconds(tz[i]);
PORTD = volt[4];
delayMicroseconds(t2[i]);
PORTD = volt[5];
delayMicroseconds(t1[i]);
}
//sector5
for (i = 0; i < 30; i++) {
PORTD = volt[0];
delayMicroseconds(tz[i]);
PORTD = volt[5];
delayMicroseconds(t1[i]);
PORTD = volt[6];
delayMicroseconds(t2[i]);
PORTD = volt[7];
delayMicroseconds(tz[i]);
PORTD = volt[6];
delayMicroseconds(t2[i]);
PORTD = volt[5];
delayMicroseconds(t1[i]);
}
//sector6
for (i = 0; i < 30; i++) {
PORTD = volt[0];
delayMicroseconds(tz[i]);
PORTD = volt[1];
delayMicroseconds(t1[i]);
PORTD = volt[6];
delayMicroseconds(t2[i]);
PORTD = volt[7];
delayMicroseconds(tz[i]);
PORTD = volt[6];
delayMicroseconds(t2[i]);
PORTD = volt[1];
delayMicroseconds(t1[i]);
}
}