Hello again,
I am making good progress with my Pi and serial communications (thanks to the Pi4J example code ! ). My ultimate goal is to communicate to a small servo amplifier I have here . It is possible to do this over the serial port on the amplifier, but messages must be in Ascii format.
I have managed to convert (using someone else's example code) what I want to send (for example the amplifier wants to see an ascii message "termon" in ascii to enter control from serial port, and I can print the ascii codes for each character. I am just not sure how I can package it up to transmit out the serial port in the correct ascii format. I always get stuck in these situations where the compiler is "expecting " something different than I am thinking ...
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
String str = "termon";
StringBuilder sb = new StringBuilder();
for (char c : str.toCharArray())
sb.append((int)c);
BigInteger mInt = new BigInteger(sb.toString());
System.out.println(mInt);
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Since there seems to be a class and methods for almost everything in java ... is there something anyone could suggest?
Thank you
Tom