Hey everyone! I'm hoping for a little help, as I'm completely stuck.
I can't seem to get the ArudiNIX board working correctly. I've tried many different sketches and wiring layouts, but no luck.
I decided to strip down to basics to try to troubleshoot. Here's what I know...
- I am using a 9V, 650mA center-positive AC adapter. It looks identical to the one sold on the site.
- If I check voltage from the test point to ground, I get a nice steady 180V.
- The chips seem to be working perfectly - they read 4.7V on the appropriate pins when I run a sketch that cycles through the numbers.
However, if I upload the following sketch (which just sends a zero to both outputs), I get some really weird readings on the cathode pins.
/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.
This example code is in the public domain.
*/
// SN74141 (1)
int ledPin_0_a = 2;
int ledPin_0_b = 3;
int ledPin_0_c = 4;
int ledPin_0_d = 5;
// SN74141 (2)
int ledPin_1_a = 6;
int ledPin_1_b = 7;
int ledPin_1_c = 8;
int ledPin_1_d = 9;
// anod pins
int ledPin_a_1 = 10;
int ledPin_a_2 = 11;
int ledPin_a_3 = 12;
void setup() {
pinMode(ledPin_0_a, OUTPUT);
pinMode(ledPin_0_b, OUTPUT);
pinMode(ledPin_0_c, OUTPUT);
pinMode(ledPin_0_d, OUTPUT);
pinMode(ledPin_1_a, OUTPUT);
pinMode(ledPin_1_b, OUTPUT);
pinMode(ledPin_1_c, OUTPUT);
pinMode(ledPin_1_d, OUTPUT);
pinMode(ledPin_a_1, OUTPUT);
pinMode(ledPin_a_2, OUTPUT);
pinMode(ledPin_a_3, OUTPUT);
}
void loop() {
for (int i=0;i<10;i++) {
displaynum (0);
delay (2000);
}
}
void displaynum( int num ) {
int a,b,c,d;
// Load the a,b,c,d.. to send to the SN74141 IC (2)
switch( num )
{
case 0: a=0;b=0;c=0;d=0;break;
case 1: a=1;b=0;c=0;d=0;break;
case 2: a=0;b=1;c=0;d=0;break;
case 3: a=1;b=1;c=0;d=0;break;
case 4: a=0;b=0;c=1;d=0;break;
case 5: a=1;b=0;c=1;d=0;break;
case 6: a=0;b=1;c=1;d=0;break;
case 7: a=1;b=1;c=1;d=0;break;
case 8: a=0;b=0;c=0;d=1;break;
case 9: a=1;b=0;c=0;d=1;break;
}
digitalWrite(ledPin_0_d, d);
digitalWrite(ledPin_0_c, c);
digitalWrite(ledPin_0_b, b);
digitalWrite(ledPin_0_a, a);
// Write to output pins
digitalWrite(ledPin_1_d, d);
digitalWrite(ledPin_1_c, c);
digitalWrite(ledPin_1_b, b);
digitalWrite(ledPin_1_a, a);
digitalWrite(ledPin_a_1, LOW);
digitalWrite(ledPin_a_2, LOW);
digitalWrite(ledPin_a_3, LOW);
}
If I connect my probe to a 10K resistor on A1 and the cathode pins (remember I'm sending a "0" to both tubes), I get:
Cath1Pin0: 58.1V
Cath1Pin1: 55.9V
Cath1Pin2: 59.0V
Cath1Pin3: 59.3V
Cath1Pin4: 0.0V
Cath1Pin5: 55.9V
Cath1Pin6: 60.3V
Cath1Pin7: 60.0V
Cath1Pin8: 60.6V
Cath1Pin9: 60.8V
Cath0Pin0: 71.8V
Cath0Pin1: 58.6V
Cath0Pin2: 63.2V
Cath0Pin3: 62.9V
Cath0Pin4: 75.0V
Cath0Pin5: 60.6V
Cath0Pin6: 56.4V
Cath0Pin7: 55.8V
Cath0Pin8: 75.1V
Cath0Pin9: 58.9V
I'm sure this can't be right....
