neingeist
/
arduinisten
Archived
1
0
Fork 0

2 bit test

master
Eve Entropia 14 years ago
parent da63707eed
commit bef8044f19

@ -1,23 +1,26 @@
void setup() { const int pinCLK = 8;
void setup()
{
// set TDA8702 to transparent mode (CLK = LOW)
pinMode(pinCLK, OUTPUT);
digitalWrite(pinCLK, LOW);
pinMode(7, OUTPUT); pinMode(7, OUTPUT);
pinMode(6, OUTPUT); pinMode(6, OUTPUT);
pinMode(5, OUTPUT);
pinMode(4, OUTPUT); // FIX HEISENBUG, FUCKYEAH
pinMode(3, OUTPUT); Serial.begin(9600);
pinMode(2, OUTPUT);
} }
int count = 0; int count = 0;
void loop() void loop()
{ {
digitalWrite(7, (count & 0b100000) >> 5); digitalWrite(7, (count & 0b10) >> 1);
digitalWrite(6, (count & 0b010000) >> 4); digitalWrite(6, (count & 0b01) >> 0);
digitalWrite(5, (count & 0b001000) >> 3);
digitalWrite(4, (count & 0b000100) >> 2); delay(100);
digitalWrite(3, (count & 0b000010) >> 1);
digitalWrite(2, (count & 0b000001) >> 0);
delay(1000);
count++; count++;
} }