Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp
00001 #include "mbed.h" 00002 00003 InterruptIn button(p14); 00004 00005 Thread ISRthread(osPriorityAboveNormal); 00006 osThreadId ISRthreadId; 00007 00008 DigitalOut myled(LED1); 00009 DigitalOut myled3(LED3); 00010 00011 void newInput(); 00012 void ISR_thread(); 00013 00014 int main() { 00015 00016 ISRthread.start(callback(ISR_thread)); 00017 button.rise(&newInput); //interrupt to catch input 00018 00019 while(1) { 00020 myled = 1; 00021 osDelay(1000); 00022 myled = 0; 00023 osDelay(1000); 00024 } 00025 } 00026 00027 00028 void newInput() { 00029 osSignalSet(ISRthreadId,0x01); 00030 } 00031 00032 00033 void ISR_thread() { 00034 ISRthreadId = osThreadGetId(); 00035 for(;;) { 00036 osSignalWait(0x01, osWaitForever); 00037 myled3 = 1; 00038 osDelay(500); 00039 myled3 = 0; 00040 } 00041 }
Generated on Thu Jul 21 2022 01:14:25 by
1.7.2