Es müsste doch dan so inetwa aussehn oder ??
// Example 55.1
#include <SoftwareSerial.h>
SoftwareSerial SIM900(7, 8); // configure software serial port
const int buttonPin = 3;
int buttonState = 0;
int buttonPushCounter = 0; // counter for the number of button presses
int buttonState = 1; // current state of the button
int lastButtonState = 0; // previous state of the button
void setup() {
pinMode(buttonPin, INPUT);
}
void loop() {
buttonState = digitalRead(buttonPin);
if (buttonState == HIGH) {
if (buttonState != lastButtonState) {
buttonPushCounter++;
Serial.println("on");
Serial.print("number of button pushes: ");
Serial.println(buttonPushCounter);
} else {
}
SIM900.begin(19200);
SIM900power();
delay(30000); // give time to log on to network.
callSomeone(); // call someone
SIM900power(); // power off GSM shield7
}
Serial.println("off");
}
// software equivalent of pressing the GSM shield "power" button
void SIM900power() {
digitalWrite(9, HIGH);
delay(1000);
digitalWrite(9, LOW);
delay(5000);
}
void callSomeone() {
SIM900.println("ATD + +49xxxxxx;"); // dial DE (49) xxxxx
delay(100);
SIM900.println();
delay(10000); // wait for 10 seconds...
SIM900.println("ATH"); // hang up
}