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.
Dependents: Nucleo_F411RE_OS_Robot_Tank
LED.h
00001 #ifndef LED_H_ADA 00002 #define LED_H_ADA 00003 00004 /* 00005 Example of use: 00006 * @code 00007 *LED user_led(LED1); 00008 *int main() 00009 *{ 00010 * 00011 * while (true) 00012 * { 00013 * user_led.LED_On(); 00014 * wait(0.05); 00015 * user_led.LED_Off(); 00016 * wait(0.05); 00017 * } 00018 *} 00019 * @code 00020 */ 00021 00022 class LED 00023 { 00024 public: 00025 LED(PinName ledpin); 00026 00027 // LED亮起控制函数,IO口输出高电平 00028 void LED_On(); 00029 00030 // LED关闭控制函数,IO口输出低电平 00031 void LED_Off(); 00032 00033 // LED闪烁控制函数,每次调用该函数,则IO口翻转一次状态 00034 void LED_Troggle(); 00035 00036 private: 00037 DigitalOut led; 00038 00039 // 初始化函数 00040 void init(); 00041 }; 00042 00043 #endif
Generated on Tue Jul 12 2022 20:45:21 by
1.7.2