Mermaid lets you create diagrams and visualizations using text and code [manual](https://mermaid.js.org/intro/)

April 8, 2025

09:13 Woke Up Today, I integrated Mermaid’s flowchart into my blog, and it also displays correctly in Obsidian. Testing the cover page a bit more—this will allow me to create richer content in the future. graph LR; A-->B; A-->C; B-->D; C-->D; 20:40 Back from a Walk with Mom Took Mom around the area where I live, passing by my brother’s workplace, and then walked her back home. A few more trips like this, and I’ll get familiar and comfortable with the route. ...

2025-04-08 · 1 min · 167 words · Ben

PHP中数据库插入错误

在php中数据库插入错误,一般是sql语句中参数不正确,或者参数对应的类型不正确。 1 2 3 4 5 6 $sql = "INSERT INTO SensorData (id, sensor, coords, value1, value2, value3) VALUES ('$id','$sensor', '$coords', '$value1', '$value2', '$value3')"; if ($conn->query($sql) === TRUE) { echo "New record created successfully"; } else { echo "Error: " . $sql . "<br>" . $conn->error; } 另外在使用dht传感器的过程中,出现ETIMEOUT错误,一般是引脚插错,重新检查换用其他引脚,我这个板子目前只有1号引脚可以正常使用。

2022-03-08 · 1 min · 155 words · Ben

ESP32 MicroPython: Non-blocking Delays and Multithreading | Multitasking

![nonblock and multithreading]1 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 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 import machine import time red = machine.Pin(27, machine.Pin.OUT) grn = machine.Pin(26, machine.Pin.OUT) blu = machine.Pin(25, machine.Pin.OUT) mode = machine.Pin(33, machine.Pin.IN, machine.Pin.PULL_UP) left = machine.Pin(32, machine.Pin.IN, machine.Pin.PULL_UP) rght = machine.Pin(35, machine.Pin.IN) entr = machine.Pin(34, machine.Pin.IN) r_start = time.ticks_ms() g_start = time.ticks_ms() b_start = time.ticks_ms() k_start = time.ticks_ms() r_interval = 300 g_interval = 500 b_interval = 700 k_interval = 200 state = 0 EDIT_RESOLUTION = 10 reset = 0 print('**************************') print(' DEFAULT Interval Values ') print('--------------------------') print('Red interval:', r_interval, 'ms') print('Grn interval:', g_interval, 'ms') print('Blu interval:', b_interval, 'ms') print('**************************') while True: if time.ticks_ms() - r_start >= r_interval: red.value( not red.value() ) r_start = time.ticks_ms() if time.ticks_ms() - g_start >= g_interval: grn.value( not grn.value() ) g_start = time.ticks_ms() if time.ticks_ms() - b_start >= b_interval: blu.value( not blu.value() ) b_start = time.ticks_ms() if time.ticks_ms() - k_start >= k_interval: k_start = time.ticks_ms() if mode.value()==0: if state==0: # idle mode state = 1 print() print('*************') print('Red edit mode') print('-------------') elif state==1: # red edit mode state = 2 print() print('*************') print('Grn edit mode') print('-------------') elif state==2: # grn edit mode state = 3 print() print('*************') print('Blu edit mode') print('-------------') elif state==3: # blu edit mode state = 0 print() print('*************') print('Idle mode') print('-------------') if left.value()==0: if state==1: # red edit mode if r_interval - EDIT_RESOLUTION > 0: r_interval -= EDIT_RESOLUTION print('Red interval:', r_interval, 'ms') elif state==2: # grn edit mode if g_interval - EDIT_RESOLUTION > 0: g_interval -= EDIT_RESOLUTION print('Grn interval:', g_interval, 'ms') elif state==3: # blu edit mode if b_interval - EDIT_RESOLUTION > 0: b_interval -= EDIT_RESOLUTION print('Blu interval:', b_interval, 'ms') if rght.value()==0: if state==1: # red edit mode r_interval += EDIT_RESOLUTION print('Red interval:', r_interval, 'ms') elif state==2: # grn edit mode g_interval += EDIT_RESOLUTION print('Grn interval:', g_interval, 'ms') elif state==3: # blu edit mode b_interval += EDIT_RESOLUTION print('Blu interval:', b_interval, 'ms') if entr.value()==0: r_interval = 300 g_interval = 500 b_interval = 700 print() print('**************************') print('Values RESETTED to DEFAULT') print('--------------------------') print('Red interval:', r_interval, 'ms') print('Grn interval:', g_interval, 'ms') print('Blu interval:', b_interval, 'ms') print('**************************') https://1.bp.blogspot.com/-rYdcCBcd2K0/X26oBPSJclI/AAAAAAAACDc/jXve0NeUYHcXtYScTmdbod5hMptYgfJnwCLcBGAsYHQ/w640-h322/MP_009_Time.png ↩︎ ...

2022-03-07 · 3 min · 442 words · Ben