I have issues fading an LED on my Arduino board using the rs232 - node.
I´m not able to realize a smooth fading of the brightness of the LED when I´m moving the faders in vvvv. The LED just stutters irregularly.
See the screenshot and the attached sketch. I also added the Arduino sketch which receives the Serial data coming from vvvv.
Maybe vvvv is sending too often serial data to the Serial port??
Can I define a setInterval() are something similar in vvvv, too?
Has anyone an idea how I can fade my LED smoothly in vvvv?
In my patch I tried to set a kind of interval to the R - channel, but this does not prevent the rs232 node from writing serial data to the serial port as often as before.
Well, I know the way with Firmata (which is indeed able to realise a smooth fading), but unfortunately I can´t use it, because I´ve got a lot more things to specify in my Arduino sketch, as I´m going to distribute the incoming value over an i2c network to several slaves.
Unfortunately I can´t find any solution for my issue :-(
In brief: I need to find out how vvvv can send serial data this way the LEDs on the Arduino board fade smoothly.
I have no insight in what the FirmataEncode node does, but this node realizes a smooth fading perfectly.
If someone can teach me …
I have been trying lots of alternatives for months but I´m coming back to vvvv because I can´t believe that there is no solution!
In the arduino code, the only delay I see is delay(3), so you should be able to send 333 values/second. Your patch isn’t running that fast (check that using the timing node).
If the Firmate node works for you, why not just use that and forget about the other code? I don’t know what hardware setup is, but if it is as basic as having R,G,B LEDs PWM-ing at pin 9,10,11 you can save yourself a LOT of trouble.
About your patch:
First you use a value from 0 - 255, and than you map that back to 0 - 1.
Forget what you know from DMX/8bit and stuff, keep your vvvv values between 0 and 1 in vvvv, so RGB, LFO’s and many other nodes can talk to each other without you having to use the MAP node all over the place.
It shows how to create and exchange your own simple messages with Arduino. This example smoothly fades the LED. A bit more things than you need are hapenning there, but look at the Step 2. There is a Limiter (Animation) node which limits how many times per second the values are sampled.
I´m the happiest!
Having tested and modified beyon´s Wishbox yesterday, I now enjoyed colorsound´s example ‘SendSerial2Arduino.rar’. I must correct myself: It is well understandable, clear and it works perfectly. It doesn´t need any .cs-plugins as beyon´s Wishbox does.
I think, this is just the right thing I was looking for!
Your example is clear, too. In fact, your solution is quite similar to colorsound´s. If I hadn´t been too lazy to update to the current vvvv girlpower folder (31_2) until now, I would have seen this new example earlier!!
It´s only a short while ago, I got lost in girlpower\The Next Generation…
Of course I know the way through Firmata.
In my case, however, I have to stay a bit more flexible on the Arduino side.
I can´t simply turn my Arduino-board into a brainless slave as it is the case with Firmata. Without the need the need of more flexibility I wouldn´t care about other solutions than Firmata.
But now, I´ve got it.
@all: Thanks so much for helping. This is a great thread (not even one day old).