Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Java 

Arduino Processing Java

Hello everybody,

i want to reach that values represent themselves via processing from the counter. My problem is that my Arduino output is X20, Y20 (step) and I want the output to be displayed on two surfaces. One for X and a second for Y. How should I achieve the same in processing as in my Arduino?
Code
char Serial_in;
int X_Serial_value;
int Y_Serial_value;
……………………………………
// If there is "X" or "x" in Serial, parseInt() will extract the value for X_serial_value from Serial.

while (Serial.available())
{ Serial_in = Serial.read();
if (( Serial_in == 'X' ) ^ (Serial_in == 'x')) { X_Serial_value = Serial.parseInt(); }
else
if (( Serial_in == 'Y' ) ^ (Serial_in == 'y')) { Y_Serial_value = Serial.parseInt(); }


Regards and thanks


Possibly Related Threads...
Thread / Author Replies Views Last Post
[The Brotherhood] by itcorpJul 30, 2026 01:52 AM 4 181 Jul 30, 2026 01:52 AM
Last Post: HerrWinston
[Python] by simmerApr 9, 2022 02:34 PM 5 247 Apr 9, 2022 02:34 PM
Last Post: simmer
[Python] by thebuzisnotMar 22, 2021 02:55 PM 5 215 Mar 22, 2021 02:55 PM
Last Post: Lindros