Loading...
Processing Forum
Recent Topics
All Forums
Screen name:
dedz9060
dedz9060's Profile
1
Posts
1
Responses
0
Followers
Activity Trend
Last 30 days
Last 30 days
Date Interval
From Date :
To Date :
Go
Loading Chart...
Posts
Responses
PM
Show:
All
Discussions
Questions
Expanded view
List view
Private Message
Converting string to int
[5 Replies]
22-Mar-2012 04:25 AM
Forum:
Programming Questions
Hey everyone, Iv never posted here before, I normally find what I need on here quite easily but I am now stuck.
I have search the forum for this issue and tried everything that has already been suggested but its still not working.
the program is designed to take a temperature reading from an Arduino Uno and use it as an int to be displayed on screen.
here are all the variables I'm using
int DT = 40; // Desired temp
int AT = 0; // Actual temp
int lf = 10; // line feed end signal sent by arduino
Serial myPort; // The serial port
String in = null ; //received string
this is the code I'm using to read the serial input and then convert the string
while (myPort.available() > 0)
{
in = myPort.readStringUntil(lf);
if (in == null)
{
}
else if (in != null )
{
AT = int(in);
print(in); //test
print (" / "); // test
println (AT); //test
}
}
any help or suggestions would be welcomed.
Thanks
Dedz
«Prev
Next »
Moderate user : dedz9060
Forum