Navigation

    M5Stack Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. peter153
    3. Topics
    P
    • Continue chat with peter153
    • Start new chat with peter153
    • Flag Profile
    • Profile
    • Following
    • Followers
    • Blocks
    • Topics
    • Posts
    • Best
    • Groups

    Topics created by peter153

    • P

      Simple Wi-Fi signal strength
      PROJECTS • • peter153

      2
      0
      Votes
      2
      Posts
      3406
      Views

      you can try this pice of code which is working for me: . . #include <WiFi.h> #include "Free_Fonts.h" #include <M5Stack.h> const char* ssid = "your_host"; const char* password = "your_password"; WiFiClient client; void setup() { M5.begin(); // Connecting to WiFi: M5.Lcd.setFreeFont(FM9); M5.Lcd.setTextSize(1); M5.Lcd.setTextColor(TFT_WHITE); M5.Lcd.print("\n\nConnecting to "); M5.Lcd.println(ssid); WiFi.begin(ssid, password); while (WiFi.status() != WL_CONNECTED) { M5.Lcd.setTextWrap(true); M5.Lcd.print("."); delay(500); } M5.Lcd.println("\nWiFi connected"); delay(1000); M5.Lcd.fillScreen(TFT_BLACK); } void loop() { showWifiStrength(); delay(2000); } // show Wifi-RSSI level (signal strength in 4 bars + dBm ) void showWifiStrength() { int WifiRSSI = WiFi.RSSI(); M5.Lcd.fillRect(40, 0, 68, 15, TFT_BLACK); M5.Lcd.setCursor(40, 14); M5.Lcd.print(String(WifiRSSI) + "dBm"); if (WifiRSSI > -50 & ! WifiRSSI == 0 ) M5.Lcd.fillRoundRect(26, 1, 5, 12, 1, TFT_WHITE); else M5.Lcd.fillRoundRect(26, 1, 5, 12, 1, TFT_DARKGREY); if (WifiRSSI > -70 & ! WifiRSSI == 0) M5.Lcd.fillRoundRect(18, 3, 5, 10, 1, TFT_WHITE); else M5.Lcd.fillRoundRect(18, 3, 5, 10, 1, TFT_DARKGREY); if (WifiRSSI > -80 & ! WifiRSSI == 0) M5.Lcd.fillRoundRect(10, 5, 5, 8, 1, TFT_WHITE); else M5.Lcd.fillRoundRect(10, 5, 5, 8, 1, TFT_DARKGREY); if (WifiRSSI > -90 & ! WifiRSSI == 0) M5.Lcd.fillRoundRect(2, 7, 5, 6, 1, TFT_WHITE); else M5.Lcd.fillRoundRect(2, 7, 5, 6, 1, TFT_RED); }
    • P

      How to use Unicode.
      General • • peter153

      7
      0
      Votes
      7
      Posts
      7051
      Views

      L

      Unicode characters can then be entered by holding down Alt , and typing + on the numeric keypad, followed by the hexadecimal code – using the numeric keypad for digits from 0 to 9 and letter keys for A to F – and then releasing Alt .