Hi, Thanks roelofh:

It works !!! P1_5 = ! P1_5 is working fine !


Thank you so much...






On Sun, Jun 9, 2013 at 12:12 AM, roelof 't Hooft <roelofh@itholland.nl> wrote:
Hi,

Ma XiaoJun told you to RTFM.
Please do so.


> I tried
> 1)
> #include <reg51.h>
>
>  sbit Beep =  P1_5 ;
>
>
> which is wrong

Of course it is wrong.


> 2)
> #include <reg51.h>
> sbit Beep;
> ....
> Beep=~Beep;

Somewhere Beep needs to be defined.
Preferably in an included header file or at the top of
your C file in which it is used.


> 3)
> #include <reg51.h>

Why are you still including a header file of which sdcc
tells you not to ?
Again I am assuming you are using a recent sdcc version
because you still did not show us what version you are
using.


> // sbit Beep =  P1_5 ;
>
> ...
> P1_5=~P1_5;
>
>
> which is still wrong

P1_5 is in the reg51.h file and also in the 8051.h file.
You might want to try "p1_5 = !p1_5;".
But the reg51.h is old and should not be used anymore as
sdcc tells you with a warning.

roelof



------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user



--

Pei JIA

Email: jp4work@gmail.com
cell:    +1 604-362-5816

Welcome to Vision Open
http://www.visionopen.com