Please bear with me, I’ve injured my wrist and I am dictating this post on my iPhone. If you see any typos please excuse them. This is also the reason why I didn’t post my entire code, I don’t think it’s really relevant anyways.
So here is what’s going on. I got this really cool app for my iPhone called Net IO. Among other things, it has fields that we’ll send a user-defined string to the Arduino and display the response from the Ardolino. I was using print statements, but they would display random and garbled. After many weeks of pestering and bugging the developer, who is a very nice guy by the way, talking in to logging into my Ardolino and testing out my sketch. Should also mention that he didn’t develop this app strictly for Arduino, it can communicate with a computer, an AVR board- whatever -anything that can receive strings and send responses. After he logged in, he asked me to upload an example sketch. I saw that it used a server.write function, so I tried that in my sketch. It actually worked, everything displayed where it should. However, it wasn’t my entire sketch it was simply test strings within the write function. For example I had server.write(val). This works fine… please keep reading.
My problem is this, I need to be able to take a variable such as one set equal to a mapped out analog reading, and write it followed by space and a percentage sign.
val = analogRead(A5);
lightper = map(val, 0, 1023, 0, 100);
I was using server.print(lightper + " %") but unfortunately the app doesn’t accept that. It’s confusing and unfirtunately nothing that I can solve because I can’t reprogram the iphone application.
I really don’t see how the rest my code could be relevant but I’ll post it later if anybody wants. It’s just hard to do anything on the computer other than dictate because of my wrist.
Any thoughts? Thank you,