Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Arduino Code

  • 21-11-2017 08:07PM
    #1
    Registered Users, Registered Users 2 Posts: 11,553 ✭✭✭✭


    Hi,

    Trying to run the below code but getting the following error message:
    exit status 1
    expected unqualified-id before '==' token

    Code is as follows:
    ==============================================
    = Arduino SOS CAll sim900 shield Project =
    = with Arduino =
    = http://www.mrmodder.com =
    ==============================================
    #include "SIM900.h"
    #include <SoftwareSerial.h>
    #include "call.h"

    #define ACTIVE LOW

    const int ledPin = 13; // the number of the LED pin

    CallGSM call;
    boolean started=false;
    int buttonState = 1;
    const int buttonPin = 7; // the number of the pushbutton pin
    boolean calling = false;

    void setup()
    {

    Serial.begin(9600);
    pinMode(ledPin,OUTPUT);
    pinMode(buttonPin, INPUT);
    digitalWrite(buttonPin,HIGH);
    if (gsm.begin(9600))
    {
    Serial.println("\nstatus=READY");
    started=true;
    }
    else
    Serial.println("\nstatus=IDLE");
    }

    void loop()
    {
    buttonState = digitalRead(buttonPin);
    if (buttonState == ACTIVE) {
    if(calling)
    {
    digitalWrite(ledPin,LOW);
    calling = false;
    call.HangUp();
    delay(1000);
    }else
    {
    calling = true;
    digitalWrite(ledPin, HIGH);
    delay(1000);
    call.Call("+300000000000"); //Insert telephone number here

    }

    https://mrmodder.com/make-a-call-using-gsm-module-arduino/

    Have a GSM shield and trying to call a preset number using the above tutorial but I cant get the code to run properly


Comments

  • Registered Users, Registered Users 2 Posts: 6,271 ✭✭✭Buford T Justice


    if (buttonState == ACTIVE)
    

    looks like it could be the cause, since active isn't of type int and buttonState is


  • Registered Users, Registered Users 2 Posts: 6,677 ✭✭✭daymobrew


    if (buttonState == ACTIVE)
    

    looks like it could be the cause, since active isn't of type int and buttonState is
    #define LOW  0x0 // cores/arduino/Arduino.h
    
    #define ACTIVE LOW
    
    I would expect that the compiler can convert LOW to an int.


Advertisement