avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-gcc-list] [newbie]Toggle a bit value


From: Sumeet Pal Singh
Subject: [avr-gcc-list] [newbie]Toggle a bit value
Date: Thu, 13 Oct 2005 07:09:46 +0530

Hi
How do a toggle a value at one pin of port the current value i do not know
i know the pin can be set or cleared using _BV and ~_BV resp.
but when I tried to do

PORTA1=!PORTA1,

the compiler gives error
main.cpp:20: error:non-lvalue in assignment

can someone tell me what i am doing wrong and why (i wish to understand how the compiler handled this line
Also how to do this

In sdcc for 8051 i used PortA.1=!PortA.1 and it worked well

Thanks
Sumeet

reply via email to

[Prev in Thread] Current Thread [Next in Thread]