Do you mean don't put a current limiting resistor between the switch and
PORTD4?
-----Original Message-----
From: Paul Maddox [mailto:P.Maddox@signal.qinetiq.com]
Sent: Tuesday, January 18, 2005 3:59 AM
To: AVR-Chat@yahoogroups.com
Subject: Re: [AVR-Chat] Testing a switch on ATMega128
> 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)
Paul
Yahoo! Groups LinksMessage
RE: [AVR-Chat] Testing a switch on ATMega128
2005-01-19 by wbounce
Attachments
- No local attachments were found for this message.