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: Blynk_Example_WIZwiki-W7500
Fork of Blynk by
WidgetLED.h
00001 /** 00002 * @file WidgetLED.h 00003 * @author Volodymyr Shymanskyy 00004 * @license This project is released under the MIT License (MIT) 00005 * @copyright Copyright (c) 2015 Volodymyr Shymanskyy 00006 * @date Apr 2015 00007 * @brief 00008 */ 00009 00010 #ifndef WidgetLED_h 00011 #define WidgetLED_h 00012 00013 #include <Blynk/BlynkWidgetBase.h > 00014 00015 class WidgetLED 00016 : public BlynkWidgetBase 00017 { 00018 public: 00019 WidgetLED(uint8_t vPin) 00020 : BlynkWidgetBase(vPin) 00021 , mValue(0) 00022 {} 00023 00024 uint8_t getValue() const { 00025 return mValue; 00026 } 00027 00028 void setValue(uint8_t value) { 00029 mValue = value; 00030 Blynk.virtualWrite(mPin, value); 00031 } 00032 00033 void on() { 00034 setValue(255); 00035 } 00036 00037 void off() { 00038 setValue(0); 00039 } 00040 00041 private: 00042 uint8_t mValue; 00043 }; 00044 00045 #endif
Generated on Tue Jul 12 2022 17:30:45 by
1.7.2
