This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <cm1106_i2c.h> | |
| CM1106_I2C cm1106_i2c; | |
| void setup() { | |
| cm1106_i2c.begin(); | |
| delay(1000); | |
| } | |
| void loop() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from machine import SoftI2C, Pin | |
| from ssd1306 import SSD1306_I2C | |
| i2c = SoftI2C(sda=Pin(13), scl=Pin(14)) | |
| display = SSD1306_I2C(128, 64, i2c, addr=0x3C) | |
| # 0 : OFF/BLACK, 1 : ON/WHITE | |
| display.fill(0) | |
| display.show() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from machine import Pin | |
| led = Pin(2, Pin.OUT) | |
| key = Pin(0, Pin.IN, Pin.PULL_UP) | |
| while True: | |
| state = not key.value() | |
| led.value(state) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <SoftwareSerial.h> | |
| SoftwareSerial mySerial(2, 3); // RX, TX | |
| void setup() { | |
| mySerial.begin(9600); | |
| } | |
| void loop() { | |
| mySerial.println("Hello DSLogic!!"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #define PIN_S 8 | |
| #define INTERVAL_MS 1 | |
| void setup() { | |
| pinMode(PIN_S, OUTPUT); | |
| digitalWrite(PIN_S, LOW); | |
| } | |
| void loop() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from network import WLAN, STA_IF | |
| from time import time | |
| from machine import SoftI2C, Pin, RTC, Timer | |
| from ssd1306 import SSD1306_I2C | |
| import ntptime | |
| SERVER = 'broker.mqttdashboard.com' | |
| PORT = 1883 | |
| CLIENT_ID = 'esp32' | |
| TOPIC = 'devicemart' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from network import WLAN, STA_IF | |
| from time import time, sleep | |
| from usocket import socket | |
| from mqttclient import MQTTClient | |
| SERVER = 'broker.mqttdashboard.com' | |
| PORT = 1883 | |
| CLIENT_ID = 'esp32' | |
| TOPIC = 'devicemart' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from network import WLAN, STA_IF | |
| from time import time, sleep | |
| from usocket import socket | |
| from mqttclient import MQTTClient | |
| SERVER = 'broker.mqttdashboard.com' | |
| PORT = 1883 | |
| CLIENT_ID = 'esp32' | |
| TOPIC = 'devicemart' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from network import WLAN, STA_IF | |
| from time import time, sleep | |
| from usocket import socket | |
| wlan = WLAN(STA_IF) | |
| wlan.active(True) | |
| start_time = time() | |
| if not wlan.isconnected(): | |
| print('Connecting to network...') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from machine import SoftI2C, Pin | |
| from ssd1306 import SSD1306_I2C | |
| from network import WLAN, STA_IF | |
| from time import sleep, time | |
| i2c = SoftI2C(sda=Pin(13), scl=Pin(14)) | |
| display = SSD1306_I2C(128, 64, i2c, addr=0x3C) | |
| led = Pin(2, Pin.OUT) |