Hello. I am new to arduino and RGBW LED strip. I am using SK6812 RGBW LED Strip. This post helped me in filling the LED strip with single color.
However, I want to make the LED strip glow once the buttion from C# form is clicked. I have used serial Port and when the char '1' is sent, the led strip is to glow. But, the code is not working.
How do I turn on the LED strip using C# WinForm Button
P.S.: In the simple RGB LED strip, the Code in C# works. It is not working in this RGBW Strip.
Th epicture of the RGBG strip I am using is below.
I am not quite sure, where should I print it?
I added ** Serial.print(incomingOption);** as in the following code snippet, but it did not print anything.
switch (incomingOption){
case '1':
colorFill(CRGB::Red);
Serial.print(incomingOption);
break;
What does "turn on" mean? Set the colour as in your C# snippet?
Based on the information that you have provided, I suggest that you modify your Arduino code to echo the received command (Serial.print). Then, in the C# code
Add a multiline textbox where you will display the received data.
After a write to the port, do a read to check what the Arduino echoed back.
As indicated in post #9 by @UKHeliBob , you're still missing a Serial.begin() in setup(); did you ever test this with serial monitor.
You should check if serial data is available before reading it.
Your code is unresponsive; it takes ages once you have send a dgit before it reacts to another digit. This is due to your 300x50 ms delay. I suggest that you rewrite it in a non-blocking way.
Please fix at least (1) and (2) and preferably (3) and post a new version of the sketch [edit]if you still have problems[/edit].
I don't immediately see something wrong with the C# code but haven't tested it.