New Homepage Forums Communication Shields my 1sheeld isnt communicating with my phone

This topic contains 1 reply, has 2 voices, and was last updated by avatar Amr 9 months, 1 week ago. This post has been viewed 127 times

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #137349
    avatarkeith3
    Participant

    my 1sheeld isnt sending the notification to my phone. instead it is sending it to the serial port. what am i doing wrong?

    #define CUSTOM_SETTINGS
    #define INCLUDE_NOTIFICATION_SHIELD

    /* Include 1Sheeld library. */
    #include <OneSheeld.h>

    int PressurePin = A0;
    int Pressure;
    const int CarVoltage = 13;

    void setup()
    {
    /* Start communication. */

    OneSheeld.begin();
    Serial.begin(9600);
    /* Set the button pin as input. */
    pinMode(CarVoltage,INPUT);
    }

    void loop()
    {
    /* Pressure = analogRead(PressurePin);
    Serial.print(“Pressure: “);
    Serial.println(Pressure);
    delay(500);*/

    /* Always check the button state. */
    /* if(digitalRead(CarVoltage) == LOW)
    {*/
    if (Pressure > 100)
    {
    String notify = “HELP!!”;
    Notification.notifyPhone(notify);
    /* Wait for 300 ms. */
    OneSheeld.delay(1000);
    }
    /* }*/

    }

    #137957
    avatarAmr
    Keymaster

    Hi,

    The reason is that you are conflicting the Arduino’s serial port since 1Sheeld uses it too for communication with the Arduino and now you are using the same serial port to make the Arduino communicate with the PC serial monitor!

    The solution is to remove the “Serial.begin(9600);” line and all other serial.print functions and you can use the Terminal Shield instead of the PC serial monitor and terminal shield works the same.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.