[code]
{ // If the "in" = 0 , As in I sent 0 from my phone, do the
[/code]Seem to be missing the "if" statement on this line?
[code]
analogWrite (ledpin, 0150);
[/code]Typo! You meant "150". But prefixing a number with a 0 tells the compiler to treat it as an octal number. 150 in octal is 226 in decimal!
But what if I wanted to send something like "Light on"
The Serial.read() (http://arduino.cc/en/Serial/Read) function only returns one byte at a time. If you want to receive a string instead, you need to declare a character array and then use Serial.readBytes() or Serial.readBytesUntil() to read the bytes into it. See this for quick primer on dealing with strings: http://arduino.cc/en/Reference/String
Personally, I'd just toss integers around and be done with it. But I guess depending on the abilities of the application on your phone, you may have to deal with strings. It's a bit of a learning curve, but not bad once you get the hang of it.
And don't get discouraged if this programming business seems a little daunting. It is hard. You're actually doing really well!









Comment