Wait() command using code warrior 3.1 SE

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Wait() command using code warrior 3.1 SE

跳至解决方案
3,255 次查看
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
标签 (1)
标记 (1)
0 项奖励
回复
1 解答
1,235 次查看
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 项奖励
回复
1 回复
1,236 次查看
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 项奖励
回复