Hey,
the code underneath is to send a value from processing to arduino (In this case angular degrees for a servo)
processing writes : port.write(spos + "a");
and Arduino gets that and uses switch... case to write it to a servo.
when you write : port.write(spos + "b");
it will write to an other servo.
I want to use this method for a large Serial communication and i need 24 "letters"
in my processing version it would look something like that:
char[] Order = {"a","b","c",..and so on ....,"v","w","x"};
and than :
port.write(pos + Order[i]);
but that doesn't work because I can't change strings into char. "a" is a string and 'a' is a char ( as far I understood)
I did the array with chars {'a','b','c'.......}; but my servos didn't even twitch......
I tried it with the simple >>>port.write(spos + "b"); <<<<< method and everything worked fine, so it needs to be something wrong with the array.
has someone any helpful suggestions?
I am really confused it think
Thank you very much !!!!
P.S. that is not my code down there, but I thought it is easier to see that little code than my gigantic and confusing code.
/** * Servocontrol (derived from processing Mouse 1D example.) * * Updated 24 November 2007 */
// Use the included processing code serial library import processing.serial.*;
int gx = 15; int gy = 35; int spos=90;
float leftColor = 0.0; float rightColor = 0.0; Serial port; // The serial port
Hello,
I wanted to test the Face Detection library / JMyron library but When I ran the example code Windows 7 crashed...
I tried a lot of diffrent aproaches and nothing changed.
Here is the source: