So I have input coming in from a GUI therefore the number I need is coming in as a string. I need to then save it as a long variable to do the character transforms or what ever it is called then save the result as chars to send to an array list to send over a serial port.
Section of code Im dealing with:
Section of code Im dealing with:
- unsigned long time= long(Additional);//taking in the GUI data
unsigned char b1, b2, b3, b4;//the multiple bytes set up as char for reasons unknown to me - b1= time>>24;
b2= time>>16;
b3= time>>8;
b4= time & 0xff; - hexadd.add(b1,b2,b3,b4);
This is a code that I got from someone who actually knows what they are doing, unfortunately he isnt as great as explaining what he wrote does, so If someone could also explain what all this does that would be great...
I've gotten as far as this description: take the Additional variable from format of string save to another variable(time) in format of unsigned long(which I dont know if how that is written actually works), then create some chars(why they are unsigned too I have no clue), magic, then add the chars to the array list.
Thank you so much-
Adie :)
I've gotten as far as this description: take the Additional variable from format of string save to another variable(time) in format of unsigned long(which I dont know if how that is written actually works), then create some chars(why they are unsigned too I have no clue), magic, then add the chars to the array list.
Thank you so much-
Adie :)
1