Software > Software

LED CODE Please help

(1/2) > >>

robotmaniac:
Could some on tell me what is worng with this code?
#include <avr/io.h>
int main(void)
/*0d004321ba*/
{
   DDRD = 0D00000001;//Setting port 0 to oput
    PORTD = 0D00000001;//setting port 0 high

   while(1){}
   }
cause i get this
../LED_matrix_v1.c:5:9: error: invalid suffix "D00000010" on integer constant
../LED_matrix_v1.c:6:11: error: invalid suffix "D00000010" on integer constant
Im just trying to light up 8 LEDs using multiplexing but i want to turn on only port PD0 isnt that the way??

jkerns:
0D? not 0b?

What compilier are you using?

robotmaniac:
Im using AVR but I wanted to turn on the portD for the ATmega 8

stridera:
You definitely want to use B not D.  B for Binary.

B00000001

Refer to this:  http://www.arduino.cc/en/Reference/IntegerConstants

robotmaniac:
oo thaks now how can i creat a patern?

Navigation

[0] Message Index

[#] Next page

Go to full version