= Accelerometer RGB - BLYNK Funtion (Works with V2 Button/Switch Funtion) =īLYNK_WRITE(V1) // Needs accelerometer widget in Merge Mode on pin V1 - Funtion runs when V1 Switch is active HIGH. Int b = param.asInt() // get a BLUE channel value.ĪnalogWrite(RedP, r) // Write to RED RGB pin.ĪnalogWrite(GrnP, g) // Write to GREEN RGB pin.ĪnalogWrite(BluP, b) // Write to BLUE RGB pin. Int g = param.asInt() // get a GREEN channel value. ![]() ![]() Int r = param.asInt() // get a RED channel value. I have just cut/pasted snippets and edited them together for this post… check for syntax errors //= zeRGBa RGB - BLYNK Funtion =īLYNK_WRITE(V0) // Needs zeRGBa widget in Merge Mode on pin V0. The accelerometer widget in merge mode set to V1Īnd of course the usual setup and the basic Blynk void loop: void loop() Needs the zeRGBa widget set to merge mode on V0 Here are two ways to control an RGB LED using the zeRGBa (with virtual pins) and/or a Button/Switch to allow the accelerometer on your phone to change the colours, using BLYNK_WRITE() Functions - essentially loops that are called when the corresponding virtual pin is called. ![]() Search this site for RGB and you will see many ideas and code snippets to experiment from. The zeRGBa as you have it, or three sliders for individual intensity control of each colour or a button/switch to activate a pre-programmed routine, etc. Using the Virtual pins and a bit of code, you can use a whole combination of widgets to control the same RGB strip.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |