Hello,
The question involves a little knowledge about MCU's more particularly ....AVR's. Nonetheless, this question is a C question.
In an LCD spec which shows code to test an LCD, shows the following lines of code:
I am a PIC MCU guy, so I never used AVRs... so wouldn't know what "PC7" really means, but I guess is, it stands for an I/O output for bit 7 of port C of an AVR MCU!
So my question is, what does (1<<LCD_RS) actually do?
I know that the << operator is the left shift operator which has the following rules:
value<<number of bits
So a certain number of bits in "value" are shifted left... right?
so in my example above, the contents of "value" which is 1 is shifetd left by the value in LCD_RS.... and so what is the value of LCD_RS if its an input????
Confused!
All help very appreciated!
Rob
The question involves a little knowledge about MCU's more particularly ....AVR's. Nonetheless, this question is a C question.
In an LCD spec which shows code to test an LCD, shows the following lines of code:
Rich (BB code):
#define LCD_RS PC7
#define CLR_RS PORTC &= ~(1<<LCD_RS)
So my question is, what does (1<<LCD_RS) actually do?
I know that the << operator is the left shift operator which has the following rules:
value<<number of bits
So a certain number of bits in "value" are shifted left... right?
so in my example above, the contents of "value" which is 1 is shifetd left by the value in LCD_RS.... and so what is the value of LCD_RS if its an input????
Confused!
All help very appreciated!
Rob
Last edited: