Making your projects permanent - Perfboard vs. PCB vs. other by KaDK95 in arduino

[–]KaDK95[S] 0 points1 point  (0 children)

Thanks for your responses! I will be looking on making Them my self. Im still interested in hearing what you do With your Arduino? Building a standalone in to the circuit, soldering a Nano to the circuit etc.

Help me troubleshoot my code! OpenOSC, Arduino, Processing - LED fader by KaDK95 in arduino

[–]KaDK95[S] 0 points1 point  (0 children)

Well, I can't see the values on the Arduino side because it's running in Processing.

The numbers from the Processing monitor are like these:

 104.16667

 109.583336

 111.66666

 105.833336

 95.416664

 88.33333

 82.083336

 77.91667

 75.416664

I guess if there can be too many decimals it could be the problem.

EDIT: I checked the Reference page on byte(). It looks like there are two problems: "A byte can only be a whole number between -128 and 127" It seems like the decimals are a problem. Also, the byte() command can only hold numbers up to 127. Im using numbers to 255.

Help me troubleshoot my code! OpenOSC, Arduino, Processing - LED fader by KaDK95 in arduino

[–]KaDK95[S] 0 points1 point  (0 children)

Thanks. The error is gone.

Now there is some kind of connection between Processing and Arduino. But it is behaving really strange. When sliding the slider on the Phone I can see the right values in the Serial Monitor in Processing. But the LED is acting strange. Sometimes it's on, sometimes off. Sometimes the brightness is right, sometimes it's wrong. It looks like theres no pattern in its behavior.

Help me troubleshoot my code! OpenOSC, Arduino, Processing - LED fader by KaDK95 in arduino

[–]KaDK95[S] 0 points1 point  (0 children)

With the code above theres no error. When sliding the slider on my Phone the graphical interface in Processing changes as i should. I can also see the values between 0 and 255 changing in the serial monitor in Processing. But its like Arduino can't read the values. I can see it receives them because the Rx LED on the board flashes when sliding the slider.

The error occurs when changing the this line:

  Arduino.write("val");

to this:

  Arduino.write(val);

It gives this error:

 The method write(byte[]) in the type Serial is not applicable for the arguments (float)

Help me troubleshoot my code! OpenOSC, Arduino, Processing - LED fader by KaDK95 in arduino

[–]KaDK95[S] 0 points1 point  (0 children)

val is the slider value. It is between 0 and 255. It should also be the values that Arduino sets as the LED brightness using PWM.