-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
34 lines (32 loc) · 1.52 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import esp, time, esp32, machine, network
import jormun, sysfont
from ST7735 import TFT, TFTColor
from machine import SPI, Pin, PWM, Timer
from umqtt.simple import MQTTClient
broker_address = '127.0.0.1'# MQTT服务器地址
broker_port = '1883'# MQTT服务器端口
client_id = 'mqttx_114514'# MQTT设备id
user_name = '可莉不知道哦'# mqtt 设备用户名
password = '可莉不知道哦'# mqtt 设备密码
publish_topic = 'espsend'# 推送主题
subscribe_topic = 'espreceive'# 订阅主题
SSID = '可莉不知道哦'#WLAN名称,只可选择2.4G WiFi
PASSWORD = '可莉不知道哦'#WLAN密码
wlan = network.WLAN(network.STA_IF)
mqtt_client = None
spi = SPI(1, baudrate=20000000,polarity=0,phase=0,sck=Pin(7),mosi=Pin(6),miso=Pin(2))
tft=TFT(spi,10,0,1)
tft.initr()
tft.rgb(True)
mqtt_client = None
aString="""A Blessing For The Living. A Flower Branch For the Dead. With The Sword Of Justice. A Punishment Of Death To Evildoers. And We Will Arrive At The Altar Of The Saints. I swear on the name of Santa Maria to smite the unrighteous with my hammer!"""
#给予生者施舍,给予死者鲜花,为正义握剑,给恶徒死的制裁,并且我们会加入圣者的行列,向圣母玛利亚起誓,对一切不义予以铁锤的制裁!
jormun.breathe()#点按boot按键退出呼吸灯模式
jormun.led(5)#长按5秒退出按键输入LED输出模式
jormun.breathe()
jormun.picture(3,2,1)#3张图片,循环显示2次,每张显示1秒
jormun.breathe()
jormun.word(aString)
jormun.presstoexit(2)
jormun.breathe()
jormun.mymqtt()