![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Part of the Pacemaker Project; this models the Pacemaker.
Dependencies: mbed TextLCD mbed-rtos
PMTest.cpp
- Committer:
- chadnach1
- Date:
- 2015-11-24
- Revision:
- 1:979e9e785549
File content as of revision 1:979e9e785549:
#include "mbed.h" // This represents the heart DigitalOut myled(LED1); int p_clock; 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); } }