diff --git a/esp32/.idea/.gitignore b/esp32/.idea/.gitignore
new file mode 100644
index 0000000..26d3352
--- /dev/null
+++ b/esp32/.idea/.gitignore
@@ -0,0 +1,3 @@
+# Default ignored files
+/shelf/
+/workspace.xml
diff --git a/esp32/.idea/esp32.iml b/esp32/.idea/esp32.iml
new file mode 100644
index 0000000..f571432
--- /dev/null
+++ b/esp32/.idea/esp32.iml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/esp32/.idea/inspectionProfiles/Project_Default.xml b/esp32/.idea/inspectionProfiles/Project_Default.xml
new file mode 100644
index 0000000..cd83845
--- /dev/null
+++ b/esp32/.idea/inspectionProfiles/Project_Default.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/esp32/.idea/inspectionProfiles/profiles_settings.xml b/esp32/.idea/inspectionProfiles/profiles_settings.xml
new file mode 100644
index 0000000..105ce2d
--- /dev/null
+++ b/esp32/.idea/inspectionProfiles/profiles_settings.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/esp32/.idea/misc.xml b/esp32/.idea/misc.xml
new file mode 100644
index 0000000..153e9c5
--- /dev/null
+++ b/esp32/.idea/misc.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/esp32/.idea/modules.xml b/esp32/.idea/modules.xml
new file mode 100644
index 0000000..a631d58
--- /dev/null
+++ b/esp32/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/esp32/main.py b/esp32/main.py
new file mode 100644
index 0000000..e6d5d12
--- /dev/null
+++ b/esp32/main.py
@@ -0,0 +1,150 @@
+'''
+深圳市普中科技有限公司(PRECHIN 普中)
+技术支持:www.prechin.net
+PRECHIN
+ 普中
+
+实验名称:按键控制实验
+接线说明:OLED(IIC)液晶模块-->ESP32 IO
+ VCC --> 5V
+ GND --> GND
+ SCL --> 18
+ SDA --> 23
+
+ 按键模块-->ESP32 IO
+ K1 --> 14
+
+实验现象:程序下载成功后,按下K1操作小恐龙的起跳
+
+'''
+# 导入
+from machine import Pin, SoftI2C
+from ssd1306 import SSD1306_I2C
+import time, random
+
+# 初始化IIC-OLED显示屏
+i2c = SoftI2C(sda=Pin(23),scl=Pin(18))
+oled = SSD1306_I2C(128,64,i2c,addr=0x3c)
+
+# 创建按键对象
+K1 = Pin(14,Pin.IN,Pin.PULL_UP)
+
+# 创建游戏时间
+get_time = time.time()
+game_time = time.time()
+
+# 刷新率为40,跳起时每秒加1
+jump = 0
+jump_num = [0,8,15,21,25,29,32,34,35] # 跳起高度
+down = False # 用于判断jump自加还是自减
+
+# 分数
+score = 0
+
+# 生命值
+life = 3
+
+# 判断游戏结束
+game = True
+
+# 距离
+far = 0
+
+# 障碍物:方块距离随机生成,30到50像素之间
+box1 = random.randint(30,40)
+box2 = random.randint(30,40) + box1
+box3 = random.randint(30,40) + box2
+box4 = random.randint(30,40) + box3
+speed = 2 # 速度(障碍物每帧移动的像素点)
+
+# 循环
+while True:
+ if game:
+ # 触发跳起动作
+ if K1.value()==0 and jump == 0:
+ jump = 1
+ if jump != 0:
+ jump += 1 if not down else -1
+ if jump == 0:
+ down = False
+ score += 1
+ if jump == 8:
+ down = True # 跳到最高点下落
+
+ far += speed # 移动的距离按速度累加(实际是障碍物移动的距离)
+
+ oled.fill(0) # 清空屏幕显示
+ oled.line(0,63,128,63,1) # 底线(屏幕最下边游戏线条)
+
+ # 显示生命值、分数和时间
+ oled.text('LF:'+str(life),0,1)
+ oled.text('SC:'+str(score),45,1)
+ get_time = 'S:'+str(int(time.time()-game_time))
+ oled.text(get_time,95,1)
+
+ #画小恐龙的外形
+ for i in range(6):
+ oled.line(15-i,51-jump_num[jump],15-i,58-jump_num[jump],1)
+ oled.line(17-i,51-jump_num[jump],17-i,54-jump_num[jump],1)
+ oled.line(11-i,55-jump_num[jump],11,58-jump_num[jump],1)
+ oled.line(14,55-jump_num[jump],14,60-jump_num[jump],1)
+ oled.line(10,55-jump_num[jump],10,60-jump_num[jump],1)
+ oled.line(14,52-jump_num[jump],14,53-jump_num[jump],0)
+ oled.line(13,52-jump_num[jump],13,53-jump_num[jump],0)
+
+ #画障碍物
+ for i in range(8):
+ oled.line(i+box1-far,55,i+box1-far,61,1)
+
+ for i in range(8):
+ oled.line(i+box2-far,55,i+box2-far,61,1)
+
+ for i in range(8):
+ oled.line(i+box3-far,55,i+box3-far,61,1)
+
+ for i in range(8):
+ oled.line(i+box4-far,55,i+box4-far,61,1)
+
+ #判断当前障碍物过了屏幕,就把它变最后一个
+ if box1+8-far <= 0:
+ box1 = box2
+ box2 = box3
+ box3 = box4
+ box4 = box3 + random.randint(30,40)
+
+ #判断是否碰到障碍物
+ if 14 > box1-far > 2 and 60-jump_num[jump] > 55:
+ life -= 1
+ if life:
+ jump = 0
+ far = 0
+ box1 = random.randint(30, 40)
+ box2 = random.randint(30, 40) + box1
+ box3 = random.randint(30, 40) + box2
+ box4 = random.randint(30, 40) + box3
+ else:
+ game = False
+ score = 0
+
+ else:
+ oled.fill_rect(0,1,45,10,0)
+ oled.text('LF:'+str(life),0,1)
+ oled.text('SC:'+str(score),45,1)
+ oled.text('GAME_OVER',128//2-40,30)
+ # 游戏结束之后,再次按下按键等待两秒钟再重新开始游戏
+ if K1.value()==0:
+ time.sleep(2)
+ game_time = time.time()
+ game = True
+ far = 0
+ life = 3
+ box1 = random.randint(30,40)
+ box2 = random.randint(30,40) + box1
+ box3 = random.randint(30,40) + box2
+ box4 = random.randint(30,40) + box3
+ speed = 2
+ continue
+
+ time.sleep(1/40)
+ oled.show()
+
diff --git a/esp32/ssd1306.py b/esp32/ssd1306.py
new file mode 100644
index 0000000..a3b27ff
--- /dev/null
+++ b/esp32/ssd1306.py
@@ -0,0 +1,159 @@
+# MicroPython SSD1306 OLED driver, I2C and SPI interfaces
+
+from micropython import const
+import framebuf
+
+
+# register definitions
+SET_CONTRAST = const(0x81)
+SET_ENTIRE_ON = const(0xA4)
+SET_NORM_INV = const(0xA6)
+SET_DISP = const(0xAE)
+SET_MEM_ADDR = const(0x20)
+SET_COL_ADDR = const(0x21)
+SET_PAGE_ADDR = const(0x22)
+SET_DISP_START_LINE = const(0x40)
+SET_SEG_REMAP = const(0xA0)
+SET_MUX_RATIO = const(0xA8)
+SET_COM_OUT_DIR = const(0xC0)
+SET_DISP_OFFSET = const(0xD3)
+SET_COM_PIN_CFG = const(0xDA)
+SET_DISP_CLK_DIV = const(0xD5)
+SET_PRECHARGE = const(0xD9)
+SET_VCOM_DESEL = const(0xDB)
+SET_CHARGE_PUMP = const(0x8D)
+
+# Subclassing FrameBuffer provides support for graphics primitives
+# http://docs.micropython.org/en/latest/pyboard/library/framebuf.html
+class SSD1306(framebuf.FrameBuffer):
+ def __init__(self, width, height, external_vcc):
+ self.width = width
+ self.height = height
+ self.external_vcc = external_vcc
+ self.pages = self.height // 8
+ self.buffer = bytearray(self.pages * self.width)
+ super().__init__(self.buffer, self.width, self.height, framebuf.MONO_VLSB)
+ self.init_display()
+
+ def init_display(self):
+ for cmd in (
+ SET_DISP | 0x00, # off
+ # address setting
+ SET_MEM_ADDR,
+ 0x00, # horizontal
+ # resolution and layout
+ SET_DISP_START_LINE | 0x00,
+ SET_SEG_REMAP | 0x01, # column addr 127 mapped to SEG0
+ SET_MUX_RATIO,
+ self.height - 1,
+ SET_COM_OUT_DIR | 0x08, # scan from COM[N] to COM0
+ SET_DISP_OFFSET,
+ 0x00,
+ SET_COM_PIN_CFG,
+ 0x02 if self.width > 2 * self.height else 0x12,
+ # timing and driving scheme
+ SET_DISP_CLK_DIV,
+ 0x80,
+ SET_PRECHARGE,
+ 0x22 if self.external_vcc else 0xF1,
+ SET_VCOM_DESEL,
+ 0x30, # 0.83*Vcc
+ # display
+ SET_CONTRAST,
+ 0xFF, # maximum
+ SET_ENTIRE_ON, # output follows RAM contents
+ SET_NORM_INV, # not inverted
+ # charge pump
+ SET_CHARGE_PUMP,
+ 0x10 if self.external_vcc else 0x14,
+ SET_DISP | 0x01,
+ ): # on
+ self.write_cmd(cmd)
+ self.fill(0)
+ self.show()
+
+ def poweroff(self):
+ self.write_cmd(SET_DISP | 0x00)
+
+ def poweron(self):
+ self.write_cmd(SET_DISP | 0x01)
+
+ def contrast(self, contrast):
+ self.write_cmd(SET_CONTRAST)
+ self.write_cmd(contrast)
+
+ def rotate(self, rotate):
+ self.write_cmd(SET_COM_OUT_DIR | ((rotate & 1) << 3))
+ self.write_cmd(SET_SEG_REMAP | (rotate & 1))
+
+ def invert(self, invert):
+ self.write_cmd(SET_NORM_INV | (invert & 1))
+
+ def show(self):
+ x0 = 0
+ x1 = self.width - 1
+ if self.width == 64:
+ # displays with width of 64 pixels are shifted by 32
+ x0 += 32
+ x1 += 32
+ self.write_cmd(SET_COL_ADDR)
+ self.write_cmd(x0)
+ self.write_cmd(x1)
+ self.write_cmd(SET_PAGE_ADDR)
+ self.write_cmd(0)
+ self.write_cmd(self.pages - 1)
+ self.write_data(self.buffer)
+
+
+class SSD1306_I2C(SSD1306):
+ def __init__(self, width, height, i2c, addr=0x3C, external_vcc=False):
+ self.i2c = i2c
+ self.addr = addr
+ self.temp = bytearray(2)
+ self.write_list = [b"\x40", None] # Co=0, D/C#=1
+ super().__init__(width, height, external_vcc)
+
+ def write_cmd(self, cmd):
+ self.temp[0] = 0x80 # Co=1, D/C#=0
+ self.temp[1] = cmd
+ self.i2c.writeto(self.addr, self.temp)
+
+ def write_data(self, buf):
+ self.write_list[1] = buf
+ self.i2c.writevto(self.addr, self.write_list)
+
+
+class SSD1306_SPI(SSD1306):
+ def __init__(self, width, height, spi, dc, res, cs, external_vcc=False):
+ self.rate = 10 * 1024 * 1024
+ dc.init(dc.OUT, value=0)
+ res.init(res.OUT, value=0)
+ cs.init(cs.OUT, value=1)
+ self.spi = spi
+ self.dc = dc
+ self.res = res
+ self.cs = cs
+ import time
+
+ self.res(1)
+ time.sleep_ms(1)
+ self.res(0)
+ time.sleep_ms(10)
+ self.res(1)
+ super().__init__(width, height, external_vcc)
+
+ def write_cmd(self, cmd):
+ self.spi.init(baudrate=self.rate, polarity=0, phase=0)
+ self.cs(1)
+ self.dc(0)
+ self.cs(0)
+ self.spi.write(bytearray([cmd]))
+ self.cs(1)
+
+ def write_data(self, buf):
+ self.spi.init(baudrate=self.rate, polarity=0, phase=0)
+ self.cs(1)
+ self.dc(1)
+ self.cs(0)
+ self.spi.write(buf)
+ self.cs(1)
\ No newline at end of file
diff --git a/esp32/test.py b/esp32/test.py
new file mode 100644
index 0000000..47f2e26
--- /dev/null
+++ b/esp32/test.py
@@ -0,0 +1,62 @@
+from machine import Pin
+import time
+
+led = Pin(15, Pin.OUT)
+led = Pin(16, Pin.OUT)
+led = Pin(17, Pin.OUT)
+led = Pin(18, Pin.OUT)
+led = Pin(19, Pin.OUT)
+
+beeper = Pin(25, Pin.OUT)
+# led.value(1)
+
+ledValue = 1
+while True:
+ led.value(ledValue)
+
+ if ledValue == 1:
+ ledValue = 0
+ else:
+ ledValue = 1
+
+ time.sleep(1)
+
+def turnOn(led):
+ led.value(1)
+
+def turnOff(led):
+ led.value(0)
+
+def shine(led,ledValue,timecount):
+ while True:
+ led.value(ledValue)
+
+ if ledValue == 1:
+ ledValue = 0
+ else:
+ ledValue = 1
+
+ time.sleep(timecount)
+
+def dou():
+ i = 0
+ b = 0
+ while i <= 100:
+ b = not b
+ beeper.value(b)
+ time.sleep_us(5000)
+ i = i + 1
+
+def re():
+ i = 0
+ b = 0
+ while i <= 100:
+ b = not b
+ beeper.value(b)
+ time.sleep_us(3000)
+ i = i + 1
+
+dou()
+time.sleep(0.5)
+re()
+
diff --git a/esp32/test2.py b/esp32/test2.py
new file mode 100644
index 0000000..3a940e3
--- /dev/null
+++ b/esp32/test2.py
@@ -0,0 +1,13 @@
+from machnie import Pin
+import time
+import onewire
+import ds18x20
+
+ds18b20 = ds18x20.DS18X20(onewire.OneWire(Pin(13)))
+roms = ds18b20.scan()
+
+while True:
+ ds18b20.convert_temp()
+ time.sleep(1)
+ for rom in roms:
+ print(ds18b20.read_temp(rom))
\ No newline at end of file
diff --git a/iot_front/iot_front/.gitignore b/iot_front/iot_front/.gitignore
new file mode 100644
index 0000000..a547bf3
--- /dev/null
+++ b/iot_front/iot_front/.gitignore
@@ -0,0 +1,24 @@
+# Logs
+logs
+*.log
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+pnpm-debug.log*
+lerna-debug.log*
+
+node_modules
+dist
+dist-ssr
+*.local
+
+# Editor directories and files
+.vscode/*
+!.vscode/extensions.json
+.idea
+.DS_Store
+*.suo
+*.ntvs*
+*.njsproj
+*.sln
+*.sw?
diff --git a/iot_front/iot_front/.vscode/extensions.json b/iot_front/iot_front/.vscode/extensions.json
new file mode 100644
index 0000000..a7cea0b
--- /dev/null
+++ b/iot_front/iot_front/.vscode/extensions.json
@@ -0,0 +1,3 @@
+{
+ "recommendations": ["Vue.volar"]
+}
diff --git a/iot_front/iot_front/README.md b/iot_front/iot_front/README.md
new file mode 100644
index 0000000..1511959
--- /dev/null
+++ b/iot_front/iot_front/README.md
@@ -0,0 +1,5 @@
+# Vue 3 + Vite
+
+This template should help get you started developing with Vue 3 in Vite. The template uses Vue 3 `
+
+
+
+
+
+
+
+