Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Arduino Code

  • 21-11-2017 7: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,262 ✭✭✭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,570 ✭✭✭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