Dependencies:   LCD_i2c_GSOE ESP8266MQTT

main.cpp

Committer:
jack1930
Date:
2021-06-29
Revision:
2:40091707a95c
Parent:
1:f6ebd1725aae
Child:
5:fb5a02cfb826

File content as of revision 2:40091707a95c:

#include "mbed.h"
#include "PubSubClient.h"

PortOut diag(PortC,0xFF);
AnalogIn poti(PA_0);

PubSubClient client;

int main()
{
    diag=1;
    int d;
    char buffer[64];
    client.connect((char*)"joerg");    
    while(true)
    {
        diag=diag+1;
        d=diag;
        sprintf(buffer, "poti=%d", (int)(poti*4095));
        client.publish("MBED/joerg/ersteTests", buffer);
        HAL_Delay(1000);
        sprintf(buffer, "diag=%d", d);
        client.publish("MBED/joerg/zweiteTests", buffer);
        HAL_Delay(1000);
    }
}