short summary of C-programming language for AVR microcontrollers

Variable Types

typebitsrange
bit 1 0,1
char 1 –128 to 127
unsigned char 1 0 to 255
short  2 –32768 to 32767
unsigned short
2 0 to 65535.
int 2 –32768 to 32767
unsigned int
2 0 to 65535
long 4 –2147483648 to 2147483647
long unsigned
4 0 to 4294967295
float 4 –3.4e38 to +3.4e38
double. 8 1.7e308 to +1.7e308

 

 

 

 

 

 

 

 

 

Operators

=
Assignement operator
+ Addition

Subtraction
/
Division
*
Multiplication
Remainder
count++  post increment
++count pre increment
count-- post decrement
--coun pre decrement

 Logical Operators

! Boolean NOT (unary operator)
&& Boolean AND (binary operator)
| | Boolean OR (binary operator)

 Bitwise Operators

Negation (unary operator)
Bitwise AND
Bitwise OR
Bitwise exclusive XOR
>>  Right shift of bits (equivalent to division by 2)
<< Left shift of bits (equivalent to multiplication by 2)

 

 

 

 

 

 

 Relational Operators

==  Equal
! =  Not equal
Greater than
Less than
>=  Greater than or equal to
<=  Less than or equal to