code for pacemaker device

Thread Starter

mah

Joined Mar 15, 2010
393
I am trying to write a code for this emulated pacemaker device, but i couldn't i need some help. the requirement in the attached pic

if (SW1==0x10){

if(GPIO_PORTF_DATA_R &= ~0x08){
Delay1ms(250); //
GPIO_PORTF_DATA_R |= 0x02; // LED is on
Delay1ms(250); //
GPIO_PORTF_DATA_R &= ~0x02; // LED is off
GPIO_PORTF_DATA_R |= 0x08; // LED green is on

}
}else{
GPIO_PORTF_DATA_R &= ~0x08; // LED green is on
Delay1ms(10); //

}
 

Attachments

Picbuster

Joined Dec 2, 2013
1,058
build a mill sec counter.
Make a state machine ( state a to state i as stated in your jpg)
Each state will check and/ or handle as described in your jpg.

Picbuster
 

Thread Starter

mah

Joined Mar 15, 2010
393
i built the msec delay but the i didn't study the state machine yet, so is there any other solutions?
 
Top