Beginners: please read this post and this post before posting to the forum.
0 Members and 1 Guest are viewing this topic.
//add 1.7s delay for potential power issues delay_cycles(65535); delay_cycles(65535); delay_cycles(65535); delay_cycles(65535); delay_cycles(65535); delay_cycles(65535); delay_cycles(65535); configure_ports() ; while(1) { if (button_pressed() ) { LED_on(); PORT_ON(PORTE,2) ; delay_cycles(900) ; PORT_OFF(PORTE,2) ; } else { LED_off() ; PORT_ON(PORTE,2) ; delay_cycles(400) ; PORT_OFF(PORTE,2) ; } delay_ms(30) ; }
The only part of the code you put that I had to change is the delay_ms. As I posted earlier this does nto work on mine (get compile errors).
../Axion1.c: In function 'main':../Axion1.c:65: warning: implicit declaration of function 'delay_ms'Axion1.o: In function `main':C:\MyRobots\Axion1\default/../Axion1.c:65: undefined reference to `delay_ms'