On Monday 05 June 2006 12:42, Chris Spencer wrote: > However, my program doesn't cause the LED to blink, leaving me to > believe it's having a problem reading the two status bits. I've manually > confirmed that the hardware is setting the correct signals based on > actuator state, but the AVR acts like the they're always low, even when > I measure them high. The following is my short test program. It should > make the actuator extend and contract indefinitely, lighting the LED > while it's extending. > loop_until_bit_is_set(PORTB, PB4); // Wait until fully contracted. ... > loop_until_bit_is_set(PORTB, PB5); // Wait until fully extended.
You need to read from PINB - PORTB is a register which shows what you have set the port to (regardless of DDR). I've fallen into this trap too, it's not uncommon :) -- Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C
pgpsFpxfpJ95c.pgp
Description: PGP signature
_______________________________________________ AVR-chat mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/avr-chat
