I am trying to complete my programm to sent distance from HC SR04 ultrasonic with sms to my phone number with Tiny Tine GSM shield but i can not compile it, because it blocks me with error messages #
error:
-invalid conversion from 'int' to 'char*'
-initializing argument 2 of 'char SMSGSM: :SendSMS (char* , char*)'
Is it the single character 'distance' that you want to send? Aside from the fact that 'distance' is not a single character, sending a character doesn't make sense.
Use sprintf() to convert the value in the variable named distance to a string, and send that string.
i would like to send the number that there is in cm in word of distance, not 'distance' as character..
Can you explain me again please how can i do it ??
Can you explain me again please how can i do it ??
char msgToSend[20];
sprintf(msgToSend, "Distance: %d cm", distance); // Or whatever the name of the variable that holds the distance is
// send the sms, using msgToSend as the second argument.
i have change my programm like the following link but i just made something wrong again with sprintf command because again it sends to me only the characters tha there are in "..."
you are very right because i dont know many things about programming and thank you..Finally i found my fault and i m sorry because I am running to request your info..