I'm trying to control 6 LEDs using an ATTiny85 (HLT's implementation), but I'm getting very odd results so far.
I've attached a schematic of the circuit I have set up. The six LEDs are set up in a basic charlieplexed arrangement and controlled via 3 control pins. The resistor values I am using right now are 150ohms all around.
I'm just trying to turn on one LED (LED1) by setting PORTA to LOW, PORTB to HIGH and PORTC as input (high impedence).
The LED doesn't turn on, and I get unusual voltage readings at the pins. Pin 0 (PORTA) has 2.9V, and pin 1 (PORTB) has 2.7V.
I thought that maybe LOW wasn't actually 0V, so I changed the digitalWrite calls to analogWrite calls and used 0 and 255 respectively to achieve LOW and HIGH. But I get the same result!
Here is the code I'm trying out. Am I missing something obvious?
#define PORTA 0
#define PORTB 1
#define PORTC 2
#define PIEZO 4
void setup() {
pinMode(PORTA, OUTPUT);
pinMode(PORTB, OUTPUT);
pinMode(PORTC, INPUT);
}
void loop() {
digitalWrite(PORTA, LOW);
digitalWrite(PORTB, HIGH);
}