Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: Adafruit_GFX 19E042PIM_MB_PINS
Revision 3:522c779c5f29, committed 2021-12-11
- Comitter:
- filip_ste
- Date:
- Sat Dec 11 16:06:24 2021 +0000
- Parent:
- 2:8dacbf975c41
- Child:
- 4:55d5519a06a1
- Commit message:
- Filip Stevanovic 2020/0039
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Sat Dec 11 15:53:49 2021 +0000 +++ b/main.cpp Sat Dec 11 16:06:24 2021 +0000 @@ -47,6 +47,8 @@ string recv; string tran; +bool oledInit = false; + string chrToStr(char* a, int size){ string s = ""; for (int i = 0; i < size; i++) { @@ -113,9 +115,10 @@ } else if(s == "oled") { - myOLED.begin(); - myOLED.clearDisplay(); - myOLED.display(); + oledInit = true; + //myOLED.begin(); + //myOLED.clearDisplay(); + //myOLED.display(); } } @@ -126,13 +129,13 @@ { wifi = WiFiInterface::get_default_instance(); - //printf("Connecting to %s \n",MBED_CONF_APP_WIFI_SSID); + printf("Connecting to %s \n",MBED_CONF_APP_WIFI_SSID); int ret = wifi->connect(MBED_CONF_APP_WIFI_SSID, MBED_CONF_APP_WIFI_PASSWORD, NSAPI_SECURITY_WPA_WPA2); //if(ret != 0){ // printf("Greska u povezivanju"); // return -1; //} - //printf("Connected\n"); + printf("Connected\n"); socket.open(wifi); socket.connect(hostname,port); @@ -153,7 +156,8 @@ t.reset(); } thread_sleep_for(SMALL_WAIT_MS); - updateOLED(); + if(oledInit) + updateOLED(); client.yield(1000); } }