Part of the Pacemaker Project; this models the Pacemaker.
Dependencies: mbed TextLCD mbed-rtos
Diff: PacemakerController.cpp
- Revision:
- 1:979e9e785549
- Parent:
- 0:d92e0b71c6b5
- Child:
- 2:5e9c4d83d038
diff -r d92e0b71c6b5 -r 979e9e785549 PacemakerController.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/PacemakerController.cpp Tue Nov 24 23:19:34 2015 +0000 @@ -0,0 +1,34 @@ +#include "mbed.h" + +// This is for the pacemaker +TextLCD lcd(p15, p16, p17, p18, p19, p20, TextLCD::LCD16x2); + +int h_clock; + +void A_Pace() { + +} + +void A_Pace() { + +} + +void timer0_init(void) +{ + LPC_SC->PCONP |=1<1; //timer0 power on + LPC_TIM0->MR0 = 239800; //10 msec + LPC_TIM0->MCR = 3; //interrupt and reset control + //3 = Interrupt & reset timer0 on match + //1 = Interrupt only, no reset of timer0 + NVIC_EnableIRQ(TIMER0_IRQn); //enable timer0 interrupt + LPC_TIM0->TCR = 1; //enable Timer0 +} + +int main() { + while(1) { + myled = 1; + wait(0.2); + myled = 0; + wait(0.2); + } +}