Wait() command using code warrior 3.1 SE

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Wait() command using code warrior 3.1 SE

ソリューションへジャンプ
3,254件の閲覧回数
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,234件の閲覧回数
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,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 件の賞賛
返信