Lesson 25: How to Push Notifications to Smartphone


Written by Jonathan Sim

You can find this lesson and more in the Arduino IDE (File -> Examples -> Andee). If you are unable to find them, you will need to install the Andee Library for Arduino IDE.

Works on Android
Apart from sending SMSes, you can also get the Annikken Andee to push notifications directly to your smartphone to alert you of a change in sensor reading and more!

Here's how a push notification typically looks:



Top of the Code

#include <SPI.h>
#include <Andee.h>

// We'll use a button to send the message
AndeeHelper btnNotify;
AndeeHelper notificationObject; // The notification must be declared as an object


void setup()
  Andee.begin();  // Setup communication between Annikken Andee and Arduino
  Andee.clear();  // Clear the screen of any previous displays
  setInitialData(); // Define object types and their appearance


void setInitialData()
  btnNotify.setTitle("Push Notification");
  notificationObject.setType(NOTIFICATION); // Sets object as an SMS object
  notificationObject.setTitle("Notification Title"); 
  notificationObject.setMessage("Notification Message"); 
  notificationObject.setTicker("Text that appears at status bar when notification is pushed"); 



void loop()
  if( btnNotify.isPressed() ) // When user presses the send button on phone
    btnNotify.ack(); // Acknowledge button press
    notificationObject.notify(); // Pushes the notification to the smartphone

  // Do not update push notification objects!
  delay(500); // Always leave a short delay for Bluetooth communication
comments powered by Disqus