PRESA Raphaël
/
FSK_EX
exemple gene carre
Diff: main.cpp
- Revision:
- 0:a882c1c6acaa
diff -r 000000000000 -r a882c1c6acaa main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon May 23 06:16:46 2016 +0000 @@ -0,0 +1,26 @@ +#include "mbed.h" + + +DigitalOut FSK(p20); + + +void myIRQ() { + LPC_TIM0->IR |= 1 << 0; + FSK = !FSK; +} + + +int main() { + + + + while (1) { + + LPC_TIM0->MR0 = 104; // Match count for 114kHz + LPC_TIM0->MCR = 3; // Interrupt and Reset on Match + LPC_TIM0->TCR = 1; // Enable Timer0 + NVIC_SetVector(TIMER0_IRQn,(uint32_t)&myIRQ); + NVIC_EnableIRQ(TIMER0_IRQn); + } + +} \ No newline at end of file