Wait() command using code warrior 3.1 SE

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Wait() command using code warrior 3.1 SE

Jump to solution
2,504 Views
Shankman
Contributor II
Hi im Kris im a University student, quick background on my hardware. Im using the 13192 SARD development kit (GT60 MCU).

Just to familiarise myself with the chip and its functionality i have been attempting to write some code to turn the leds on then off in sequential order. I

n the codewarrior help there is a wait() command( wait(2000) = wait seconds) but im unsure what header file it requires (anyone know?)

Currently just for testing i use a delay function

void main(void) {
/*intialise hardware code is here*/
for(;:smileywink:{
_RESET_WATCHDOG()
if (PUSH_BUTTON1==PRESSED){
LED1=LED_ON; delay(500);
LED1=LED_OFF; delay(500);
LED2=LED_ON;
/*same code till led 4 */
}
}
}
void delay(long int count){
long int i;
for (i=0;i

The code synatax is wrong because after i posted the code some formatiing option deleted stuff so ignore obvious mistakes in code.


Assuming I/O ports have been set in the header file(which they have) for some reason when i hold down PUSHBUTTON1 only LED1 flashes the rest dont even light up.

Any ideas why?

Thanks in advance

Regards Kris
Labels (1)
Tags (1)
0 Kudos
1 Solution
484 Views
peg
Senior Contributor IV

Hi Kris,

First stab in the dark is watchdog trip.

Drop the delays to 100 and see if you go further through.

Then take it from there.

Regards David

View solution in original post

0 Kudos
1 Reply
485 Views
peg
Senior Contributor IV

Hi Kris,

First stab in the dark is watchdog trip.

Drop the delays to 100 and see if you go further through.

Then take it from there.

Regards David

0 Kudos