> I have the following
>
> 5v ------ switch ------10K resistor --- ground
> |
> |-- 330 resistor -- PORTD4
>
huh?
Try this ;-
5v ------ switch --+---10K resistor --- ground
|
|--- PORTD4
This assumes the switch is the 'normally open' type.
> printf("pinb %i ",PIND4);
> if (PIND4)
Assuming we're talking CodeVision AVR ;-
> printf("pinb %i ",PIND.4);
> if (PIND.4)
PaulMessage
Re: [AVR-Chat] Testing a switch on ATMega128
2005-01-18 by Paul Maddox