Blynk library for embedded hardware. Works with Arduino, ESP8266, Raspberry Pi, Intel Edison/Galileo, LinkIt ONE, Particle Core/Photon, Energia, ARM mbed, etc. http://www.blynk.cc/
Dependents: Blynk_RBL_BLE_Nano Blynk_MicroBit Blynk_Serial Blynk_RBL_BLE_Nano
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 15:11:12 by 1.7.2