gehan_s
Member level 3
- Joined
- Aug 31, 2012
- Messages
- 62
- Helped
- 3
- Reputation
- 6
- Reaction score
- 3
- Trophy points
- 1,288
- Location
- Sri Lanka
- Activity points
- 1,799
Hi all,
I am sending data from a GUI (designed using C#) to a PIC microcontroller. Each data is separated by a "," and each data string is terminated by a "\n". This is how I am doing it.
The values kp, ki, kd, v, i, t, s are integers converted into characters. The phrase #DCMC# acts as an identifier so if the incoming string starts with "#DCMC#" then accept the string.
How do I obtain the integer data from this string? (I am using mikroC PRO for PIC)
Regards
I am sending data from a GUI (designed using C#) to a PIC microcontroller. Each data is separated by a "," and each data string is terminated by a "\n". This is how I am doing it.
Code:
send_s = "#DCMC#" + "," + kp + "," + ki + "," + kd + "," + v + "," + i + "," + t + "," + s + "," + "\n";
if (!serialPort1.IsOpen)
return;
buff = send_s.ToCharArray();
serialPort1.Write(buff, 0, buff.Length);
The values kp, ki, kd, v, i, t, s are integers converted into characters. The phrase #DCMC# acts as an identifier so if the incoming string starts with "#DCMC#" then accept the string.
How do I obtain the integer data from this string? (I am using mikroC PRO for PIC)
Regards