BLYNK TEST

Dependencies:   mbed Blynk

main.cpp

Committer:
kenobi
Date:
2021-01-26
Revision:
5:8a3cf73d7ed3
Parent:
3:4cd9171ba989

File content as of revision 5:8a3cf73d7ed3:

#include "mbed.h"
#include "SimpleTimer.h"
extern Serial pc;
#include "WiFiBlynk.h"

Serial pc(SERIAL_TX, SERIAL_RX); // tx, rx
Timer g_Timer;
DigitalOut myled(PB_3);

char SSID[] = "OPPO A7";
char PASS[] = "12345678";

char auth[] = "jx8SAPsgpzJ3pJPzI-q6ZhQIo1F4J7ki";


int main()
{
    pc.baud(9600);
    pc.printf("Enter main()\r\n");
    //myled = 1;
    g_Timer.start();
    SimpleTimer gSimpleTimer(g_Timer);

    EspSerial.baud(9600);
    delay(10);
    
    Blynk.begin(auth, wifi, SSID, PASS);
   
    // Setup a function to be called every second

    //gSimpleTimer.setInterval(3000, PM25);
    
    
    int pretime = g_Timer.read_ms();
    
    
    while(1) {
        //pc.printf("Enter while(1)\r\n");
        //myled = !myled;
        Blynk.run(); // All the Blynk Magic happens here...
        gSimpleTimer.run();
        

    }
}