Hi
I am stuck with sending numeric value through SMS. I got a piece of code which I used for this project
https://searchcode.com/codesearch/view/37984800/
I am using Ardunio Mega with ICOMSAT 1.1 SIM900
I simplifed this code for SMS sending
#include <SoftwareSerial.h>
#include <GSM_Shield.h>
//**************************************************************************
char number[]="+9212345678"; //Destination number
char text[]="hello world"; //SMS to send
byte type_sms=SMS_UNREAD; //Type of SMS
byte del_sms=0; //0: No deleting sms - 1: Deleting SMS
//**************************************************************************
GSM gsm;
char sms_rx[122]; //Received text SMS
//int inByte=0; //Number of byte received on serial port
char number_incoming[20];
int call;
int error;
void setup()
{
Serial.begin(9600);
Serial.println("system startup");
gsm.TurnOn(9600); //module power on
gsm.InitParam(PARAM_SET_1);//configure the module
gsm.Echo(0); //enable AT echo
void SIM900power();
// software equivalent of pressing the GSM shield "power" button
delay(5000);
digitalWrite(9, HIGH);
delay(500);
digitalWrite(9, LOW);
delay(500);
}
void loop()
{
char inSerial[5];
int i=0;
delay(5000);
//Check data serial com
Serial.print("Send SMS to ");
Serial.println(number);
error=gsm.SendSMS(number,text);
delay(5000);
}
This work good for sending SMS as whenever I run program it send me sms.
Now instead of sending a particular text as mention
char text=“hello world”; //SMS to send
I need to float a variable like
float temperature=27;
and send this via SMS
Later I will convert this variable temperature with DS18b20 temperature data.
I made some changes to code but ended in error
void loop()
{
char inSerial[5];
int i=0;
delay(5000);
float temp=27;
//Check data serial com
Serial.print("Send SMS to ");
Serial.println(number);
error=gsm.SendSMS(number,temp);
delay(5000);
}
Error: working_send_sms:66: error: no matching function for call to ‘GSM::SendSMS(char [12], float&)’
I think I am making mistake in converting float to char.
Can someone help me on this?
This is my 1st post, so please let me know if there are posting errors