Hi long story short I am currently working on a project at uni and we are making a vending machine, one of the features is to make the vending machine text us when 4 of the items have been vended signalling that the 'stock is low and needs refilling'.
I have a gsm board (Seimens TC35), till now I have managed to send an SMS to my phone but not with the code for the buttons attached, also the text only sends by pressing the reset button on the arduino which is very weird and would like to find a solution to this.
Aims:
- Have the arduino know when 4 different buttons have been pressed then send a Text to my phone
- Have the arduino send the text without the reset button needing to be pressed.
Here is the current code I have used to send a text to my phone:
char phone_no[]="07123456789";
void setup()
{
Serial.begin(9600);
delay(5000);
Serial.print("AT+CMGF=1\r");//sets arduino to text mode
delay(1000);
Serial.println("AT+CMGS="07123456789"");//phone number to text
Serial.print(phone_no);
delay(1000);
Serial.print("Your vending machine stock is low");//message goes here
Serial.println((char)26);
}
void loop()
{
}
I am fairly new with coding, your help is much appreciated,
Many thanks.