C syntax for MC9S08GT60
‎07-11-2006
07:42 AM
3,152 Views

Shankman
Contributor II
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I just wanted to know if anyone could explain this C syntax to me?
LED4 ^=1;
Thanks in advance
Kris
I just wanted to know if anyone could explain this C syntax to me?
LED4 ^=1;
Thanks in advance
Kris
3 Replies
‎07-11-2006
07:46 AM
821 Views

Sten
Contributor IV
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It can also be written as
LED4 = LED4 ^ 1;
which means
LED4 = LED4 XOR 1
which again means that if LED4 was 0 it will become 1 and if it was 1 it will become 0.
‎07-11-2006
07:58 AM
821 Views

Shankman
Contributor II
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sten wrote:It can also be written asLED4 = LED4 ^ 1;which meansLED4 = LED4 XOR 1which again means that if LED4 was 0 it will become 1 and if it was 1 it will become 0.
Thanks heaps mate!! Makes sense now
Regards
Kris
‎07-11-2006
04:07 PM
821 Views

RedMountain
Contributor I
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There are quite a few good C guides out there on the web that I have found quite useful for quick reference, especially when able to search text quickly in web browsers. One that I use:
http://www.acm.uiuc.edu/webmonkeys/book/c_guide/
http://www.acm.uiuc.edu/webmonkeys/book/c_guide/
