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.
example.cpp
00001 #include "mbed.h" 00002 00003 class LED_TEST:public DigitalOut{ 00004 public: 00005 LED_TEST(PinName pin):DigitalOut(pin) {}; 00006 00007 void TurnOn() {write(1);} 00008 void TurnOff() {write(0);} 00009 }; 00010 00011 #ifdef __IN_A_PROGRAM //if I'm compiling as a program then I want to create this main for testing. 00012 //if I'm compiling as a library I do not want the main to prevent linker problems 00013 int main(void) 00014 { 00015 LED_TEST lt(LED1); 00016 while (1) 00017 { 00018 lt.TurnOn(); 00019 wait(1); 00020 lt.TurnOff(); 00021 wait(1); 00022 } 00023 } 00024 #endif
Generated on Sat Jul 23 2022 20:11:44 by
1.7.2