Created
May 7, 2021 09:56
-
-
Save kkmonster/071a6fe1276001b2d512701d96ca6552 to your computer and use it in GitHub Desktop.
This file contains 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
import sensor, image, time, lcd | |
from Corgi85 import corgi85 | |
auth = "sqdSuyH9oidoRBZG5T72UdpYiMFcgeUEifAYTmSfdo8" | |
#reset esp8285 | |
corgi85.reset() | |
#print(dir(corgi85)) | |
#setup camera | |
sensor.reset() | |
sensor.set_pixformat(sensor.RGB565) | |
sensor.set_framesize(sensor.QVGA) | |
#sensor.set_windowing((224, 224)) | |
#sensor.set_vflip(1) | |
#sensor.set_hmirror(0) | |
sensor.run(1) | |
#setup LCD screen | |
lcd.init() | |
lcd.rotation(0) | |
time.sleep(1) | |
count = 0 | |
while(corgi85.wifi_check() == 0): | |
print("WIFI Connecting") | |
time.sleep(1) | |
print("\n\nWIFI Connected") | |
time.sleep(1) | |
corgi85.BLYNK_Set_auth(auth) | |
corgi85.BLYNK_Set_host("blynk-cloud.com") | |
corgi85.BLYNK_Set_port(8080) | |
corgi85.BLYNK_config() | |
count = 0 | |
while(True): | |
if(corgi85.wifi_check()): | |
count = count + 1 | |
# เขียนค่าไป noti บนแอฟ | |
corgi85.BLYNK_noti("Hello CorgiDude") | |
# เขียนค่าไป int ไปที่ virtual pin 1 | |
corgi85.BLYNK_write_int(1, count) | |
# เขียนค่าไป float ไปที่ virtual pin 2 | |
corgi85.BLYNK_write_float(2, 1.11) | |
# เขียนค่าไป char ไปที่ virtual pin 3 | |
corgi85.BLYNK_write_char(3, "test") | |
# อ่านค่าที่ virtual pin ุ | |
print(corgi85.BLYNK_read(6)) | |
else: | |
print("WIFI Not Connected") | |
time.sleep(5) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment