├── 1.Hardware
└── OpenHeat
│ ├── .gitignore
│ ├── HotBed-24V.PcbDoc
│ ├── Main.SchDoc
│ ├── OpenHeat.PcbDoc
│ ├── OpenHeat.PrjPCB
│ ├── OpenHeat.PrjPCBStructure
│ ├── 控制器-Gerber直接打样
│ ├── OpenHeat-RoundHoles.TXT
│ ├── OpenHeat-SlotHoles.TXT
│ ├── OpenHeat-macro.APR_LIB
│ ├── OpenHeat.DRR
│ ├── OpenHeat.EXTREP
│ ├── OpenHeat.G1
│ ├── OpenHeat.G2
│ ├── OpenHeat.GBL
│ ├── OpenHeat.GBO
│ ├── OpenHeat.GBP
│ ├── OpenHeat.GBS
│ ├── OpenHeat.GD1
│ ├── OpenHeat.GG1
│ ├── OpenHeat.GKO
│ ├── OpenHeat.GM1
│ ├── OpenHeat.GM10
│ ├── OpenHeat.GM12
│ ├── OpenHeat.GM13
│ ├── OpenHeat.GM14
│ ├── OpenHeat.GM15
│ ├── OpenHeat.GPB
│ ├── OpenHeat.GPT
│ ├── OpenHeat.GTL
│ ├── OpenHeat.GTO
│ ├── OpenHeat.GTP
│ ├── OpenHeat.GTS
│ ├── OpenHeat.LDP
│ ├── OpenHeat.REP
│ ├── OpenHeat.RUL
│ ├── OpenHeat.apr
│ └── Status Report.Txt
│ └── 热床-Gerber直接打样铝基板
│ ├── HotBed-24V-macro.APR_LIB
│ ├── HotBed-24V.DRR
│ ├── HotBed-24V.EXTREP
│ ├── HotBed-24V.GBL
│ ├── HotBed-24V.GBO
│ ├── HotBed-24V.GBP
│ ├── HotBed-24V.GBS
│ ├── HotBed-24V.GD1
│ ├── HotBed-24V.GG1
│ ├── HotBed-24V.GKO
│ ├── HotBed-24V.GM1
│ ├── HotBed-24V.GPB
│ ├── HotBed-24V.GPT
│ ├── HotBed-24V.GTL
│ ├── HotBed-24V.GTO
│ ├── HotBed-24V.GTP
│ ├── HotBed-24V.GTS
│ ├── HotBed-24V.LDP
│ ├── HotBed-24V.REP
│ ├── HotBed-24V.RUL
│ ├── HotBed-24V.TXT
│ ├── HotBed-24V.apr
│ └── Status Report.Txt
├── 2.Firmware
└── OpenHeat-fw
│ ├── .gitignore
│ ├── .idea
│ ├── .gitignore
│ ├── OpenHeat-fw.iml
│ ├── deployment.xml
│ ├── encodings.xml
│ ├── misc.xml
│ ├── modules.xml
│ ├── serialmonitor_settings.xml
│ └── vcs.xml
│ ├── CMakeLists.txt
│ ├── include
│ └── README
│ ├── lib
│ ├── OneButton
│ │ ├── .github
│ │ │ └── workflows
│ │ │ │ └── arduino-checks.yml
│ │ ├── .gitignore
│ │ ├── CHANGELOG.md
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── examples
│ │ │ ├── BlinkMachine
│ │ │ │ └── BlinkMachine.ino
│ │ │ ├── InterruptOneButton
│ │ │ │ └── InterruptOneButton.ino
│ │ │ ├── SimpleOneButton
│ │ │ │ └── SimpleOneButton.ino
│ │ │ ├── SpecialInput
│ │ │ │ └── SpecialInput.ino
│ │ │ └── TwoButtons
│ │ │ │ └── TwoButtons.ino
│ │ ├── keywords.txt
│ │ ├── library.json
│ │ ├── library.properties
│ │ └── src
│ │ │ ├── OneButton.cpp
│ │ │ └── OneButton.h
│ ├── PID
│ │ ├── PID_v1.cpp
│ │ ├── PID_v1.h
│ │ ├── README.txt
│ │ ├── examples
│ │ │ ├── PID_AdaptiveTunings
│ │ │ │ └── PID_AdaptiveTunings.ino
│ │ │ ├── PID_Basic
│ │ │ │ └── PID_Basic.ino
│ │ │ ├── PID_PonM
│ │ │ │ └── PID_PonM.ino
│ │ │ └── PID_RelayOutput
│ │ │ │ └── PID_RelayOutput.ino
│ │ ├── keywords.txt
│ │ ├── library.json
│ │ └── library.properties
│ ├── QRCode
│ │ ├── .gitignore
│ │ ├── LICENSE.txt
│ │ ├── README.md
│ │ ├── examples
│ │ │ └── QRCode
│ │ │ │ └── QRCode.ino
│ │ ├── generate_table.py
│ │ ├── keywords.txt
│ │ ├── library.properties
│ │ ├── src
│ │ │ ├── qrcode.c
│ │ │ └── qrcode.h
│ │ └── tests
│ │ │ ├── BitBuffer.cpp
│ │ │ ├── BitBuffer.hpp
│ │ │ ├── QrCode.cpp
│ │ │ ├── QrCode.hpp
│ │ │ ├── QrSegment.cpp
│ │ │ ├── QrSegment.hpp
│ │ │ ├── README.md
│ │ │ ├── run-tests.cpp
│ │ │ └── run.sh
│ ├── README
│ ├── Shell
│ │ ├── README.md
│ │ ├── Shell.c
│ │ ├── Shell.h
│ │ ├── examples
│ │ │ ├── Shell_Basic
│ │ │ │ └── Shell_Basic.ino
│ │ │ ├── Shell_Command_Args
│ │ │ │ └── Shell_Command_Args.ino
│ │ │ ├── Shell_IO_Control
│ │ │ │ └── Shell_IO_Control.ino
│ │ │ ├── Shell_Minimum
│ │ │ │ └── Shell_Minimum.ino
│ │ │ ├── Shell_RGB_Control
│ │ │ │ └── Shell_RGB_Control.ino
│ │ │ └── Shell_Telnet
│ │ │ │ └── Shell_Telnet.ino
│ │ ├── keywords.txt
│ │ ├── library.properties
│ │ └── license.txt
│ └── U8g2
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── examples
│ │ ├── full_buffer
│ │ │ ├── FPS
│ │ │ │ └── FPS.ino
│ │ │ ├── FontUsage
│ │ │ │ └── FontUsage.ino
│ │ │ ├── GraphicsTest
│ │ │ │ └── GraphicsTest.ino
│ │ │ ├── HelloWorld
│ │ │ │ └── HelloWorld.ino
│ │ │ ├── IconMenu
│ │ │ │ └── IconMenu.ino
│ │ │ ├── PrintUTF8
│ │ │ │ └── PrintUTF8.ino
│ │ │ ├── SelectionList
│ │ │ │ └── SelectionList.ino
│ │ │ ├── Shennong
│ │ │ │ └── Shennong.ino
│ │ │ ├── U8g2Logo
│ │ │ │ └── U8g2Logo.ino
│ │ │ ├── UpdateArea
│ │ │ │ └── UpdateArea.ino
│ │ │ └── Weather
│ │ │ │ └── Weather.ino
│ │ ├── games
│ │ │ ├── LittleRookChess
│ │ │ │ └── LittleRookChess.ino
│ │ │ └── SpaceTrash
│ │ │ │ └── SpaceTrash.ino
│ │ ├── page_buffer
│ │ │ ├── A2Printer
│ │ │ │ └── A2Printer.ino
│ │ │ ├── Chinese
│ │ │ │ └── Chinese.ino
│ │ │ ├── ClipWindow
│ │ │ │ └── ClipWindow.ino
│ │ │ ├── Clock
│ │ │ │ └── Clock.ino
│ │ │ ├── ContrastTest
│ │ │ │ └── ContrastTest.ino
│ │ │ ├── Devanagari
│ │ │ │ └── Devanagari.ino
│ │ │ ├── DirectAccess
│ │ │ │ └── DirectAccess.ino
│ │ │ ├── DrawLog
│ │ │ │ └── DrawLog.ino
│ │ │ ├── ExtUTF8
│ │ │ │ └── ExtUTF8.ino
│ │ │ ├── FPS
│ │ │ │ └── FPS.ino
│ │ │ ├── FlipMode
│ │ │ │ └── FlipMode.ino
│ │ │ ├── GraphicsTest
│ │ │ │ └── GraphicsTest.ino
│ │ │ ├── HelloWorld
│ │ │ │ └── HelloWorld.ino
│ │ │ ├── IconMenu
│ │ │ │ └── IconMenu.ino
│ │ │ ├── Japanese
│ │ │ │ └── Japanese.ino
│ │ │ ├── Korean
│ │ │ │ └── Korean.ino
│ │ │ ├── PowerSaveTest
│ │ │ │ └── PowerSaveTest.ino
│ │ │ ├── PrintHelloWorld
│ │ │ │ └── PrintHelloWorld.ino
│ │ │ ├── PrintProgmem
│ │ │ │ └── PrintProgmem.ino
│ │ │ ├── PrintUTF8
│ │ │ │ └── PrintUTF8.ino
│ │ │ ├── ScrollingText
│ │ │ │ └── ScrollingText.ino
│ │ │ ├── SelectionList
│ │ │ │ └── SelectionList.ino
│ │ │ ├── Serial
│ │ │ │ └── Serial.ino
│ │ │ ├── Shennong
│ │ │ │ └── Shennong.ino
│ │ │ ├── StateBufferLoop
│ │ │ │ └── StateBufferLoop.ino
│ │ │ ├── Terminal
│ │ │ │ └── Terminal.ino
│ │ │ ├── U8g2Logo
│ │ │ │ └── U8g2Logo.ino
│ │ │ ├── UpdatePartly
│ │ │ │ └── UpdatePartly.ino
│ │ │ ├── Weather
│ │ │ │ └── Weather.ino
│ │ │ ├── XBM
│ │ │ │ └── XBM.ino
│ │ │ └── XORTest
│ │ │ │ └── XORTest.ino
│ │ └── u8x8
│ │ │ ├── 16x16Font
│ │ │ └── 16x16Font.ino
│ │ │ ├── ArduboyTest
│ │ │ └── ArduboyTest.ino
│ │ │ ├── FlipMode
│ │ │ └── FlipMode.ino
│ │ │ ├── GraphicsTest
│ │ │ └── GraphicsTest.ino
│ │ │ ├── HelloWorld
│ │ │ └── HelloWorld.ino
│ │ │ ├── MessageBox
│ │ │ └── MessageBox.ino
│ │ │ └── Terminal
│ │ │ └── Terminal.ino
│ │ ├── extras
│ │ └── ChangeLog
│ │ ├── keywords.txt
│ │ ├── library.properties
│ │ └── src
│ │ ├── U8g2lib.h
│ │ ├── U8x8lib.cpp
│ │ ├── U8x8lib.h
│ │ └── clib
│ │ ├── u8g2.h
│ │ ├── u8g2_bitmap.c
│ │ ├── u8g2_box.c
│ │ ├── u8g2_buffer.c
│ │ ├── u8g2_circle.c
│ │ ├── u8g2_cleardisplay.c
│ │ ├── u8g2_d_memory.c
│ │ ├── u8g2_d_setup.c
│ │ ├── u8g2_font.c
│ │ ├── u8g2_fonts.c
│ │ ├── u8g2_hvline.c
│ │ ├── u8g2_input_value.c
│ │ ├── u8g2_intersection.c
│ │ ├── u8g2_kerning.c
│ │ ├── u8g2_line.c
│ │ ├── u8g2_ll_hvline.c
│ │ ├── u8g2_message.c
│ │ ├── u8g2_polygon.c
│ │ ├── u8g2_selection_list.c
│ │ ├── u8g2_setup.c
│ │ ├── u8log.c
│ │ ├── u8log_u8g2.c
│ │ ├── u8log_u8x8.c
│ │ ├── u8x8.h
│ │ ├── u8x8_8x8.c
│ │ ├── u8x8_byte.c
│ │ ├── u8x8_cad.c
│ │ ├── u8x8_capture.c
│ │ ├── u8x8_d_a2printer.c
│ │ ├── u8x8_d_il3820_296x128.c
│ │ ├── u8x8_d_ist3020.c
│ │ ├── u8x8_d_ist7920.c
│ │ ├── u8x8_d_ks0108.c
│ │ ├── u8x8_d_lc7981.c
│ │ ├── u8x8_d_ld7032_60x32.c
│ │ ├── u8x8_d_ls013b7dh03.c
│ │ ├── u8x8_d_max7219.c
│ │ ├── u8x8_d_pcd8544_84x48.c
│ │ ├── u8x8_d_pcf8812.c
│ │ ├── u8x8_d_pcf8814_hx1230.c
│ │ ├── u8x8_d_s1d15721.c
│ │ ├── u8x8_d_s1d15e06.c
│ │ ├── u8x8_d_sbn1661.c
│ │ ├── u8x8_d_sed1330.c
│ │ ├── u8x8_d_sh1106_64x32.c
│ │ ├── u8x8_d_sh1106_72x40.c
│ │ ├── u8x8_d_sh1107.c
│ │ ├── u8x8_d_sh1108.c
│ │ ├── u8x8_d_sh1122.c
│ │ ├── u8x8_d_ssd1305.c
│ │ ├── u8x8_d_ssd1306_128x32.c
│ │ ├── u8x8_d_ssd1306_128x64_noname.c
│ │ ├── u8x8_d_ssd1306_128x80_noname.c
│ │ ├── u8x8_d_ssd1306_2040x16.c
│ │ ├── u8x8_d_ssd1306_48x64.c
│ │ ├── u8x8_d_ssd1306_64x32.c
│ │ ├── u8x8_d_ssd1306_64x48.c
│ │ ├── u8x8_d_ssd1306_72x40.c
│ │ ├── u8x8_d_ssd1306_96x16.c
│ │ ├── u8x8_d_ssd1309.c
│ │ ├── u8x8_d_ssd1316.c
│ │ ├── u8x8_d_ssd1317.c
│ │ ├── u8x8_d_ssd1318.c
│ │ ├── u8x8_d_ssd1320.c
│ │ ├── u8x8_d_ssd1322.c
│ │ ├── u8x8_d_ssd1325.c
│ │ ├── u8x8_d_ssd1326.c
│ │ ├── u8x8_d_ssd1327.c
│ │ ├── u8x8_d_ssd1329.c
│ │ ├── u8x8_d_ssd1606_172x72.c
│ │ ├── u8x8_d_ssd1607_200x200.c
│ │ ├── u8x8_d_st7511.c
│ │ ├── u8x8_d_st75256.c
│ │ ├── u8x8_d_st7528.c
│ │ ├── u8x8_d_st75320.c
│ │ ├── u8x8_d_st7565.c
│ │ ├── u8x8_d_st7567.c
│ │ ├── u8x8_d_st7571.c
│ │ ├── u8x8_d_st7586s_erc240160.c
│ │ ├── u8x8_d_st7586s_s028hn118a.c
│ │ ├── u8x8_d_st7586s_ymc240160.c
│ │ ├── u8x8_d_st7588.c
│ │ ├── u8x8_d_st7920.c
│ │ ├── u8x8_d_stdio.c
│ │ ├── u8x8_d_t6963.c
│ │ ├── u8x8_d_uc1601.c
│ │ ├── u8x8_d_uc1604.c
│ │ ├── u8x8_d_uc1608.c
│ │ ├── u8x8_d_uc1610.c
│ │ ├── u8x8_d_uc1611.c
│ │ ├── u8x8_d_uc1617.c
│ │ ├── u8x8_d_uc1638.c
│ │ ├── u8x8_d_uc1701_dogs102.c
│ │ ├── u8x8_d_uc1701_mini12864.c
│ │ ├── u8x8_debounce.c
│ │ ├── u8x8_display.c
│ │ ├── u8x8_fonts.c
│ │ ├── u8x8_gpio.c
│ │ ├── u8x8_input_value.c
│ │ ├── u8x8_message.c
│ │ ├── u8x8_selection_list.c
│ │ ├── u8x8_setup.c
│ │ ├── u8x8_string.c
│ │ ├── u8x8_u16toa.c
│ │ └── u8x8_u8toa.c
│ ├── platformio.ini
│ ├── src
│ ├── BLE.cpp
│ ├── BLE.h
│ ├── Beep.cpp
│ ├── Beep.h
│ ├── Bezier.cpp
│ ├── Bezier.h
│ ├── Bitmap.cpp
│ ├── Bitmap.h
│ ├── Calibration.cpp
│ ├── Calibration.h
│ ├── Event.cpp
│ ├── Event.h
│ ├── ExternDraw.cpp
│ ├── ExternDraw.h
│ ├── FilesSystem.cpp
│ ├── FilesSystem.h
│ ├── MathFun.cpp
│ ├── MathFun.h
│ ├── Menu.cpp
│ ├── Menu.h
│ ├── MyShell.cpp
│ ├── MyShell.h
│ ├── OpenT12.h
│ ├── Rotary.cpp
│ ├── Rotary.h
│ ├── TipControl.cpp
│ ├── TipControl.h
│ ├── TipManager.cpp
│ ├── TipManager.h
│ ├── Type.h
│ ├── main.cpp
│ ├── serial_putc.cpp
│ └── serial_putc.h
│ └── test
│ └── README
├── 3.Docs
├── 1.Images
│ ├── 1.jpg
│ ├── 2.jpg
│ ├── 3.jpg
│ ├── 4.jpg
│ ├── 5.jpg
│ ├── BUG.png
│ └── 接线说明.png
└── 2.Datasheet
│ ├── ESP32-PICO-D4_cn.pdf
│ ├── MAX6675ISA.pdf
│ └── NTMFS5C628NLT.pdf
└── README.md
/1.Hardware/OpenHeat/.gitignore:
--------------------------------------------------------------------------------
1 | History
2 | Project Logs for*
3 | __Previews
--------------------------------------------------------------------------------
/1.Hardware/OpenHeat/HotBed-24V.PcbDoc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peng-zhihui/OpenHeat/db5a055e7a26242cbcab9cbef24936952850b85a/1.Hardware/OpenHeat/HotBed-24V.PcbDoc
--------------------------------------------------------------------------------
/1.Hardware/OpenHeat/Main.SchDoc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peng-zhihui/OpenHeat/db5a055e7a26242cbcab9cbef24936952850b85a/1.Hardware/OpenHeat/Main.SchDoc
--------------------------------------------------------------------------------
/1.Hardware/OpenHeat/OpenHeat.PcbDoc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peng-zhihui/OpenHeat/db5a055e7a26242cbcab9cbef24936952850b85a/1.Hardware/OpenHeat/OpenHeat.PcbDoc
--------------------------------------------------------------------------------
/1.Hardware/OpenHeat/OpenHeat.PrjPCBStructure:
--------------------------------------------------------------------------------
1 | Record=TopLevelDocument|FileName=Main.SchDoc|SheetNumber=
2 |
--------------------------------------------------------------------------------
/1.Hardware/OpenHeat/控制器-Gerber直接打样/OpenHeat-RoundHoles.TXT:
--------------------------------------------------------------------------------
1 | M48
2 | ;Layer_Color=9474304
3 | ;FILE_FORMAT=2:5
4 | INCH,TZ
5 | ;TYPE=PLATED
6 | T1F00S00C0.01000
7 | T2F00S00C0.01968
8 | T4F00S00C0.02559
9 | T5F00S00C0.06299
10 | T6F00S00C0.11811
11 | %
12 | T01
13 | X21500Y3000
14 | X23500Y13000
15 | X30000Y14000
16 | Y11500
17 | X33000
18 | X36000
19 | X39000
20 | X42000
21 | X49100Y12700
22 | X51800
23 | X66000Y13000
24 | X62000Y7000
25 | Y4500
26 | Y2000
27 | X71900Y6000
28 | X82000
29 | X103800Y6700
30 | X107000Y6600
31 | X119600Y7500
32 | X119400Y12800
33 | X123000Y9700
34 | X126500
35 | X130100
36 | X137100
37 | X140600
38 | X144100
39 | X147600
40 | X153200Y11600
41 | X155700
42 | X137100Y5400
43 | X126500Y5500
44 | X127500Y17500
45 | X125000
46 | Y20000
47 | Y22500
48 | Y25000
49 | Y27500
50 | X122500
51 | Y25000
52 | Y22500
53 | Y20000
54 | X118900Y19700
55 | X119500Y22500
56 | Y25000
57 | Y27500
58 | X116500
59 | Y25000
60 | Y22500
61 | Y17500
62 | X107500Y17000
63 | X104700Y20700
64 | X101500Y19500
65 | X100500Y16500
66 | X88059Y20141
67 | X84500Y20000
68 | X82000
69 | X78800Y19800
70 | X64500Y15000
71 | X45500Y25000
72 | Y29000
73 | X49500
74 | Y33000
75 | X45500
76 | X54700Y38900
77 | X56900Y47100
78 | X61000Y50000
79 | X58000Y54000
80 | Y57000
81 | X54300Y53400
82 | X47400Y52900
83 | X45000Y53200
84 | X48850Y50000
85 | X46900Y46900
86 | X43600Y47000
87 | X46500Y64500
88 | Y68000
89 | X59000Y69500
90 | Y72500
91 | X58500Y65000
92 | X65000Y63900
93 | Y66400
94 | X72000Y66500
95 | X75000
96 | Y69500
97 | X72000
98 | Y72500
99 | X75000
100 | X78500
101 | Y69500
102 | Y66500
103 | X82000
104 | X85000
105 | Y69500
106 | X82000
107 | Y72500
108 | X85000
109 | X83000Y60000
110 | Y57500
111 | Y55000
112 | Y52500
113 | X86100Y51200
114 | X85900Y45500
115 | Y42800
116 | X87900Y39400
117 | X90200
118 | X92600
119 | X95300Y47400
120 | X105500Y48500
121 | X108000
122 | Y51000
123 | X105500
124 | Y53500
125 | Y56000
126 | Y58500
127 | Y61000
128 | Y63500
129 | X102500
130 | Y61000
131 | Y58500
132 | X113500Y51800
133 | X113000Y42000
134 | Y39500
135 | X115400Y39000
136 | X124000Y39445
137 | Y41945
138 | Y44445
139 | Y46945
140 | Y49445
141 | X126500
142 | X129000
143 | Y46945
144 | X126500
145 | Y44445
146 | X129000
147 | Y41945
148 | X126500
149 | Y39445
150 | X129000
151 | Y56500
152 | X126500
153 | Y59000
154 | X129000
155 | Y61500
156 | X126500
157 | X124000
158 | Y59000
159 | Y64000
160 | X126500
161 | X129000
162 | Y66500
163 | X126500
164 | X124000
165 | Y69000
166 | X126500
167 | X129000
168 | Y71500
169 | X126500
170 | X124000
171 | X104700Y40400
172 | Y38200
173 | X92500Y28000
174 | Y25500
175 | X75500Y41500
176 | X72200Y40500
177 | X68500Y40200
178 | X67500Y44900
179 | X64500Y44500
180 | X61900Y42100
181 | X71600Y44900
182 | X75760Y51260
183 | X77000Y55000
184 | X80000
185 | X68500Y54750
186 | Y57200
187 | X159000Y55500
188 | Y52500
189 | Y49500
190 | X161000Y44000
191 | X165000Y29000
192 | Y26500
193 | Y24000
194 | X162500
195 | X171000Y24500
196 | X169500Y32000
197 | X127500Y20000
198 | X41500Y25000
199 | Y29000
200 | Y33000
201 | X42500Y38800
202 | X37600Y43600
203 | X35300Y45000
204 | X31800Y46100
205 | X33000Y40100
206 | X30000Y40000
207 | Y36900
208 | X26500Y23700
209 | X24000Y25000
210 | X23500Y19000
211 | Y16000
212 | X30000Y16500
213 | X20000Y45400
214 | X16000Y46500
215 | X15100Y49500
216 | X7000Y48500
217 | Y41000
218 | Y56500
219 | X16200Y57700
220 | X19800Y59000
221 | X14000Y61000
222 | X12000Y65900
223 | Y68400
224 | X29600Y66700
225 | X31400Y62500
226 | X33700Y55300
227 | X33000Y52500
228 | X37000Y50000
229 | X40100Y46800
230 | X42500Y64500
231 | Y68000
232 | X41100Y76400
233 | X28500Y74600
234 | T02
235 | X58500Y84000
236 | X63500
237 | X68500
238 | X73500
239 | X78500
240 | X83500
241 | Y90000
242 | X78500
243 | X73500
244 | X68500
245 | X63500
246 | X58500
247 | Y96000
248 | X63500
249 | X68500
250 | X73500
251 | X78500
252 | X83500
253 | X106500
254 | X111500
255 | X116500
256 | X121500
257 | X126500
258 | X131500
259 | Y90000
260 | X126500
261 | X121500
262 | X116500
263 | X111500
264 | X106500
265 | Y84000
266 | X111500
267 | X116500
268 | X121500
269 | X126500
270 | X131500
271 | X135500Y71000
272 | X140500
273 | X145500
274 | Y65000
275 | X140500
276 | X135500
277 | Y57000
278 | X140500
279 | X145500
280 | Y49000
281 | X140500
282 | X135500
283 | Y43000
284 | X140500
285 | X145500
286 | Y17000
287 | X140500
288 | X135500
289 | X144500Y77000
290 | X149500
291 | X154500
292 | Y83000
293 | X159500
294 | Y89000
295 | X154500
296 | X149500
297 | Y83000
298 | Y95000
299 | X154500
300 | X159500
301 | X41500Y96000
302 | X36500
303 | X31500
304 | Y90000
305 | X36500
306 | X41500
307 | Y84000
308 | X36500
309 | X31500
310 | T04
311 | X18858Y40122
312 | Y62878
313 | T05
314 | X166783Y38189
315 | Y61811
316 | T06
317 | X11500Y11500
318 | X189500
319 | Y91000
320 | X11500
321 | M30
322 |
--------------------------------------------------------------------------------
/1.Hardware/OpenHeat/控制器-Gerber直接打样/OpenHeat-SlotHoles.TXT:
--------------------------------------------------------------------------------
1 | M48
2 | ;Layer_Color=9474304
3 | ;FILE_FORMAT=2:5
4 | INCH,TZ
5 | ;TYPE=PLATED
6 | T3F00S00C0.02362
7 | %
8 | G90
9 | G05
10 | T03
11 | G00X3898Y34472
12 | M15
13 | G01X6260
14 | M16
15 | G00X18661Y34472
16 | M15
17 | G01X22992
18 | M16
19 | G00X18661Y68528
20 | M15
21 | G01X22992
22 | M16
23 | G00X3898Y68528
24 | M15
25 | G01X6260
26 | M16
27 | M17
28 | M30
29 |
--------------------------------------------------------------------------------
/1.Hardware/OpenHeat/控制器-Gerber直接打样/OpenHeat.DRR:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peng-zhihui/OpenHeat/db5a055e7a26242cbcab9cbef24936952850b85a/1.Hardware/OpenHeat/控制器-Gerber直接打样/OpenHeat.DRR
--------------------------------------------------------------------------------
/1.Hardware/OpenHeat/控制器-Gerber直接打样/OpenHeat.EXTREP:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peng-zhihui/OpenHeat/db5a055e7a26242cbcab9cbef24936952850b85a/1.Hardware/OpenHeat/控制器-Gerber直接打样/OpenHeat.EXTREP
--------------------------------------------------------------------------------
/1.Hardware/OpenHeat/控制器-Gerber直接打样/OpenHeat.GKO:
--------------------------------------------------------------------------------
1 | G04*
2 | G04 #@! TF.GenerationSoftware,Altium Limited,Altium Designer,21.6.1 (37)*
3 | G04*
4 | G04 Layer_Color=16711935*
5 | %FSLAX25Y25*%
6 | %MOIN*%
7 | G70*
8 | G04*
9 | G04 #@! TF.SameCoordinates,AC7CD038-FE90-4222-8F95-758E89F8CD36*
10 | G04*
11 | G04*
12 | G04 #@! TF.FilePolarity,Positive*
13 | G04*
14 | G01*
15 | G75*
16 | %ADD10C,0.01000*%
17 | D10*
18 | X201000Y77900D02*
19 | G03*
20 | X201000Y22100I193603J-27900D01*
21 | G01*
22 | X0Y11500D02*
23 | G03*
24 | X11500Y0I11500J0D01*
25 | G01*
26 | Y102500D02*
27 | G03*
28 | X0Y91000I0J-11500D01*
29 | G01*
30 | X189500Y0D02*
31 | G03*
32 | X201000Y11500I0J11500D01*
33 | G01*
34 | Y91000D02*
35 | G03*
36 | X189500Y102500I-11500J0D01*
37 | G01*
38 | X201000Y77900D02*
39 | Y91000D01*
40 | Y11500D02*
41 | Y22100D01*
42 | X11500Y0D02*
43 | X189500D01*
44 | X0Y11500D02*
45 | Y91000D01*
46 | X11500Y102500D02*
47 | X189500D01*
48 | M02*
49 |
--------------------------------------------------------------------------------
/1.Hardware/OpenHeat/控制器-Gerber直接打样/OpenHeat.GM1:
--------------------------------------------------------------------------------
1 | G04*
2 | G04 #@! TF.GenerationSoftware,Altium Limited,Altium Designer,21.6.1 (37)*
3 | G04*
4 | G04 Layer_Color=16711935*
5 | %FSLAX25Y25*%
6 | %MOIN*%
7 | G70*
8 | G04*
9 | G04 #@! TF.SameCoordinates,AC7CD038-FE90-4222-8F95-758E89F8CD36*
10 | G04*
11 | G04*
12 | G04 #@! TF.FilePolarity,Positive*
13 | G04*
14 | G01*
15 | G75*
16 | %ADD10C,0.01000*%
17 | %ADD107C,0.00000*%
18 | D10*
19 | X201000Y77900D02*
20 | G03*
21 | X201000Y22100I193352J-27900D01*
22 | G01*
23 | X11500Y102500D02*
24 | G03*
25 | X0Y91000I0J-11500D01*
26 | G01*
27 | X201000D02*
28 | G03*
29 | X189500Y102500I-11500J0D01*
30 | G01*
31 | Y0D02*
32 | G03*
33 | X201000Y11500I0J11500D01*
34 | G01*
35 | X0D02*
36 | G03*
37 | X11500Y0I11500J0D01*
38 | G01*
39 | X201000Y77900D02*
40 | Y91000D01*
41 | Y11500D02*
42 | Y22100D01*
43 | X11500Y102500D02*
44 | X189500D01*
45 | X0Y11500D02*
46 | Y91000D01*
47 | X11500Y0D02*
48 | X189500D01*
49 | D107*
50 | X35150Y55550D02*
51 | Y75250D01*
52 | Y55550D02*
53 | X54850D01*
54 | Y75250D01*
55 | X35150D02*
56 | X54850D01*
57 | Y58894D02*
58 | Y60094D01*
59 | Y58894D02*
60 | Y60094D01*
61 | Y60863D02*
62 | Y62063D01*
63 | Y60863D02*
64 | Y62063D01*
65 | Y62831D02*
66 | Y64031D01*
67 | Y62831D02*
68 | Y64031D01*
69 | Y64800D02*
70 | Y66000D01*
71 | Y64800D02*
72 | Y66000D01*
73 | Y66768D02*
74 | Y67968D01*
75 | Y66768D02*
76 | Y67968D01*
77 | Y68737D02*
78 | Y69937D01*
79 | Y68737D02*
80 | Y69937D01*
81 | Y70705D02*
82 | Y71905D01*
83 | Y70705D02*
84 | Y71905D01*
85 | X50305Y75250D02*
86 | X51506D01*
87 | X50305D02*
88 | X51506D01*
89 | X48337D02*
90 | X49537D01*
91 | X48337D02*
92 | X49537D01*
93 | X46369D02*
94 | X47569D01*
95 | X46369D02*
96 | X47569D01*
97 | X44400D02*
98 | X45600D01*
99 | X44400D02*
100 | X45600D01*
101 | X42432D02*
102 | X43632D01*
103 | X42432D02*
104 | X43632D01*
105 | X40463D02*
106 | X41663D01*
107 | X40463D02*
108 | X41663D01*
109 | X38495D02*
110 | X39694D01*
111 | X38495D02*
112 | X39694D01*
113 | X35150Y70705D02*
114 | Y71905D01*
115 | Y70705D02*
116 | Y71905D01*
117 | Y68737D02*
118 | Y69937D01*
119 | Y68737D02*
120 | Y69937D01*
121 | Y66768D02*
122 | Y67968D01*
123 | Y66768D02*
124 | Y67968D01*
125 | Y64800D02*
126 | Y66000D01*
127 | Y64800D02*
128 | Y66000D01*
129 | Y62831D02*
130 | Y64031D01*
131 | Y62831D02*
132 | Y64031D01*
133 | Y60863D02*
134 | Y62063D01*
135 | Y60863D02*
136 | Y62063D01*
137 | Y58894D02*
138 | Y60094D01*
139 | Y58894D02*
140 | Y60094D01*
141 | X38495Y55550D02*
142 | X39694D01*
143 | X38495D02*
144 | X39694D01*
145 | X40463D02*
146 | X41663D01*
147 | X40463D02*
148 | X41663D01*
149 | X42432D02*
150 | X43632D01*
151 | X42432D02*
152 | X43632D01*
153 | X44400D02*
154 | X45600D01*
155 | X44400D02*
156 | X45600D01*
157 | X46369D02*
158 | X47569D01*
159 | X46369D02*
160 | X47569D01*
161 | X48337D02*
162 | X49537D01*
163 | X48337D02*
164 | X49537D01*
165 | X50305D02*
166 | X51506D01*
167 | X50305D02*
168 | X51506D01*
169 | M02*
170 |
--------------------------------------------------------------------------------
/1.Hardware/OpenHeat/控制器-Gerber直接打样/OpenHeat.GM10:
--------------------------------------------------------------------------------
1 | G04*
2 | G04 #@! TF.GenerationSoftware,Altium Limited,Altium Designer,21.6.1 (37)*
3 | G04*
4 | G04 Layer_Color=8388736*
5 | %FSLAX25Y25*%
6 | %MOIN*%
7 | G70*
8 | G04*
9 | G04 #@! TF.SameCoordinates,AC7CD038-FE90-4222-8F95-758E89F8CD36*
10 | G04*
11 | G04*
12 | G04 #@! TF.FilePolarity,Positive*
13 | G04*
14 | G01*
15 | G75*
16 | %ADD104C,0.00787*%
17 | D104*
18 | X28224Y52260D02*
19 | Y59740D01*
20 | X18776D02*
21 | X28224D01*
22 | X18776Y52260D02*
23 | Y59740D01*
24 | Y52260D02*
25 | X28224D01*
26 | X93012Y40063D02*
27 | Y47937D01*
28 | X81988Y40063D02*
29 | X93012D01*
30 | X81988D02*
31 | Y47937D01*
32 | X93012D01*
33 | X69209Y61850D02*
34 | X97791D01*
35 | Y78150D01*
36 | X69209D02*
37 | X97791D01*
38 | X69209Y61850D02*
39 | Y78150D01*
40 | M02*
41 |
--------------------------------------------------------------------------------
/1.Hardware/OpenHeat/控制器-Gerber直接打样/OpenHeat.GM12:
--------------------------------------------------------------------------------
1 | G04*
2 | G04 #@! TF.GenerationSoftware,Altium Limited,Altium Designer,21.6.1 (37)*
3 | G04*
4 | G04 Layer_Color=32896*
5 | %FSLAX25Y25*%
6 | %MOIN*%
7 | G70*
8 | G04*
9 | G04 #@! TF.SameCoordinates,AC7CD038-FE90-4222-8F95-758E89F8CD36*
10 | G04*
11 | G04*
12 | G04 #@! TF.FilePolarity,Positive*
13 | G04*
14 | G01*
15 | G75*
16 | %ADD104C,0.00787*%
17 | %ADD108C,0.00591*%
18 | D104*
19 | X91831Y40457D02*
20 | Y47543D01*
21 | X83169Y40457D02*
22 | X91831D01*
23 | X83169D02*
24 | Y47543D01*
25 | X91831D01*
26 | X74150Y62244D02*
27 | X92850D01*
28 | Y77756D01*
29 | X74150D02*
30 | X92850D01*
31 | X74150Y62244D02*
32 | Y77756D01*
33 | D108*
34 | X25961Y52653D02*
35 | Y59346D01*
36 | X21039D02*
37 | X25961D01*
38 | X21039Y52653D02*
39 | Y59346D01*
40 | Y52653D02*
41 | X25961D01*
42 | M02*
43 |
--------------------------------------------------------------------------------
/1.Hardware/OpenHeat/控制器-Gerber直接打样/OpenHeat.GM15:
--------------------------------------------------------------------------------
1 | G04*
2 | G04 #@! TF.GenerationSoftware,Altium Limited,Altium Designer,21.6.1 (37)*
3 | G04*
4 | G04 Layer_Color=32768*
5 | %FSLAX25Y25*%
6 | %MOIN*%
7 | G70*
8 | G04*
9 | G04 #@! TF.SameCoordinates,AC7CD038-FE90-4222-8F95-758E89F8CD36*
10 | G04*
11 | G04*
12 | G04 #@! TF.FilePolarity,Positive*
13 | G04*
14 | G01*
15 | G75*
16 | %ADD104C,0.00787*%
17 | %ADD109C,0.00394*%
18 | D104*
19 | X28224Y52260D02*
20 | Y59740D01*
21 | X18776D02*
22 | X28224D01*
23 | X18776Y52260D02*
24 | Y59740D01*
25 | Y52260D02*
26 | X28224D01*
27 | X93012Y40063D02*
28 | Y47937D01*
29 | X81988Y40063D02*
30 | X93012D01*
31 | X81988D02*
32 | Y47937D01*
33 | X93012D01*
34 | X69209Y61850D02*
35 | X97791D01*
36 | Y78150D01*
37 | X69209D02*
38 | X97791D01*
39 | X69209Y61850D02*
40 | Y78150D01*
41 | D109*
42 | X119535Y-524D02*
43 | Y23000D01*
44 | X86465Y-524D02*
45 | Y23000D01*
46 | X119535D01*
47 | X86465Y-524D02*
48 | X119535D01*
49 | X101031Y10500D02*
50 | X104969D01*
51 | X103000Y8531D02*
52 | Y12468D01*
53 | X114000Y27500D02*
54 | Y29500D01*
55 | X113000Y28500D02*
56 | X115000D01*
57 | X107000Y22000D02*
58 | Y35000D01*
59 | X121000Y22000D02*
60 | Y35000D01*
61 | X107000Y22000D02*
62 | X121000D01*
63 | X107000Y35000D02*
64 | X121000D01*
65 | X23500Y54031D02*
66 | Y57968D01*
67 | X21531Y56000D02*
68 | X25469D01*
69 | X87500Y42031D02*
70 | Y45968D01*
71 | X85532Y44000D02*
72 | X89468D01*
73 | X89500Y25532D02*
74 | Y29469D01*
75 | X87532Y27500D02*
76 | X91469D01*
77 | X81500Y20413D02*
78 | X97500D01*
79 | X81500Y34587D02*
80 | X97500D01*
81 | X81500Y20413D02*
82 | Y34587D01*
83 | X97500Y20413D02*
84 | Y34587D01*
85 | X83000Y53031D02*
86 | Y56968D01*
87 | X81032Y55000D02*
88 | X84969D01*
89 | X73748Y63071D02*
90 | X92252D01*
91 | X73748Y46929D02*
92 | X92252D01*
93 | Y63071D01*
94 | X73748Y46929D02*
95 | Y63071D01*
96 | X81532Y70000D02*
97 | X85469D01*
98 | X83500Y68032D02*
99 | Y71969D01*
100 | M02*
101 |
--------------------------------------------------------------------------------
/1.Hardware/OpenHeat/控制器-Gerber直接打样/OpenHeat.GPT:
--------------------------------------------------------------------------------
1 | G04*
2 | G04 #@! TF.GenerationSoftware,Altium Limited,Altium Designer,21.6.1 (37)*
3 | G04*
4 | G04 Layer_Color=255*
5 | %FSLAX25Y25*%
6 | %MOIN*%
7 | G70*
8 | G04*
9 | G04 #@! TF.SameCoordinates,AC7CD038-FE90-4222-8F95-758E89F8CD36*
10 | G04*
11 | G04*
12 | G04 #@! TF.FilePolarity,Positive*
13 | G04*
14 | G01*
15 | G75*
16 | G04:AMPARAMS|DCode=12|XSize=15.75mil|YSize=137.8mil|CornerRadius=3.94mil|HoleSize=0mil|Usage=FLASHONLY|Rotation=0.000|XOffset=0mil|YOffset=0mil|HoleType=Round|Shape=RoundedRectangle|*
17 | %AMROUNDEDRECTD12*
18 | 21,1,0.01575,0.12992,0,0,0.0*
19 | 21,1,0.00787,0.13780,0,0,0.0*
20 | 1,1,0.00787,0.00394,-0.06496*
21 | 1,1,0.00787,-0.00394,-0.06496*
22 | 1,1,0.00787,-0.00394,0.06496*
23 | 1,1,0.00787,0.00394,0.06496*
24 | %
25 | %ADD12ROUNDEDRECTD12*%
26 | G04:AMPARAMS|DCode=13|XSize=59.06mil|YSize=11.81mil|CornerRadius=2.95mil|HoleSize=0mil|Usage=FLASHONLY|Rotation=0.000|XOffset=0mil|YOffset=0mil|HoleType=Round|Shape=RoundedRectangle|*
27 | %AMROUNDEDRECTD13*
28 | 21,1,0.05906,0.00591,0,0,0.0*
29 | 21,1,0.05315,0.01181,0,0,0.0*
30 | 1,1,0.00591,0.02657,-0.00295*
31 | 1,1,0.00591,-0.02657,-0.00295*
32 | 1,1,0.00591,-0.02657,0.00295*
33 | 1,1,0.00591,0.02657,0.00295*
34 | %
35 | %ADD13ROUNDEDRECTD13*%
36 | %ADD26C,0.19685*%
37 | %ADD27O,0.08268X0.03937*%
38 | %ADD28O,0.06299X0.03937*%
39 | %ADD29C,0.02559*%
40 | D12*
41 | X63256Y29000D02*
42 | D03*
43 | X66012D02*
44 | D03*
45 | X71524D02*
46 | D03*
47 | X74279D02*
48 | D03*
49 | X79791D02*
50 | D03*
51 | X82547D02*
52 | D03*
53 | X88059D02*
54 | D03*
55 | X90815D02*
56 | D03*
57 | X96327D02*
58 | D03*
59 | X99083D02*
60 | D03*
61 | X101839D02*
62 | D03*
63 | X104595D02*
64 | D03*
65 | X110106D02*
66 | D03*
67 | X112862D02*
68 | D03*
69 | X118374D02*
70 | D03*
71 | X121130D02*
72 | D03*
73 | X126642D02*
74 | D03*
75 | X129398D02*
76 | D03*
77 | X134909D02*
78 | D03*
79 | X137665D02*
80 | D03*
81 | X60500D02*
82 | D03*
83 | X68768D02*
84 | D03*
85 | X77035D02*
86 | D03*
87 | X85303D02*
88 | D03*
89 | X93571D02*
90 | D03*
91 | X107350D02*
92 | D03*
93 | X115618D02*
94 | D03*
95 | X123886D02*
96 | D03*
97 | X132153D02*
98 | D03*
99 | X140421D02*
100 | D03*
101 | D13*
102 | X24921Y64689D02*
103 | D03*
104 | Y63508D02*
105 | D03*
106 | Y61539D02*
107 | D03*
108 | Y60358D02*
109 | D03*
110 | Y58390D02*
111 | D03*
112 | Y56421D02*
113 | D03*
114 | Y54453D02*
115 | D03*
116 | Y52484D02*
117 | D03*
118 | Y50516D02*
119 | D03*
120 | Y48547D02*
121 | D03*
122 | Y46579D02*
123 | D03*
124 | Y44610D02*
125 | D03*
126 | Y42642D02*
127 | D03*
128 | Y41461D02*
129 | D03*
130 | Y39492D02*
131 | D03*
132 | Y38311D02*
133 | D03*
134 | D26*
135 | X11500Y11500D02*
136 | D03*
137 | Y91000D02*
138 | D03*
139 | X189500D02*
140 | D03*
141 | Y11500D02*
142 | D03*
143 | D27*
144 | X20827Y68528D02*
145 | D03*
146 | Y34472D02*
147 | D03*
148 | D28*
149 | X5079Y68528D02*
150 | D03*
151 | Y34472D02*
152 | D03*
153 | D29*
154 | X18858Y40122D02*
155 | D03*
156 | Y62878D02*
157 | D03*
158 | M02*
159 |
--------------------------------------------------------------------------------
/1.Hardware/OpenHeat/控制器-Gerber直接打样/OpenHeat.GTO:
--------------------------------------------------------------------------------
1 | G04*
2 | G04 #@! TF.GenerationSoftware,Altium Limited,Altium Designer,21.6.1 (37)*
3 | G04*
4 | G04 Layer_Color=65535*
5 | %FSLAX25Y25*%
6 | %MOIN*%
7 | G70*
8 | G04*
9 | G04 #@! TF.SameCoordinates,AC7CD038-FE90-4222-8F95-758E89F8CD36*
10 | G04*
11 | G04*
12 | G04 #@! TF.FilePolarity,Positive*
13 | G04*
14 | G01*
15 | G75*
16 | %ADD10C,0.01000*%
17 | %ADD11C,0.00800*%
18 | D10*
19 | X33500Y99000D02*
20 | X167500D01*
21 | X33500Y8500D02*
22 | Y99000D01*
23 | X167500Y8500D02*
24 | Y99000D01*
25 | X33500Y8500D02*
26 | X167500D01*
27 | D11*
28 | X-5158Y34472D02*
29 | Y68528D01*
30 | X860D01*
31 | X8860Y68500D02*
32 | X15860D01*
33 | X-5158Y34472D02*
34 | X860D01*
35 | X8860Y34500D02*
36 | X15860D01*
37 | M02*
38 |
--------------------------------------------------------------------------------
/1.Hardware/OpenHeat/控制器-Gerber直接打样/OpenHeat.GTP:
--------------------------------------------------------------------------------
1 | G04*
2 | G04 #@! TF.GenerationSoftware,Altium Limited,Altium Designer,21.6.1 (37)*
3 | G04*
4 | G04 Layer_Color=8421504*
5 | %FSLAX25Y25*%
6 | %MOIN*%
7 | G70*
8 | G04*
9 | G04 #@! TF.SameCoordinates,AC7CD038-FE90-4222-8F95-758E89F8CD36*
10 | G04*
11 | G04*
12 | G04 #@! TF.FilePolarity,Positive*
13 | G04*
14 | G01*
15 | G75*
16 | G04:AMPARAMS|DCode=12|XSize=15.75mil|YSize=137.8mil|CornerRadius=3.94mil|HoleSize=0mil|Usage=FLASHONLY|Rotation=0.000|XOffset=0mil|YOffset=0mil|HoleType=Round|Shape=RoundedRectangle|*
17 | %AMROUNDEDRECTD12*
18 | 21,1,0.01575,0.12992,0,0,0.0*
19 | 21,1,0.00787,0.13780,0,0,0.0*
20 | 1,1,0.00787,0.00394,-0.06496*
21 | 1,1,0.00787,-0.00394,-0.06496*
22 | 1,1,0.00787,-0.00394,0.06496*
23 | 1,1,0.00787,0.00394,0.06496*
24 | %
25 | %ADD12ROUNDEDRECTD12*%
26 | G04:AMPARAMS|DCode=13|XSize=59.06mil|YSize=11.81mil|CornerRadius=2.95mil|HoleSize=0mil|Usage=FLASHONLY|Rotation=0.000|XOffset=0mil|YOffset=0mil|HoleType=Round|Shape=RoundedRectangle|*
27 | %AMROUNDEDRECTD13*
28 | 21,1,0.05906,0.00591,0,0,0.0*
29 | 21,1,0.05315,0.01181,0,0,0.0*
30 | 1,1,0.00591,0.02657,-0.00295*
31 | 1,1,0.00591,-0.02657,-0.00295*
32 | 1,1,0.00591,-0.02657,0.00295*
33 | 1,1,0.00591,0.02657,0.00295*
34 | %
35 | %ADD13ROUNDEDRECTD13*%
36 | D12*
37 | X63256Y29000D02*
38 | D03*
39 | X66012D02*
40 | D03*
41 | X71524D02*
42 | D03*
43 | X74279D02*
44 | D03*
45 | X79791D02*
46 | D03*
47 | X82547D02*
48 | D03*
49 | X88059D02*
50 | D03*
51 | X90815D02*
52 | D03*
53 | X96327D02*
54 | D03*
55 | X99083D02*
56 | D03*
57 | X101839D02*
58 | D03*
59 | X104595D02*
60 | D03*
61 | X110106D02*
62 | D03*
63 | X112862D02*
64 | D03*
65 | X118374D02*
66 | D03*
67 | X121130D02*
68 | D03*
69 | X126642D02*
70 | D03*
71 | X129398D02*
72 | D03*
73 | X134909D02*
74 | D03*
75 | X137665D02*
76 | D03*
77 | X60500D02*
78 | D03*
79 | X68768D02*
80 | D03*
81 | X77035D02*
82 | D03*
83 | X85303D02*
84 | D03*
85 | X93571D02*
86 | D03*
87 | X107350D02*
88 | D03*
89 | X115618D02*
90 | D03*
91 | X123886D02*
92 | D03*
93 | X132153D02*
94 | D03*
95 | X140421D02*
96 | D03*
97 | D13*
98 | X24921Y64689D02*
99 | D03*
100 | Y63508D02*
101 | D03*
102 | Y61539D02*
103 | D03*
104 | Y60358D02*
105 | D03*
106 | Y58390D02*
107 | D03*
108 | Y56421D02*
109 | D03*
110 | Y54453D02*
111 | D03*
112 | Y52484D02*
113 | D03*
114 | Y50516D02*
115 | D03*
116 | Y48547D02*
117 | D03*
118 | Y46579D02*
119 | D03*
120 | Y44610D02*
121 | D03*
122 | Y42642D02*
123 | D03*
124 | Y41461D02*
125 | D03*
126 | Y39492D02*
127 | D03*
128 | Y38311D02*
129 | D03*
130 | M02*
131 |
--------------------------------------------------------------------------------
/1.Hardware/OpenHeat/控制器-Gerber直接打样/OpenHeat.LDP:
--------------------------------------------------------------------------------
1 | Layer Pairs Export File for PCB: I:\onWorking\OpenHeat\1.Hardware\OpenHeat\OpenHeat.PcbDoc
2 | LayersSetName=Top_Bot_Thru_Holes|DrillFile=openheat-roundholes.txt|DrillLayers=gtl,g1,g2,gbl
3 | LayersSetName=Top_Bot_Slot_Holes|DrillFile=openheat-slotholes.txt|DrillLayers=gtl,g1,g2,gbl
4 |
--------------------------------------------------------------------------------
/1.Hardware/OpenHeat/控制器-Gerber直接打样/OpenHeat.RUL:
--------------------------------------------------------------------------------
1 | DRC Rules Export File for PCB: I:\onWorking\OpenHeat\1.Hardware\OpenHeat\OpenHeat.PcbDoc
2 | RuleKind=SolderMaskExpansion|RuleName=SolderMaskExpansion|Scope=Board|Minimum=3.00
3 | RuleKind=Width|RuleName=Width|Scope=Board|Minimum=4.00
4 | RuleKind=Clearance|RuleName=Clearance|Scope=Board|Minimum=4.00
5 | RuleKind=ShortCircuit|RuleName=ShortCircuit|Scope=Board|Allowed=0
6 |
--------------------------------------------------------------------------------
/1.Hardware/OpenHeat/控制器-Gerber直接打样/OpenHeat.apr:
--------------------------------------------------------------------------------
1 | D10 ROUNDED 10.000 10.000 0.000 LINE 0.000
2 | D11 ROUNDED 8.000 8.000 0.000 LINE 0.000
3 | D14 RECTANGULAR 84.000 156.000 0.000 FLASH 0.000
4 | D15 RECTANGULAR 370.000 105.000 0.000 FLASH 0.000
5 | D18 ROUNDED 202.850 202.850 0.000 FLASH 0.000
6 | D19 ROUNDED 88.677 45.370 0.000 FLASH 0.000
7 | D20 ROUNDED 68.992 45.370 0.000 FLASH 0.000
8 | D21 ROUNDED 31.591 31.591 0.000 FLASH 0.000
9 | D22 ROUNDED 68.992 68.992 0.000 FLASH 0.000
10 | D23 ROUNDED 4.000 4.000 0.000 LINE 0.000
11 | D24 ROUNDED 15.000 15.000 0.000 LINE 0.000
12 | D25 ROUNDED 6.000 6.000 0.000 LINE 0.000
13 | D26 ROUNDED 196.850 196.850 0.000 FLASH 0.000
14 | D27 ROUNDED 82.677 39.370 0.000 FLASH 0.000
15 | D28 ROUNDED 62.992 39.370 0.000 FLASH 0.000
16 | D29 ROUNDED 25.591 25.591 0.000 FLASH 0.000
17 | D30 ROUNDED 39.370 39.370 0.000 FLASH 0.000
18 | D31 ROUNDED 18.000 18.000 0.000 FLASH 0.000
19 | D32 ROUNDED 62.992 62.992 0.000 FLASH 0.000
20 | D35 RECTANGULAR 165.354 86.614 0.000 FLASH 90.000
21 | D43 RECTANGULAR 106.299 110.236 0.000 FLASH 0.000
22 | D47 ROUNDED 19.685 51.181 0.000 FLASH 90.000
23 | D66 ROUNDED 50.000 50.000 0.000 LINE 0.000
24 | D67 ROUNDED 20.000 20.000 0.000 LINE 0.000
25 | D68 ROUNDED 30.000 30.000 0.000 LINE 0.000
26 | D71 RECTANGULAR 171.260 92.520 0.000 FLASH 90.000
27 | D79 RECTANGULAR 112.299 116.236 0.000 FLASH 0.000
28 | D83 ROUNDED 25.685 57.181 0.000 FLASH 90.000
29 | D99 RECTANGULAR 23.622 35.433 0.000 FLASH 90.000
30 | D100 RECTANGULAR 35.433 23.622 0.000 FLASH 90.000
31 | D102 ROUNDED 9.842 9.842 0.000 LINE 0.000
32 | D103 ROUNDED 1.000 1.000 0.000 LINE 0.000
33 | D104 ROUNDED 7.874 7.874 0.000 LINE 0.000
34 | D105 ROUNDED 5.000 5.000 0.000 LINE 0.000
35 | D106 ROUNDED 3.940 3.940 0.000 LINE 0.000
36 | D107 ROUNDED 0.000 0.000 0.000 LINE 0.000
37 | D108 ROUNDED 5.906 5.906 0.000 LINE 0.000
38 | D109 ROUNDED 3.937 3.937 0.000 LINE 0.000
39 | D110 ROUNDED 2.000 2.000 0.000 LINE 0.000
40 | D111 ROUNDED 16.000 16.000 0.000 LINE 0.000
41 | D112 ROUNDED 14.000 14.000 0.000 LINE 0.000
42 |
--------------------------------------------------------------------------------
/1.Hardware/OpenHeat/控制器-Gerber直接打样/Status Report.Txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peng-zhihui/OpenHeat/db5a055e7a26242cbcab9cbef24936952850b85a/1.Hardware/OpenHeat/控制器-Gerber直接打样/Status Report.Txt
--------------------------------------------------------------------------------
/1.Hardware/OpenHeat/热床-Gerber直接打样铝基板/HotBed-24V-macro.APR_LIB:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peng-zhihui/OpenHeat/db5a055e7a26242cbcab9cbef24936952850b85a/1.Hardware/OpenHeat/热床-Gerber直接打样铝基板/HotBed-24V-macro.APR_LIB
--------------------------------------------------------------------------------
/1.Hardware/OpenHeat/热床-Gerber直接打样铝基板/HotBed-24V.DRR:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peng-zhihui/OpenHeat/db5a055e7a26242cbcab9cbef24936952850b85a/1.Hardware/OpenHeat/热床-Gerber直接打样铝基板/HotBed-24V.DRR
--------------------------------------------------------------------------------
/1.Hardware/OpenHeat/热床-Gerber直接打样铝基板/HotBed-24V.EXTREP:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peng-zhihui/OpenHeat/db5a055e7a26242cbcab9cbef24936952850b85a/1.Hardware/OpenHeat/热床-Gerber直接打样铝基板/HotBed-24V.EXTREP
--------------------------------------------------------------------------------
/1.Hardware/OpenHeat/热床-Gerber直接打样铝基板/HotBed-24V.GBL:
--------------------------------------------------------------------------------
1 | G04*
2 | G04 #@! TF.GenerationSoftware,Altium Limited,Altium Designer,21.6.1 (37)*
3 | G04*
4 | G04 Layer_Physical_Order=2*
5 | G04 Layer_Color=6736896*
6 | %FSLAX25Y25*%
7 | %MOIN*%
8 | G70*
9 | G04*
10 | G04 #@! TF.SameCoordinates,532E04BB-9670-4093-A683-9B17944729E4*
11 | G04*
12 | G04*
13 | G04 #@! TF.FilePolarity,Positive*
14 | G04*
15 | G01*
16 | G75*
17 | %ADD17C,0.16496*%
18 | %ADD18C,0.20079*%
19 | D17*
20 | X-7500Y237500D02*
21 | D03*
22 | Y17500D02*
23 | D03*
24 | Y455000D02*
25 | D03*
26 | X474409Y236221D02*
27 | D03*
28 | Y118110D02*
29 | D03*
30 | Y354331D02*
31 | D03*
32 | D18*
33 | X471649Y20548D02*
34 | D03*
35 | X471634Y451949D02*
36 | D03*
37 | M02*
38 |
--------------------------------------------------------------------------------
/1.Hardware/OpenHeat/热床-Gerber直接打样铝基板/HotBed-24V.GBO:
--------------------------------------------------------------------------------
1 | G04*
2 | G04 #@! TF.GenerationSoftware,Altium Limited,Altium Designer,21.6.1 (37)*
3 | G04*
4 | G04 Layer_Color=32896*
5 | %FSLAX25Y25*%
6 | %MOIN*%
7 | G70*
8 | G04*
9 | G04 #@! TF.SameCoordinates,532E04BB-9670-4093-A683-9B17944729E4*
10 | G04*
11 | G04*
12 | G04 #@! TF.FilePolarity,Positive*
13 | G04*
14 | G01*
15 | G75*
16 | M02*
17 |
--------------------------------------------------------------------------------
/1.Hardware/OpenHeat/热床-Gerber直接打样铝基板/HotBed-24V.GBP:
--------------------------------------------------------------------------------
1 | G04*
2 | G04 #@! TF.GenerationSoftware,Altium Limited,Altium Designer,21.6.1 (37)*
3 | G04*
4 | G04 Layer_Color=128*
5 | %FSLAX25Y25*%
6 | %MOIN*%
7 | G70*
8 | G04*
9 | G04 #@! TF.SameCoordinates,532E04BB-9670-4093-A683-9B17944729E4*
10 | G04*
11 | G04*
12 | G04 #@! TF.FilePolarity,Positive*
13 | G04*
14 | G01*
15 | G75*
16 | M02*
17 |
--------------------------------------------------------------------------------
/1.Hardware/OpenHeat/热床-Gerber直接打样铝基板/HotBed-24V.GBS:
--------------------------------------------------------------------------------
1 | G04*
2 | G04 #@! TF.GenerationSoftware,Altium Limited,Altium Designer,21.6.1 (37)*
3 | G04*
4 | G04 Layer_Color=16711935*
5 | %FSLAX25Y25*%
6 | %MOIN*%
7 | G70*
8 | G04*
9 | G04 #@! TF.SameCoordinates,532E04BB-9670-4093-A683-9B17944729E4*
10 | G04*
11 | G04*
12 | G04 #@! TF.FilePolarity,Negative*
13 | G04*
14 | G01*
15 | G75*
16 | %ADD12C,0.17296*%
17 | %ADD13C,0.20879*%
18 | D12*
19 | X-7500Y237500D02*
20 | D03*
21 | Y17500D02*
22 | D03*
23 | Y455000D02*
24 | D03*
25 | X474409Y236221D02*
26 | D03*
27 | Y118110D02*
28 | D03*
29 | Y354331D02*
30 | D03*
31 | D13*
32 | X471649Y20548D02*
33 | D03*
34 | X471634Y451949D02*
35 | D03*
36 | M02*
37 |
--------------------------------------------------------------------------------
/1.Hardware/OpenHeat/热床-Gerber直接打样铝基板/HotBed-24V.GG1:
--------------------------------------------------------------------------------
1 | G04*
2 | G04 #@! TF.GenerationSoftware,Altium Limited,Altium Designer,21.6.1 (37)*
3 | G04*
4 | G04 Layer_Color=128*
5 | %FSLAX25Y25*%
6 | %MOIN*%
7 | G70*
8 | G04*
9 | G04 #@! TF.SameCoordinates,532E04BB-9670-4093-A683-9B17944729E4*
10 | G04*
11 | G04*
12 | G04 #@! TF.FilePolarity,Positive*
13 | G04*
14 | G01*
15 | G75*
16 | %ADD21C,0.00200*%
17 | D21*
18 | X-15571Y237500D02*
19 | X571D01*
20 | X-7500Y229429D02*
21 | Y245571D01*
22 | X-15571Y17500D02*
23 | X571D01*
24 | X-7500Y9429D02*
25 | Y25571D01*
26 | X-15571Y455000D02*
27 | X571D01*
28 | X-7500Y446929D02*
29 | Y463071D01*
30 | X466339Y236221D02*
31 | X482480D01*
32 | X474409Y228150D02*
33 | Y244291D01*
34 | X466339Y118110D02*
35 | X482480D01*
36 | X474409Y110039D02*
37 | Y126181D01*
38 | X466339Y354331D02*
39 | X482480D01*
40 | X474409Y346260D02*
41 | Y362402D01*
42 | X461511Y20548D02*
43 | X481787D01*
44 | X471649Y10410D02*
45 | Y30686D01*
46 | X461496Y451949D02*
47 | X481772D01*
48 | X471634Y441811D02*
49 | Y462087D01*
50 | M02*
51 |
--------------------------------------------------------------------------------
/1.Hardware/OpenHeat/热床-Gerber直接打样铝基板/HotBed-24V.GKO:
--------------------------------------------------------------------------------
1 | G04*
2 | G04 #@! TF.GenerationSoftware,Altium Limited,Altium Designer,21.6.1 (37)*
3 | G04*
4 | G04 Layer_Color=16711935*
5 | %FSLAX25Y25*%
6 | %MOIN*%
7 | G70*
8 | G04*
9 | G04 #@! TF.SameCoordinates,532E04BB-9670-4093-A683-9B17944729E4*
10 | G04*
11 | G04*
12 | G04 #@! TF.FilePolarity,Positive*
13 | G04*
14 | G01*
15 | G75*
16 | %ADD19C,0.01000*%
17 | D19*
18 | X472642Y78911D02*
19 | G03*
20 | X464650Y70919I0J-7992D01*
21 | G01*
22 | X472692Y78961D02*
23 | G03*
24 | X492141Y98410I0J19449D01*
25 | G01*
26 | X464650Y401522D02*
27 | G03*
28 | X472642Y393530I7992J0D01*
29 | G01*
30 | X492141Y374031D02*
31 | G03*
32 | X472692Y393480I-19449J0D01*
33 | G01*
34 | X472692Y431492D02*
35 | G03*
36 | X492141Y450941I0J19449D01*
37 | G01*
38 | X472642Y431442D02*
39 | G03*
40 | X464650Y423450I0J-7992D01*
41 | G01*
42 | X464665Y49047D02*
43 | G03*
44 | X472657Y41055I7992J0D01*
45 | G01*
46 | X492106Y21606D02*
47 | G03*
48 | X472657Y41055I-19449J0D01*
49 | G01*
50 | X492126Y453000D02*
51 | G03*
52 | X472677Y472449I-19449J0D01*
53 | G01*
54 | X472685Y0D02*
55 | G03*
56 | X492134Y19449I0J19449D01*
57 | G01*
58 | X-25000Y19441D02*
59 | G03*
60 | X-5551Y-8I19449J0D01*
61 | G01*
62 | X-5559Y472441D02*
63 | G03*
64 | X-25008Y452992I0J-19449D01*
65 | G01*
66 | X-25000Y19441D02*
67 | Y453000D01*
68 | X-5551Y0D02*
69 | X472685Y0D01*
70 | X464650Y401522D02*
71 | Y423450D01*
72 | Y49062D02*
73 | Y70919D01*
74 | X492126Y98425D02*
75 | Y374016D01*
76 | X492126Y450956D02*
77 | Y453000D01*
78 | X492106Y19477D02*
79 | Y21606D01*
80 | X-5559Y472441D02*
81 | X472677Y472441D01*
82 | M02*
83 |
--------------------------------------------------------------------------------
/1.Hardware/OpenHeat/热床-Gerber直接打样铝基板/HotBed-24V.GM1:
--------------------------------------------------------------------------------
1 | G04*
2 | G04 #@! TF.GenerationSoftware,Altium Limited,Altium Designer,21.6.1 (37)*
3 | G04*
4 | G04 Layer_Color=16711935*
5 | %FSLAX25Y25*%
6 | %MOIN*%
7 | G70*
8 | G04*
9 | G04 #@! TF.SameCoordinates,532E04BB-9670-4093-A683-9B17944729E4*
10 | G04*
11 | G04*
12 | G04 #@! TF.FilePolarity,Positive*
13 | G04*
14 | G01*
15 | G75*
16 | M02*
17 |
--------------------------------------------------------------------------------
/1.Hardware/OpenHeat/热床-Gerber直接打样铝基板/HotBed-24V.GPB:
--------------------------------------------------------------------------------
1 | G04*
2 | G04 #@! TF.GenerationSoftware,Altium Limited,Altium Designer,21.6.1 (37)*
3 | G04*
4 | G04 Layer_Color=255*
5 | %FSLAX25Y25*%
6 | %MOIN*%
7 | G70*
8 | G04*
9 | G04 #@! TF.SameCoordinates,532E04BB-9670-4093-A683-9B17944729E4*
10 | G04*
11 | G04*
12 | G04 #@! TF.FilePolarity,Positive*
13 | G04*
14 | G01*
15 | G75*
16 | %ADD17C,0.16496*%
17 | %ADD18C,0.20079*%
18 | D17*
19 | X-7500Y237500D02*
20 | D03*
21 | Y17500D02*
22 | D03*
23 | Y455000D02*
24 | D03*
25 | X474409Y236221D02*
26 | D03*
27 | Y118110D02*
28 | D03*
29 | Y354331D02*
30 | D03*
31 | D18*
32 | X471649Y20548D02*
33 | D03*
34 | X471634Y451949D02*
35 | D03*
36 | M02*
37 |
--------------------------------------------------------------------------------
/1.Hardware/OpenHeat/热床-Gerber直接打样铝基板/HotBed-24V.GPT:
--------------------------------------------------------------------------------
1 | G04*
2 | G04 #@! TF.GenerationSoftware,Altium Limited,Altium Designer,21.6.1 (37)*
3 | G04*
4 | G04 Layer_Color=255*
5 | %FSLAX25Y25*%
6 | %MOIN*%
7 | G70*
8 | G04*
9 | G04 #@! TF.SameCoordinates,532E04BB-9670-4093-A683-9B17944729E4*
10 | G04*
11 | G04*
12 | G04 #@! TF.FilePolarity,Positive*
13 | G04*
14 | G01*
15 | G75*
16 | %ADD17C,0.16496*%
17 | %ADD18C,0.20079*%
18 | D17*
19 | X-7500Y237500D02*
20 | D03*
21 | Y17500D02*
22 | D03*
23 | Y455000D02*
24 | D03*
25 | X474409Y236221D02*
26 | D03*
27 | Y118110D02*
28 | D03*
29 | Y354331D02*
30 | D03*
31 | D18*
32 | X471649Y20548D02*
33 | D03*
34 | X471634Y451949D02*
35 | D03*
36 | M02*
37 |
--------------------------------------------------------------------------------
/1.Hardware/OpenHeat/热床-Gerber直接打样铝基板/HotBed-24V.GTO:
--------------------------------------------------------------------------------
1 | G04*
2 | G04 #@! TF.GenerationSoftware,Altium Limited,Altium Designer,21.6.1 (37)*
3 | G04*
4 | G04 Layer_Color=65535*
5 | %FSLAX25Y25*%
6 | %MOIN*%
7 | G70*
8 | G04*
9 | G04 #@! TF.SameCoordinates,532E04BB-9670-4093-A683-9B17944729E4*
10 | G04*
11 | G04*
12 | G04 #@! TF.FilePolarity,Positive*
13 | G04*
14 | G01*
15 | G75*
16 | M02*
17 |
--------------------------------------------------------------------------------
/1.Hardware/OpenHeat/热床-Gerber直接打样铝基板/HotBed-24V.GTP:
--------------------------------------------------------------------------------
1 | G04*
2 | G04 #@! TF.GenerationSoftware,Altium Limited,Altium Designer,21.6.1 (37)*
3 | G04*
4 | G04 Layer_Color=8421504*
5 | %FSLAX25Y25*%
6 | %MOIN*%
7 | G70*
8 | G04*
9 | G04 #@! TF.SameCoordinates,532E04BB-9670-4093-A683-9B17944729E4*
10 | G04*
11 | G04*
12 | G04 #@! TF.FilePolarity,Positive*
13 | G04*
14 | G01*
15 | G75*
16 | M02*
17 |
--------------------------------------------------------------------------------
/1.Hardware/OpenHeat/热床-Gerber直接打样铝基板/HotBed-24V.GTS:
--------------------------------------------------------------------------------
1 | G04*
2 | G04 #@! TF.GenerationSoftware,Altium Limited,Altium Designer,21.6.1 (37)*
3 | G04*
4 | G04 Layer_Color=8388736*
5 | %FSLAX25Y25*%
6 | %MOIN*%
7 | G70*
8 | G04*
9 | G04 #@! TF.SameCoordinates,532E04BB-9670-4093-A683-9B17944729E4*
10 | G04*
11 | G04*
12 | G04 #@! TF.FilePolarity,Negative*
13 | G04*
14 | G01*
15 | G75*
16 | %ADD10C,0.09843*%
17 | %ADD11R,5.18000X4.72500*%
18 | %ADD12C,0.17296*%
19 | %ADD13C,0.20879*%
20 | D10*
21 | X486413Y20548D02*
22 | G03*
23 | X486413Y20548I-14764J0D01*
24 | G01*
25 | X486398Y451949D02*
26 | G03*
27 | X486398Y451949I-14764J0D01*
28 | G01*
29 | D11*
30 | X234000Y236250D02*
31 | D03*
32 | D12*
33 | X-7500Y237500D02*
34 | D03*
35 | Y17500D02*
36 | D03*
37 | Y455000D02*
38 | D03*
39 | X474409Y236221D02*
40 | D03*
41 | Y118110D02*
42 | D03*
43 | Y354331D02*
44 | D03*
45 | D13*
46 | X471649Y20548D02*
47 | D03*
48 | X471634Y451949D02*
49 | D03*
50 | M02*
51 |
--------------------------------------------------------------------------------
/1.Hardware/OpenHeat/热床-Gerber直接打样铝基板/HotBed-24V.LDP:
--------------------------------------------------------------------------------
1 | Layer Pairs Export File for PCB: I:\onWorking\_Private\OpenHeat-dev\1.Hardware\OpenHeat\HotBed-24V.PcbDoc
2 | LayersSetName=Top_Bot_Thru_Holes|DrillFile=hotbed-24v.txt|DrillLayers=gtl,gbl
3 |
--------------------------------------------------------------------------------
/1.Hardware/OpenHeat/热床-Gerber直接打样铝基板/HotBed-24V.REP:
--------------------------------------------------------------------------------
1 | *************************************************************
2 | FileName = HotBed-24V.GBR
3 | AutoAperture = True
4 | *************************************************************
5 | Generating : Top Pad Master
6 | File : HotBed-24V.GPT
7 |
8 | Adding Layer : Top Layer
9 |
10 | Adding Layer : Multi-Layer
11 |
12 |
13 | Used DCodes :
14 | D17
15 | D18
16 | *************************************************************
17 |
18 | *************************************************************
19 | Generating : Top Overlay
20 | File : HotBed-24V.GTO
21 |
22 | Adding Layer : Top Overlay
23 |
24 |
25 | Used DCodes :
26 | *************************************************************
27 |
28 | *************************************************************
29 | Generating : Top Paste
30 | File : HotBed-24V.GTP
31 |
32 | Adding Layer : Top Paste
33 |
34 | Adding Layer : Top Layer
35 |
36 | Adding Layer : Multi-Layer
37 |
38 |
39 | Used DCodes :
40 | *************************************************************
41 |
42 | *************************************************************
43 | Generating : Top Solder
44 | File : HotBed-24V.GTS
45 |
46 | Adding Layer : Top Solder
47 |
48 | Adding Layer : Top Layer
49 |
50 | Adding Layer : Multi-Layer
51 |
52 |
53 | Used DCodes :
54 | D10
55 | D11
56 | D12
57 | D13
58 | *************************************************************
59 |
60 | *************************************************************
61 | Generating : Bottom Solder
62 | File : HotBed-24V.GBS
63 |
64 | Adding Layer : Bottom Solder
65 |
66 | Adding Layer : Bottom Layer
67 |
68 | Adding Layer : Multi-Layer
69 |
70 |
71 | Used DCodes :
72 | D12
73 | D13
74 | *************************************************************
75 |
76 | *************************************************************
77 | Generating : Bottom Paste
78 | File : HotBed-24V.GBP
79 |
80 | Adding Layer : Bottom Paste
81 |
82 | Adding Layer : Bottom Layer
83 |
84 | Adding Layer : Multi-Layer
85 |
86 |
87 | Used DCodes :
88 | *************************************************************
89 |
90 | *************************************************************
91 | Generating : Bottom Pad Master
92 | File : HotBed-24V.GPB
93 |
94 | Adding Layer : Bottom Layer
95 |
96 | Adding Layer : Multi-Layer
97 |
98 |
99 | Used DCodes :
100 | D17
101 | D18
102 | *************************************************************
103 |
104 | *************************************************************
105 | Generating : Bottom Overlay
106 | File : HotBed-24V.GBO
107 |
108 | Adding Layer : Bottom Overlay
109 |
110 |
111 | Used DCodes :
112 | *************************************************************
113 |
114 | *************************************************************
115 | Generating : Keep-Out Layer
116 | File : HotBed-24V.GKO
117 |
118 | Adding Layer : Keep-Out Layer
119 |
120 |
121 | Used DCodes :
122 | D19
123 | *************************************************************
124 |
125 | *************************************************************
126 | Generating : Mechanical 1
127 | File : HotBed-24V.GM1
128 |
129 | Adding Layer : Mechanical 1
130 |
131 |
132 | Used DCodes :
133 | *************************************************************
134 |
135 | *************************************************************
136 | Generating : Bottom Layer
137 | File : HotBed-24V.GBL
138 |
139 | Adding Layer : Bottom Layer
140 |
141 | Adding Layer : Multi-Layer
142 |
143 |
144 | Used DCodes :
145 | D17
146 | D18
147 | *************************************************************
148 |
149 | *************************************************************
150 | Generating : Top Layer
151 | File : HotBed-24V.GTL
152 |
153 | Adding Layer : Top Layer
154 |
155 | Adding Layer : Multi-Layer
156 |
157 |
158 | Used DCodes :
159 | D14
160 | D15
161 | D16
162 | D17
163 | D18
164 | *************************************************************
165 |
166 | *************************************************************
167 | Generating : Drill Drawing
168 | File : HotBed-24V.GD1
169 |
170 | Adding Drill Pair : Top Layer-Bottom Layer
171 |
172 | Adding Layer : Drill Drawing
173 |
174 |
175 | Used DCodes :
176 | D19
177 | D20
178 | D21
179 | D22
180 | *************************************************************
181 |
182 | *************************************************************
183 | Generating : Drill Guide
184 | File : HotBed-24V.GG1
185 |
186 | Adding Drill Pair : Top Layer-Bottom Layer
187 |
188 | Adding Layer : Drill Guide
189 |
190 |
191 | Used DCodes :
192 | D21
193 | *************************************************************
194 |
195 |
--------------------------------------------------------------------------------
/1.Hardware/OpenHeat/热床-Gerber直接打样铝基板/HotBed-24V.RUL:
--------------------------------------------------------------------------------
1 | DRC Rules Export File for PCB: I:\onWorking\_Private\OpenHeat-dev\1.Hardware\OpenHeat\HotBed-24V.PcbDoc
2 | RuleKind=SolderMaskExpansion|RuleName=SolderMaskExpansion|Scope=Board|Minimum=4.00
3 | RuleKind=Width|RuleName=Width|Scope=Board|Minimum=10.00
4 | RuleKind=Clearance|RuleName=Clearance|Scope=Board|Minimum=0.00
5 | RuleKind=ShortCircuit|RuleName=ShortCircuit|Scope=Board|Allowed=0
6 |
--------------------------------------------------------------------------------
/1.Hardware/OpenHeat/热床-Gerber直接打样铝基板/HotBed-24V.TXT:
--------------------------------------------------------------------------------
1 | M48
2 | ;Layer_Color=9474304
3 | ;FILE_FORMAT=2:5
4 | INCH,TZ
5 | ;TYPE=PLATED
6 | T1F00S00C0.16142
7 | T2F00S00C0.20276
8 | %
9 | T01
10 | X-7500Y17500
11 | X474409Y118110
12 | X-7500Y237500
13 | X474409Y236221
14 | Y354331
15 | X-7500Y455000
16 | T02
17 | X471649Y20548
18 | X471634Y451949
19 | M30
20 |
--------------------------------------------------------------------------------
/1.Hardware/OpenHeat/热床-Gerber直接打样铝基板/HotBed-24V.apr:
--------------------------------------------------------------------------------
1 | D10 ROUNDED 98.425 98.425 0.000 LINE 0.000
2 | D11 RECTANGULAR 5180.000 4725.000 0.000 FLASH 0.000
3 | D12 ROUNDED 172.961 172.961 0.000 FLASH 0.000
4 | D13 ROUNDED 208.787 208.787 0.000 FLASH 0.000
5 | D14 ROUNDED 92.520 92.520 0.000 LINE 0.000
6 | D15 ROUNDED 46.063 46.063 0.000 LINE 0.000
7 | D16 ROUNDED 78.740 78.740 0.000 LINE 0.000
8 | D17 ROUNDED 164.961 164.961 0.000 FLASH 0.000
9 | D18 ROUNDED 200.787 200.787 0.000 FLASH 0.000
10 | D19 ROUNDED 10.000 10.000 0.000 LINE 0.000
11 | D20 ROUNDED 15.000 15.000 0.000 LINE 0.000
12 | D21 ROUNDED 2.000 2.000 0.000 LINE 0.000
13 | D22 ROUNDED 16.000 16.000 0.000 LINE 0.000
14 |
--------------------------------------------------------------------------------
/1.Hardware/OpenHeat/热床-Gerber直接打样铝基板/Status Report.Txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peng-zhihui/OpenHeat/db5a055e7a26242cbcab9cbef24936952850b85a/1.Hardware/OpenHeat/热床-Gerber直接打样铝基板/Status Report.Txt
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/.gitignore:
--------------------------------------------------------------------------------
1 | .pio
2 | CMakeListsPrivate.txt
3 | cmake-build-*/
4 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 | # Editor-based HTTP Client requests
5 | /httpRequests/
6 | # Datasource local storage ignored files
7 | /dataSources/
8 | /dataSources.local.xml
9 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/.idea/OpenHeat-fw.iml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/.idea/deployment.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/.idea/serialmonitor_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # !!! WARNING !!! AUTO-GENERATED FILE, PLEASE DO NOT MODIFY IT AND USE
2 | # https://docs.platformio.org/page/projectconf/section_env_build.html#build-flags
3 | #
4 | # If you need to override existing CMake configuration or add extra,
5 | # please create `CMakeListsUser.txt` in the root of project.
6 | # The `CMakeListsUser.txt` will not be overwritten by PlatformIO.
7 |
8 | cmake_minimum_required(VERSION 3.13)
9 | set(CMAKE_SYSTEM_NAME Generic)
10 | set(CMAKE_C_COMPILER_WORKS 1)
11 | set(CMAKE_CXX_COMPILER_WORKS 1)
12 |
13 | project("OpenHeat-fw" C CXX)
14 |
15 | include(CMakeListsPrivate.txt)
16 |
17 | if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/CMakeListsUser.txt)
18 | include(CMakeListsUser.txt)
19 | endif()
20 |
21 | add_custom_target(
22 | Production ALL
23 | COMMAND platformio -c clion run "$<$>:-e${CMAKE_BUILD_TYPE}>"
24 | WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
25 | )
26 |
27 | add_custom_target(
28 | Debug ALL
29 | COMMAND platformio -c clion run --target debug "$<$>:-e${CMAKE_BUILD_TYPE}>"
30 | WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
31 | )
32 |
33 | add_executable(Z_DUMMY_TARGET ${SRC_LIST})
34 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/include/README:
--------------------------------------------------------------------------------
1 |
2 | This directory is intended for project header files.
3 |
4 | A header file is a file containing C declarations and macro definitions
5 | to be shared between several project source files. You request the use of a
6 | header file in your project source file (C, C++, etc) located in `src` folder
7 | by including it, with the C preprocessing directive `#include'.
8 |
9 | ```src/main.c
10 |
11 | #include "header.h"
12 |
13 | int main (void)
14 | {
15 | ...
16 | }
17 | ```
18 |
19 | Including a header file produces the same results as copying the header file
20 | into each source file that needs it. Such copying would be time-consuming
21 | and error-prone. With a header file, the related declarations appear
22 | in only one place. If they need to be changed, they can be changed in one
23 | place, and programs that include the header file will automatically use the
24 | new version when next recompiled. The header file eliminates the labor of
25 | finding and changing all the copies as well as the risk that a failure to
26 | find one copy will result in inconsistencies within a program.
27 |
28 | In C, the usual convention is to give header files names that end with `.h'.
29 | It is most portable to use only letters, digits, dashes, and underscores in
30 | header file names, and at most one dot.
31 |
32 | Read more about using header files in official GCC documentation:
33 |
34 | * Include Syntax
35 | * Include Operation
36 | * Once-Only Headers
37 | * Computed Includes
38 |
39 | https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html
40 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/OneButton/.github/workflows/arduino-checks.yml:
--------------------------------------------------------------------------------
1 | # This is a basic workflow to help you get started with Actions for Arduino library projects
2 |
3 | name: Arduino Library Checks
4 |
5 | # Controls when the action will run.
6 | on:
7 | # Triggers the workflow on push or pull request events but only for the develop branch
8 | push:
9 | branches: [develop,master]
10 | pull_request:
11 | branches: [develop,master]
12 |
13 | # Allows you to run this workflow manually from the Actions tab
14 | workflow_dispatch:
15 |
16 | jobs:
17 |
18 | # This defines a job for checking the Arduino library format specifications
19 | # see
20 | lint:
21 | name: check library format
22 | runs-on: ubuntu-latest
23 | continue-on-error: true
24 |
25 | steps:
26 | - uses: actions/checkout@v2
27 |
28 | # Arduino - lint
29 | - name: Arduino-lint
30 | uses: arduino/arduino-lint-action@v1
31 | with:
32 | library-manager: update
33 | verbose: false
34 |
35 | # These jobs are used to compile the examples fot the specific processor/board.
36 | # see
37 | compile-uno:
38 | name: compile uno examples
39 | runs-on: ubuntu-latest
40 | continue-on-error: true
41 |
42 | steps:
43 | - uses: actions/checkout@v2
44 |
45 | # Compile Examples for UNO
46 | - name: Compile examples on uno
47 | uses: arduino/compile-sketches@v1
48 | with:
49 | verbose: true
50 | fqbn: arduino:avr:uno
51 | sketch-paths: |
52 | - 'examples/SimpleOneButton'
53 | - 'examples/TwoButtons'
54 | - 'examples/BlinkMachine'
55 | - 'examples/InterruptOneButton'
56 | - 'examples/SpecialInput'
57 |
58 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/OneButton/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | .idea/
3 | .vscode
4 | _*
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/OneButton/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | All notable changes to this project will be documented in this file starting 2021.
4 |
5 | ## [2.0.1] - 2021-01-31
6 |
7 | * Compiler warning removed
8 | * Documentation
9 |
10 | ## [2.0.0] - 2021-01-22
11 |
12 | * CHANGELOG created.
13 | * Many thanks to the improvements included from #27 (**@aslobodyanuk**), #59 (**@ShaggyDog18**) and #73 (**@geeksville**).
14 |
15 | This is a major update with breaking changes.
16 |
17 | The **states** are re-factored to support counting the clicks.
18 |
19 | By design only one of the events (click, doubleClick, MultiClick) are triggered within one interaction.
20 | As a consequence a single-click interaction is detected after waiting some milliseconds (see setClickTicks()) without another click happening;
21 | Only if you have not attached any double-click event function the waiting time can be skipped.
22 |
23 | Detecting a long 'down' not only works with the first but always as the last click.
24 |
25 | The number of actual clicks can be retrieved from the library any time.
26 |
27 | The function **getPressedTicks()** was removed. See example SimpleOneButton on how to get that time by using attachLongPressStart to save starting time.
28 |
29 | The function **attachPressStart()** is removed as **attachLongPressStart()** does the same but also supports parameters.
30 |
31 | One additional feature has been added not to call the event functions from the interrupt routine and detect
32 | the need for event functions to be called only when the tick() function is called from the main loop() method.
33 | This is because some boards and processors do not support timing or Serial functions (among others) from interrupt routines.
34 |
35 | The function **isIdle()** was added to allow detect a current interaction.
36 |
37 | The library now supports to detect multiple (>2) clicks in a row using **attachMultiClick()** .
38 |
39 |
40 | * The internal _state is using enum instead of plain numbers to make the library more readable.
41 | * functions that had been marked deprecated are now removed. (attachPress->attachLongPressXXX)
42 | * added const to constant parameters to enable meaningful compiler warnings.
43 | * added code for de-bouncing double clicks from pull 27.
44 | * added isIdle() function to find out that the internal state is `init`.
45 |
46 |
47 | ### Examples
48 |
49 | * Examples run on NodeMCU boards. (the library worked already).
50 |
51 | * The **SimpleOneButton.ino** example got some cleanup and definition to be used with ESP8266 boards as well.
52 |
53 | * The **InterruptOneButton.ino** example now is using attachInterrupt instead of UNO specific register modifications.
54 |
55 | * The **SpecialInput.ino** example was added to shpow how to use the OneButton algorythm and input pattern recognition with your own source of input.
56 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/OneButton/LICENSE:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peng-zhihui/OpenHeat/db5a055e7a26242cbcab9cbef24936952850b85a/2.Firmware/OpenHeat-fw/lib/OneButton/LICENSE
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/OneButton/examples/BlinkMachine/BlinkMachine.ino:
--------------------------------------------------------------------------------
1 | /*
2 | BlinkMachine.ino
3 |
4 | This is a sample sketch to show how to use the OneButtonLibrary to detect double-click events on a button.
5 |
6 | Copyright (c) by Matthias Hertel, http://www.mathertel.de
7 | This work is licensed under a BSD style license. See http://www.mathertel.de/License.aspx
8 | More information on: http://www.mathertel.de/Arduino
9 |
10 | The library internals are explained at
11 | http://www.mathertel.de/Arduino/OneButtonLibrary.aspx
12 |
13 | Setup a test circuit:
14 | * Connect a pushbutton to pin A1 (Uno) or D3 (ESP8266) and ground.
15 | * The pin 13 (UNO) or D4 (ESP8266) is used for output attach a led and resistor to ground
16 | or see the built-in led on the standard arduino board.
17 |
18 | The Sketch shows how to setup the library and bind a "machine" that can blink the LED slow or fast.
19 | A click on the button turns the led on.
20 | A doubleclick on the button changes the blink rate from ON to SLOW to FAST and back.
21 | In the loop function the button.tick function has to be called as often as you like.
22 |
23 | State-Diagram
24 |
25 | start
26 | | +-------\
27 | V V |
28 | -------- ------ |
29 | | OFF |<--click-+->| ON | |
30 | -------- | ------ |
31 | | | |
32 | | d-click |
33 | | | |
34 | | V |
35 | | ------ |
36 | +- | SLOW | |
37 | | ------ |
38 | | | |
39 | | d-click |
40 | | | |
41 | | V d-click
42 | | ------ |
43 | +--| FAST |---/
44 | ------
45 | */
46 |
47 | // 06.10.2012 created by Matthias Hertel
48 | // 26.03.2017 state diagram added, minor changes
49 |
50 | #include "OneButton.h"
51 |
52 | // The actions I ca do...
53 | typedef enum {
54 | ACTION_OFF, // set LED "OFF".
55 | ACTION_ON, // set LED "ON"
56 | ACTION_SLOW, // blink LED "SLOW"
57 | ACTION_FAST // blink LED "FAST"
58 | }
59 | MyActions;
60 |
61 | #if defined(ARDUINO_AVR_UNO) || defined(ARDUINO_AVR_NANO_EVERY)
62 | // Example for Arduino UNO with input button on pin 2 and builtin LED on pin 13
63 | #define PIN_INPUT A1
64 | #define PIN_LED 13
65 |
66 | #elif defined(ESP8266)
67 | // Example for NodeMCU with input button using FLASH button on D3 and using the led on -12 module (D4).
68 | // This LED is lighting on output level LOW.
69 | #define PIN_INPUT D3
70 | #define PIN_LED D4
71 |
72 | #endif
73 |
74 | // Setup a new OneButton on pin A1.
75 | OneButton button(PIN_INPUT, true);
76 |
77 | MyActions nextAction = ACTION_OFF; // no action when starting
78 |
79 |
80 | // setup code here, to run once.
81 | void setup() {
82 | // enable the standard led on pin 13.
83 | pinMode(PIN_LED, OUTPUT); // sets the digital pin as output
84 |
85 | // link the myClickFunction function to be called on a click event.
86 | button.attachClick(myClickFunction);
87 |
88 | // link the doubleclick function to be called on a doubleclick event.
89 | button.attachDoubleClick(myDoubleClickFunction);
90 |
91 | // set 80 msec. debouncing time. Default is 50 msec.
92 | button.setDebounceTicks(80);
93 | } // setup
94 |
95 |
96 | // main code here, to run repeatedly:
97 | void loop() {
98 | unsigned long now = millis();
99 |
100 | // keep watching the push button:
101 | button.tick();
102 |
103 | // You can implement other code in here or just wait a while
104 |
105 | if (nextAction == ACTION_OFF) {
106 | // do nothing.
107 | digitalWrite(PIN_LED, LOW);
108 |
109 | } else if (nextAction == ACTION_ON) {
110 | // turn LED on
111 | digitalWrite(PIN_LED, HIGH);
112 |
113 | } else if (nextAction == ACTION_SLOW) {
114 | // do a slow blinking
115 | if (now % 1000 < 500) {
116 | digitalWrite(PIN_LED, LOW);
117 | } else {
118 | digitalWrite(PIN_LED, HIGH);
119 | } // if
120 |
121 | } else if (nextAction == ACTION_FAST) {
122 | // do a fast blinking
123 | if (now % 200 < 100) {
124 | digitalWrite(PIN_LED, LOW);
125 | } else {
126 | digitalWrite(PIN_LED, HIGH);
127 | } // if
128 | } // if
129 | } // loop
130 |
131 |
132 | // this function will be called when the button was pressed 1 time and them some time has passed.
133 | void myClickFunction() {
134 | if (nextAction == ACTION_OFF)
135 | nextAction = ACTION_ON;
136 | else
137 | nextAction = ACTION_OFF;
138 | } // myClickFunction
139 |
140 |
141 | // this function will be called when the button was pressed 2 times in a short timeframe.
142 | void myDoubleClickFunction() {
143 | if (nextAction == ACTION_ON) {
144 | nextAction = ACTION_SLOW;
145 |
146 | } else if (nextAction == ACTION_SLOW) {
147 | nextAction = ACTION_FAST;
148 |
149 | } else if (nextAction == ACTION_FAST) {
150 | nextAction = ACTION_ON;
151 | } // if
152 | } // myDoubleClickFunction
153 |
154 | // End
155 |
156 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/OneButton/examples/SimpleOneButton/SimpleOneButton.ino:
--------------------------------------------------------------------------------
1 | /*
2 | This is a sample sketch to show how to use the OneButtonLibrary
3 | to detect double-click events on a button.
4 | The library internals are explained at
5 | http://www.mathertel.de/Arduino/OneButtonLibrary.aspx
6 |
7 | Setup a test circuit:
8 | * Connect a pushbutton to pin A1 (ButtonPin) and ground.
9 | * The pin 13 (StatusPin) is used for output attach a led and resistor to ground
10 | or see the built-in led on the standard arduino board.
11 |
12 | The sketch shows how to setup the library and bind the functions (singleClick, doubleClick) to the events.
13 | In the loop function the button.tick function must be called as often as you like.
14 | */
15 |
16 | // 03.03.2011 created by Matthias Hertel
17 | // 01.12.2011 extension changed to work with the Arduino 1.0 environment
18 |
19 | #include "OneButton.h"
20 |
21 | #if defined(ARDUINO_AVR_UNO) || defined(ARDUINO_AVR_NANO_EVERY)
22 | // Example for Arduino UNO with input button on pin 2 and builtin LED on pin 13
23 | #define PIN_INPUT 2
24 | #define PIN_LED 13
25 |
26 | #else if defined(ESP8266)
27 | // Example for NodeMCU with input button using FLASH button on D3 and using the led on -12 module (D4).
28 | // This LED is lighting on output level LOW.
29 | #define PIN_INPUT D3
30 | #define PIN_LED D4
31 |
32 | #endif
33 |
34 | // Setup a new OneButton on pin PIN_INPUT
35 | // The 2. parameter activeLOW is true, because external wiring sets the button to LOW when pressed.
36 | OneButton button(PIN_INPUT, true);
37 |
38 | // In case the momentary button puts the input to HIGH when pressed:
39 | // The 2. parameter activeLOW is false when the external wiring sets the button to HIGH when pressed.
40 | // The 3. parameter can be used to disable the PullUp .
41 | // OneButton button(PIN_INPUT, false, false);
42 |
43 | // current LED state, staring with LOW (0)
44 | int ledState = LOW;
45 |
46 | // setup code here, to run once:
47 | void setup()
48 | {
49 | Serial.begin(115200);
50 | Serial.println("One Button Example with polling.");
51 |
52 | // enable the standard led on pin 13.
53 | pinMode(PIN_LED, OUTPUT); // sets the digital pin as output
54 |
55 | // enable the standard led on pin 13.
56 | digitalWrite(PIN_LED, ledState);
57 |
58 | // link the doubleclick function to be called on a doubleclick event.
59 | button.attachDoubleClick(doubleClick);
60 | } // setup
61 |
62 |
63 | // main code here, to run repeatedly:
64 | void loop()
65 | {
66 | // keep watching the push button:
67 | button.tick();
68 |
69 | // You can implement other code in here or just wait a while
70 | delay(10);
71 | } // loop
72 |
73 |
74 | // this function will be called when the button was pressed 2 times in a short timeframe.
75 | void doubleClick()
76 | {
77 | Serial.println("x2");
78 |
79 | ledState = !ledState; // reverse the LED
80 | digitalWrite(PIN_LED, ledState);
81 | } // doubleClick
82 |
83 | // End
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/OneButton/examples/SpecialInput/SpecialInput.ino:
--------------------------------------------------------------------------------
1 | /*
2 | * SpecialInput.ino - Example for the OneButtonLibrary library.
3 | * This is a sample sketch to show how to use the OneClick library on other input sources than standard digital pins.
4 | *
5 | * The library internals are explained at
6 | * http://www.mathertel.de/Arduino/OneButtonLibrary.aspx
7 | *
8 | * Setup a test circuit:
9 | * * Connect a pushbutton to pin 2 (ButtonPin) and ground.
10 | *
11 | * The sketch shows how to setup the library and bind the functions (singleClick, doubleClick) to the events.
12 | * In the loop function the button.tick function must be called as often as you like.
13 | *
14 | * * 22.01.2021 created by Matthias Hertel
15 | */
16 |
17 | #include "OneButton.h"
18 |
19 | // This is an example on how to use the OneClick library on other input sources than standard digital pins.
20 | // 1. do not use a pin in the initialization of the OneClick library.
21 | // 2. pass the input state to the tick function.
22 |
23 | // You can also find how to create an instance in setup and not by declaration.
24 | // You can also find how to use inline callback functions.
25 |
26 | #if defined(ARDUINO_AVR_UNO) || defined(ARDUINO_AVR_NANO_EVERY)
27 | #define PIN_INPUT 2
28 |
29 | #else if defined(ESP8266)
30 | #define PIN_INPUT D3
31 |
32 | #endif
33 |
34 |
35 | // OneButton instance will be created in setup.
36 | OneButton *button;
37 |
38 | void fClicked(void *s)
39 | {
40 | Serial.print("Click:");
41 | Serial.println((char *)s);
42 | }
43 |
44 | void setup()
45 | {
46 | Serial.begin(115200);
47 | Serial.println("One Button Example with custom input.");
48 |
49 | // create the OneButton instance without a pin.
50 | button = new OneButton();
51 |
52 | // Here is an example on how to use a parameter to the registered function:
53 | button->attachClick(fClicked, "me");
54 |
55 | // Here is an example on how to use an inline function:
56 | button->attachDoubleClick([]() { Serial.println("DoubleClick"); });
57 |
58 | // setup your own source of input:
59 | pinMode(PIN_INPUT, INPUT_PULLUP);
60 |
61 | } // setup()
62 |
63 | void loop()
64 | {
65 | // read your own source of input:
66 | bool isPressed = (digitalRead(PIN_INPUT) == LOW);
67 |
68 | // call tick frequently with current push-state of the input
69 | button->tick(isPressed);
70 | } // loop()
71 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/OneButton/examples/TwoButtons/TwoButtons.ino:
--------------------------------------------------------------------------------
1 | /*
2 | This is a sample sketch to show how to use the OneButtonLibrary
3 | to detect click events on 2 buttons in parallel.
4 | The library internals are explained at
5 | http://www.mathertel.de/Arduino/OneButtonLibrary.aspx
6 |
7 | Setup a test circuit:
8 | * Connect a pushbutton to pin A1 (ButtonPin) and ground.
9 | * Connect a pushbutton to pin A2 (ButtonPin) and ground.
10 | * The Serial interface is used for output the detected button events.
11 |
12 | The Sketch shows how to setup the library and bind 2 buttons to their functions.
13 | In the loop function the button1.tick and button2.tick functions have to be called as often as you like.
14 | */
15 |
16 | // 01.03.2014 created by Matthias Hertel
17 | // ... and working.
18 |
19 | /* Sample output:
20 |
21 | Starting TwoButtons...
22 | Button 1 click.
23 | Button 2 click.
24 | Button 1 doubleclick.
25 | Button 2 doubleclick.
26 | Button 1 longPress start
27 | Button 1 longPress...
28 | Button 1 longPress...
29 | Button 1 longPress...
30 | Button 1 longPress stop
31 | Button 2 longPress start
32 | Button 2 longPress...
33 | Button 2 longPress...
34 | Button 2 longPress stop
35 |
36 | */
37 |
38 | #include "OneButton.h"
39 |
40 | // Setup a new OneButton on pin A1.
41 | OneButton button1(A1, true);
42 | // Setup a new OneButton on pin A2.
43 | OneButton button2(A2, true);
44 |
45 |
46 | // setup code here, to run once:
47 | void setup() {
48 | // Setup the Serial port. see http://arduino.cc/en/Serial/IfSerial
49 | Serial.begin(115200);
50 | while (!Serial) {
51 | ; // wait for serial port to connect. Needed for Leonardo only
52 | }
53 | Serial.println("Starting TwoButtons...");
54 |
55 | // link the button 1 functions.
56 | button1.attachClick(click1);
57 | button1.attachDoubleClick(doubleclick1);
58 | button1.attachLongPressStart(longPressStart1);
59 | button1.attachLongPressStop(longPressStop1);
60 | button1.attachDuringLongPress(longPress1);
61 |
62 | // link the button 2 functions.
63 | button2.attachClick(click2);
64 | button2.attachDoubleClick(doubleclick2);
65 | button2.attachLongPressStart(longPressStart2);
66 | button2.attachLongPressStop(longPressStop2);
67 | button2.attachDuringLongPress(longPress2);
68 |
69 | } // setup
70 |
71 |
72 | // main code here, to run repeatedly:
73 | void loop() {
74 | // keep watching the push buttons:
75 | button1.tick();
76 | button2.tick();
77 |
78 | // You can implement other code in here or just wait a while
79 | delay(10);
80 | } // loop
81 |
82 |
83 | // ----- button 1 callback functions
84 |
85 | // This function will be called when the button1 was pressed 1 time (and no 2. button press followed).
86 | void click1() {
87 | Serial.println("Button 1 click.");
88 | } // click1
89 |
90 |
91 | // This function will be called when the button1 was pressed 2 times in a short timeframe.
92 | void doubleclick1() {
93 | Serial.println("Button 1 doubleclick.");
94 | } // doubleclick1
95 |
96 |
97 | // This function will be called once, when the button1 is pressed for a long time.
98 | void longPressStart1() {
99 | Serial.println("Button 1 longPress start");
100 | } // longPressStart1
101 |
102 |
103 | // This function will be called often, while the button1 is pressed for a long time.
104 | void longPress1() {
105 | Serial.println("Button 1 longPress...");
106 | } // longPress1
107 |
108 |
109 | // This function will be called once, when the button1 is released after beeing pressed for a long time.
110 | void longPressStop1() {
111 | Serial.println("Button 1 longPress stop");
112 | } // longPressStop1
113 |
114 |
115 | // ... and the same for button 2:
116 |
117 | void click2() {
118 | Serial.println("Button 2 click.");
119 | } // click2
120 |
121 |
122 | void doubleclick2() {
123 | Serial.println("Button 2 doubleclick.");
124 | } // doubleclick2
125 |
126 |
127 | void longPressStart2() {
128 | Serial.println("Button 2 longPress start");
129 | } // longPressStart2
130 |
131 |
132 | void longPress2() {
133 | Serial.println("Button 2 longPress...");
134 | } // longPress2
135 |
136 | void longPressStop2() {
137 | Serial.println("Button 2 longPress stop");
138 | } // longPressStop2
139 |
140 |
141 | // End
142 |
143 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/OneButton/keywords.txt:
--------------------------------------------------------------------------------
1 | #######################################
2 | # Syntax Coloring Map for OneButton
3 | #######################################
4 |
5 | #######################################
6 | # Datatypes (KEYWORD1)
7 | #######################################
8 |
9 | callbackFunction KEYWORD1
10 | parameterizedCallbackFunction KEYWORD1
11 |
12 | #######################################
13 | # Methods and Functions (KEYWORD2)
14 | #######################################
15 |
16 | setClickTicks KEYWORD2
17 | setPressTicks KEYWORD2
18 | setDebounceTicks KEYWORD2
19 | attachClick KEYWORD2
20 | attachDoubleClick KEYWORD2
21 | attachMultiClick KEYWORD2
22 | attachLongPressStart KEYWORD2
23 | attachLongPressStop KEYWORD2
24 | attachDuringLongPress KEYWORD2
25 | tick KEYWORD2
26 | reset KEYWORD2
27 | getNumberClicks KEYWORD2
28 | isIdle KEYWORD2
29 | isLongPressed KEYWORD2
30 |
31 | #######################################
32 | # Instances (KEYWORD2)
33 | #######################################
34 |
35 | OneButton KEYWORD2
36 |
37 | #######################################
38 | # Constants (LITERAL1)
39 | #######################################
40 |
41 |
42 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/OneButton/library.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "OneButton",
3 | "version": "2.0.2",
4 | "keywords": "arduino, button, pushbutton",
5 | "description": "This Arduino library is improving the usage of a singe button for input. It shows how to use an digital input pin with a single pushbutton attached for detecting some of the typical button press events like single clicks, double clicks and long-time pressing. This enables you to reuse the same button for multiple functions and lowers the hardware invests.",
6 | "repository": {
7 | "type": "git",
8 | "url": "https://github.com/mathertel/OneButton"
9 | },
10 | "authors": {
11 | "name": "Matthias Hertel",
12 | "email": "mathertel@hotmail.com",
13 | "url": "https://www.mathertel.de/impressum.aspx"
14 | },
15 | "license": "BSD-3-Clause",
16 | "homepage": "http://www.mathertel.de/Arduino/OneButtonLibrary.aspx",
17 | "frameworks": "arduino",
18 | "platforms": "*"
19 | }
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/OneButton/library.properties:
--------------------------------------------------------------------------------
1 | name=OneButton
2 | version=2.0.2
3 | author=Matthias Hertel, mathertel@hotmail.com
4 | maintainer=Matthias Hertel
5 | sentence=Arduino library for improving the usage of a singe input button.
6 | paragraph=It supports detecting events like single, double, multiple clicks and long-time pressing. This enables you to reuse the same button for multiple functions and lowers the hardware invests.
7 | category=Signal Input/Output
8 | url=https://github.com/mathertel/OneButton
9 | architectures=*
10 | includes=OneButton.h
11 | license=BSD-3-Clause
12 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/PID/PID_v1.h:
--------------------------------------------------------------------------------
1 | #ifndef PID_v1_h
2 | #define PID_v1_h
3 | #define LIBRARY_VERSION 1.2.1
4 |
5 | class PID
6 | {
7 |
8 |
9 | public:
10 |
11 | //Constants used in some of the functions below
12 | #define AUTOMATIC 1
13 | #define MANUAL 0
14 | #define DIRECT 0
15 | #define REVERSE 1
16 | #define P_ON_M 0
17 | #define P_ON_E 1
18 |
19 | //commonly used functions **************************************************************************
20 | PID(double*, double*, double*, // * constructor. links the PID to the Input, Output, and
21 | double, double, double, int, int);// Setpoint. Initial tuning parameters are also set here.
22 | // (overload for specifying proportional mode)
23 |
24 | PID(double*, double*, double*, // * constructor. links the PID to the Input, Output, and
25 | double, double, double, int); // Setpoint. Initial tuning parameters are also set here
26 |
27 | void SetMode(int Mode); // * sets PID to either Manual (0) or Auto (non-0)
28 |
29 | bool Compute(); // * performs the PID calculation. it should be
30 | // called every time loop() cycles. ON/OFF and
31 | // calculation frequency can be set using SetMode
32 | // SetSampleTime respectively
33 |
34 | void SetOutputLimits(double, double); // * clamps the output to a specific range. 0-255 by default, but
35 | // it's likely the user will want to change this depending on
36 | // the application
37 |
38 |
39 |
40 | //available but not commonly used functions ********************************************************
41 | void SetTunings(double, double, // * While most users will set the tunings once in the
42 | double); // constructor, this function gives the user the option
43 | // of changing tunings during runtime for Adaptive control
44 | void SetTunings(double, double, // * overload for specifying proportional mode
45 | double, int);
46 |
47 | void SetControllerDirection(int); // * Sets the Direction, or "Action" of the controller. DIRECT
48 | // means the output will increase when error is positive. REVERSE
49 | // means the opposite. it's very unlikely that this will be needed
50 | // once it is set in the constructor.
51 | void SetSampleTime(int); // * sets the frequency, in Milliseconds, with which
52 | // the PID calculation is performed. default is 100
53 |
54 |
55 |
56 | //Display functions ****************************************************************
57 | double GetKp(); // These functions query the pid for interal values.
58 | double GetKi(); // they were created mainly for the pid front-end,
59 | double GetKd(); // where it's important to know what is actually
60 | int GetMode(); // inside the PID.
61 | int GetDirection(); //
62 |
63 | private:
64 | void Initialize();
65 |
66 | double dispKp; // * we'll hold on to the tuning parameters in user-entered
67 | double dispKi; // format for display purposes
68 | double dispKd; //
69 |
70 | double kp; // * (P)roportional Tuning Parameter
71 | double ki; // * (I)ntegral Tuning Parameter
72 | double kd; // * (D)erivative Tuning Parameter
73 |
74 | int controllerDirection;
75 | int pOn;
76 |
77 | double *myInput; // * Pointers to the Input, Output, and Setpoint variables
78 | double *myOutput; // This creates a hard link between the variables and the
79 | double *mySetpoint; // PID, freeing the user from having to constantly tell us
80 | // what these values are. with pointers we'll just know.
81 |
82 | unsigned long lastTime;
83 | double outputSum, lastInput;
84 |
85 | unsigned long SampleTime;
86 | double outMin, outMax;
87 | bool inAuto, pOnE;
88 | };
89 | #endif
90 |
91 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/PID/README.txt:
--------------------------------------------------------------------------------
1 | ***************************************************************
2 | * Arduino PID Library - Version 1.2.1
3 | * by Brett Beauregard brettbeauregard.com
4 | *
5 | * This Library is licensed under the MIT License
6 | ***************************************************************
7 |
8 | - For an ultra-detailed explanation of why the code is the way it is, please visit:
9 | http://brettbeauregard.com/blog/2011/04/improving-the-beginners-pid-introduction/
10 |
11 | - For function documentation see: http://playground.arduino.cc/Code/PIDLibrary
12 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/PID/examples/PID_AdaptiveTunings/PID_AdaptiveTunings.ino:
--------------------------------------------------------------------------------
1 | /********************************************************
2 | * PID Adaptive Tuning Example
3 | * One of the benefits of the PID library is that you can
4 | * change the tuning parameters at any time. this can be
5 | * helpful if we want the controller to be agressive at some
6 | * times, and conservative at others. in the example below
7 | * we set the controller to use Conservative Tuning Parameters
8 | * when we're near setpoint and more agressive Tuning
9 | * Parameters when we're farther away.
10 | ********************************************************/
11 |
12 | #include
13 |
14 | #define PIN_INPUT 0
15 | #define PIN_OUTPUT 3
16 |
17 | //Define Variables we'll be connecting to
18 | double Setpoint, Input, Output;
19 |
20 | //Define the aggressive and conservative Tuning Parameters
21 | double aggKp=4, aggKi=0.2, aggKd=1;
22 | double consKp=1, consKi=0.05, consKd=0.25;
23 |
24 | //Specify the links and initial tuning parameters
25 | PID myPID(&Input, &Output, &Setpoint, consKp, consKi, consKd, DIRECT);
26 |
27 | void setup()
28 | {
29 | //initialize the variables we're linked to
30 | Input = analogRead(PIN_INPUT);
31 | Setpoint = 100;
32 |
33 | //turn the PID on
34 | myPID.SetMode(AUTOMATIC);
35 | }
36 |
37 | void loop()
38 | {
39 | Input = analogRead(PIN_INPUT);
40 |
41 | double gap = abs(Setpoint-Input); //distance away from setpoint
42 | if (gap < 10)
43 | { //we're close to setpoint, use conservative tuning parameters
44 | myPID.SetTunings(consKp, consKi, consKd);
45 | }
46 | else
47 | {
48 | //we're far from setpoint, use aggressive tuning parameters
49 | myPID.SetTunings(aggKp, aggKi, aggKd);
50 | }
51 |
52 | myPID.Compute();
53 | analogWrite(PIN_OUTPUT, Output);
54 | }
55 |
56 |
57 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/PID/examples/PID_Basic/PID_Basic.ino:
--------------------------------------------------------------------------------
1 | /********************************************************
2 | * PID Basic Example
3 | * Reading analog input 0 to control analog PWM output 3
4 | ********************************************************/
5 |
6 | #include
7 |
8 | #define PIN_INPUT 0
9 | #define PIN_OUTPUT 3
10 |
11 | //Define Variables we'll be connecting to
12 | double Setpoint, Input, Output;
13 |
14 | //Specify the links and initial tuning parameters
15 | double Kp=2, Ki=5, Kd=1;
16 | PID myPID(&Input, &Output, &Setpoint, Kp, Ki, Kd, DIRECT);
17 |
18 | void setup()
19 | {
20 | //initialize the variables we're linked to
21 | Input = analogRead(PIN_INPUT);
22 | Setpoint = 100;
23 |
24 | //turn the PID on
25 | myPID.SetMode(AUTOMATIC);
26 | }
27 |
28 | void loop()
29 | {
30 | Input = analogRead(PIN_INPUT);
31 | myPID.Compute();
32 | analogWrite(PIN_OUTPUT, Output);
33 | }
34 |
35 |
36 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/PID/examples/PID_PonM/PID_PonM.ino:
--------------------------------------------------------------------------------
1 | /********************************************************
2 | * PID Proportional on measurement Example
3 | * Setting the PID to use Proportional on measurement will
4 | * make the output move more smoothly when the setpoint
5 | * is changed. In addition, it can eliminate overshoot
6 | * in certain processes like sous-vides.
7 | ********************************************************/
8 |
9 | #include
10 |
11 | //Define Variables we'll be connecting to
12 | double Setpoint, Input, Output;
13 |
14 | //Specify the links and initial tuning parameters
15 | PID myPID(&Input, &Output, &Setpoint,2,5,1,P_ON_M, DIRECT); //P_ON_M specifies that Proportional on Measurement be used
16 | //P_ON_E (Proportional on Error) is the default behavior
17 |
18 | void setup()
19 | {
20 | //initialize the variables we're linked to
21 | Input = analogRead(0);
22 | Setpoint = 100;
23 |
24 | //turn the PID on
25 | myPID.SetMode(AUTOMATIC);
26 | }
27 |
28 | void loop()
29 | {
30 | Input = analogRead(0);
31 | myPID.Compute();
32 | analogWrite(3,Output);
33 | }
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/PID/examples/PID_RelayOutput/PID_RelayOutput.ino:
--------------------------------------------------------------------------------
1 | /********************************************************
2 | * PID RelayOutput Example
3 | * Same as basic example, except that this time, the output
4 | * is going to a digital pin which (we presume) is controlling
5 | * a relay. the pid is designed to Output an analog value,
6 | * but the relay can only be On/Off.
7 | *
8 | * to connect them together we use "time proportioning
9 | * control" it's essentially a really slow version of PWM.
10 | * first we decide on a window size (5000mS say.) we then
11 | * set the pid to adjust its output between 0 and that window
12 | * size. lastly, we add some logic that translates the PID
13 | * output into "Relay On Time" with the remainder of the
14 | * window being "Relay Off Time"
15 | ********************************************************/
16 |
17 | #include
18 |
19 | #define PIN_INPUT 0
20 | #define RELAY_PIN 6
21 |
22 | //Define Variables we'll be connecting to
23 | double Setpoint, Input, Output;
24 |
25 | //Specify the links and initial tuning parameters
26 | double Kp=2, Ki=5, Kd=1;
27 | PID myPID(&Input, &Output, &Setpoint, Kp, Ki, Kd, DIRECT);
28 |
29 | int WindowSize = 5000;
30 | unsigned long windowStartTime;
31 |
32 | void setup()
33 | {
34 | windowStartTime = millis();
35 |
36 | //initialize the variables we're linked to
37 | Setpoint = 100;
38 |
39 | //tell the PID to range between 0 and the full window size
40 | myPID.SetOutputLimits(0, WindowSize);
41 |
42 | //turn the PID on
43 | myPID.SetMode(AUTOMATIC);
44 | }
45 |
46 | void loop()
47 | {
48 | Input = analogRead(PIN_INPUT);
49 | myPID.Compute();
50 |
51 | /************************************************
52 | * turn the output pin on/off based on pid output
53 | ************************************************/
54 | if (millis() - windowStartTime > WindowSize)
55 | { //time to shift the Relay Window
56 | windowStartTime += WindowSize;
57 | }
58 | if (Output < millis() - windowStartTime) digitalWrite(RELAY_PIN, HIGH);
59 | else digitalWrite(RELAY_PIN, LOW);
60 |
61 | }
62 |
63 |
64 |
65 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/PID/keywords.txt:
--------------------------------------------------------------------------------
1 | #######################################
2 | # Syntax Coloring Map For PID Library
3 | #######################################
4 |
5 | #######################################
6 | # Datatypes (KEYWORD1)
7 | #######################################
8 |
9 | PID KEYWORD1
10 |
11 | #######################################
12 | # Methods and Functions (KEYWORD2)
13 | #######################################
14 |
15 | SetMode KEYWORD2
16 | Compute KEYWORD2
17 | SetOutputLimits KEYWORD2
18 | SetTunings KEYWORD2
19 | SetControllerDirection KEYWORD2
20 | SetSampleTime KEYWORD2
21 | GetKp KEYWORD2
22 | GetKi KEYWORD2
23 | GetKd KEYWORD2
24 | GetMode KEYWORD2
25 | GetDirection KEYWORD2
26 |
27 | #######################################
28 | # Constants (LITERAL1)
29 | #######################################
30 |
31 | AUTOMATIC LITERAL1
32 | MANUAL LITERAL1
33 | DIRECT LITERAL1
34 | REVERSE LITERAL1
35 | P_ON_E LITERAL1
36 | P_ON_M LITERAL1
37 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/PID/library.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "PID",
3 | "keywords": "PID, controller, signal",
4 | "description": "A PID controller seeks to keep some input variable close to a desired setpoint by adjusting an output. The way in which it does this can be 'tuned' by adjusting three parameters (P,I,D).",
5 | "url": "http://playground.arduino.cc/Code/PIDLibrary",
6 | "include": "PID_v1",
7 | "authors":
8 | [
9 | {
10 | "name": "Brett Beauregard"
11 | }
12 | ],
13 | "repository":
14 | {
15 | "type": "git",
16 | "url": "https://github.com/br3ttb/Arduino-PID-Library.git"
17 | },
18 | "frameworks": "arduino"
19 | }
20 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/PID/library.properties:
--------------------------------------------------------------------------------
1 | name=PID
2 | version=1.2.1
3 | author=Brett Beauregard
4 | maintainer=Brett Beauregard
5 | sentence=PID controller
6 | paragraph=A PID controller seeks to keep some input variable close to a desired setpoint by adjusting an output. The way in which it does this can be 'tuned' by adjusting three parameters (P,I,D).
7 | category=Signal Input/Output
8 | url=http://playground.arduino.cc/Code/PIDLibrary
9 | architectures=*
10 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/QRCode/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/QRCode/LICENSE.txt:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | This library is written and maintained by Richard Moore.
4 | Major parts were derived from Project Nayuki's library.
5 |
6 | Copyright (c) 2017 Richard Moore (https://github.com/ricmoo/QRCode)
7 | Copyright (c) 2017 Project Nayuki (https://www.nayuki.io/page/qr-code-generator-library)
8 |
9 | Permission is hereby granted, free of charge, to any person obtaining a copy
10 | of this software and associated documentation files (the "Software"), to deal
11 | in the Software without restriction, including without limitation the rights
12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 | copies of the Software, and to permit persons to whom the Software is
14 | furnished to do so, subject to the following conditions:
15 |
16 | The above copyright notice and this permission notice shall be included in
17 | all copies or substantial portions of the Software.
18 |
19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | THE SOFTWARE.
26 |
27 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/QRCode/examples/QRCode/QRCode.ino:
--------------------------------------------------------------------------------
1 | /**
2 | * QRCode
3 | *
4 | * A quick example of generating a QR code.
5 | *
6 | * This prints the QR code to the serial monitor as solid blocks. Each module
7 | * is two characters wide, since the monospace font used in the serial monitor
8 | * is approximately twice as tall as wide.
9 | *
10 | */
11 |
12 | #include "qrcode.h"
13 |
14 | void setup() {
15 | Serial.begin(115200);
16 |
17 | // Start time
18 | uint32_t dt = millis();
19 |
20 | // Create the QR code
21 | QRCode qrcode;
22 | uint8_t qrcodeData[qrcode_getBufferSize(3)];
23 | qrcode_initText(&qrcode, qrcodeData, 3, 0, "HELLO WORLD");
24 |
25 | // Delta time
26 | dt = millis() - dt;
27 | Serial.print("QR Code Generation Time: ");
28 | Serial.print(dt);
29 | Serial.print("\n");
30 |
31 | // Top quiet zone
32 | Serial.print("\n\n\n\n");
33 |
34 | for (uint8_t y = 0; y < qrcode.size; y++) {
35 |
36 | // Left quiet zone
37 | Serial.print(" ");
38 |
39 | // Each horizontal module
40 | for (uint8_t x = 0; x < qrcode.size; x++) {
41 |
42 | // Print each module (UTF-8 \u2588 is a solid block)
43 | Serial.print(qrcode_getModule(&qrcode, x, y) ? "\u2588\u2588": " ");
44 |
45 | }
46 |
47 | Serial.print("\n");
48 | }
49 |
50 | // Bottom quiet zone
51 | Serial.print("\n\n\n\n");
52 | }
53 |
54 | void loop() {
55 |
56 | }
57 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/QRCode/generate_table.py:
--------------------------------------------------------------------------------
1 | Data = [
2 | ["1", "41", "25", "17", "34", "20", "14","27", "16", "11","17", "10", "7"],
3 | ["2", "77", "47", "32", "63", "38", "26", "48", "29", "20", "34", "20", "14"],
4 | ["3", "127", "77", "53", "101", "61", "42", "77", "47", "32", "58", "35", "24"],
5 | ["4", "187", "114", "78", "149", "90", "62", "111", "67", "46", "82", "50", "34"],
6 | ["5", "255", "154", "106", "202", "122", "84", "144", "87", "60", "106", "64", "44"],
7 | ["6", "322", "195", "134", "255", "154", "106", "178", "108", "74", "139", "84", "58"],
8 | ["7", "370", "224", "154", "293", "178", "122", "207", "125", "86", "154", "93", "64"],
9 | ["8", "461", "279", "192", "365", "221", "152", "259", "157", "108", "202", "122", "84"],
10 | ["9", "552", "335", "230", "432", "262", "180", "312", "189", "130", "235", "143", "98"],
11 | ["10", "652", "395", "271", "513", "311", "213", "364", "221", "151", "288", "174", "119"],
12 | ["11", "772", "468", "321", "604", "366", "251", "427", "259", "177", "331", "200", "137"],
13 | ["12", "883", "535", "367", "691", "419", "287", "489", "296", "203", "374", "227", "155"],
14 | ["13", "1022", "619", "425", "796", "483", "331", "580", "352", "241", "427", "259", "177"],
15 | ["14", "1101", "667", "458", "871", "528", "362", "621", "376", "258", "468", "283", "194"],
16 | ["15", "1250", "758", "520", "991", "600", "412", "703", "426", "292", "530", "321", "220"],
17 | ["16", "1408", "854", "586", "1082", "656", "450", "775", "470", "322", "602", "365", "250"],
18 | ["17", "1548", "938", "644", "1212", "734", "504", "876", "531", "364", "674", "408", "280"],
19 | ["18", "1725", "1046", "718", "1346", "816", "560", "948", "574", "394", "746", "452", "310"],
20 | ["19", "1903", "1153", "792", "1500", "909", "624", "1063", "644", "442", "813", "493", "338"],
21 | ["20", "2061", "1249", "858", "1600", "970", "666", "1159", "702", "482", "919", "557", "382"],
22 | ["21", "2232", "1352", "929", "1708", "1035", "711", "1224", "742", "509", "969", "587", "403"],
23 | ["22", "2409", "1460", "1003", "1872", "1134", "779", "1358", "823", "565", "1056", "640", "439"],
24 | ["23", "2620", "1588", "1091", "2059", "1248", "857", "1468", "890", "611", "1108", "672", "461"],
25 | ["24", "2812", "1704", "1171", "2188", "1326", "911", "1588", "963", "661", "1228", "744", "511"],
26 | ["25", "3057", "1853", "1273", "2395", "1451", "997", "1718", "1041", "715", "1286", "779", "535"],
27 | ["26", "3283", "1990", "1367", "2544", "1542", "1059", "1804", "1094", "751", "1425", "864", "593"],
28 | ["27", "3517", "2132", "1465", "2701", "1637", "1125", "1933", "1172", "805", "1501", "910", "625"],
29 | ["28", "3669", "2223", "1528", "2857", "1732", "1190", "2085", "1263", "868", "1581", "958", "658"],
30 | ["29", "3909", "2369", "1628", "3035", "1839", "1264", "2181", "1322", "908", "1677", "1016", "698"],
31 | ["30", "4158", "2520", "1732", "3289", "1994", "1370", "2358", "1429", "982", "1782", "1080", "742"],
32 | ["31", "4417", "2677", "1840", "3486", "2113", "1452", "2473", "1499", "1030", "1897", "1150", "790"],
33 | ["32", "4686", "2840", "1952", "3693", "2238", "1538", "2670", "1618", "1112", "2022", "1226", "842"],
34 | ["33", "4965", "3009", "2068", "3909", "2369", "1628", "2805", "1700", "1168", "2157", "1307", "898"],
35 | ["34", "5253", "3183", "2188", "4134", "2506", "1722", "2949", "1787", "1228", "2301", "1394", "958"],
36 | ["35", "5529", "3351", "2303", "4343", "2632", "1809", "3081", "1867", "1283", "2361", "1431", "983"],
37 | ["36", "5836", "3537", "2431", "4588", "2780", "1911", "3244", "1966", "1351", "2524", "1530", "1051"],
38 | ["37", "6153", "3729", "2563", "4775", "2894", "1989", "3417", "2071", "1423", "2625", "1591", "1093"],
39 | ["38", "6479", "3927", "2699", "5039", "3054", "2099", "3599", "2181", "1499", "2735", "1658", "1139"],
40 | ["39", "6743", "4087", "2809", "5313", "3220", "2213", "3791", "2298", "1579", "2927", "1774", "1219"],
41 | ["40", "7089", "4296", "2953", "5596", "3391", "2331", "3993", "2420", "1663", "3057", "1852", "1273"],
42 | ]
43 | Template = '''
44 | %s |
45 | %s |
46 | LOW | %s | %s | %s |
47 |
48 |
49 | MEDIUM | %s | %s | %s |
50 |
51 |
52 | QUARTILE | %s | %s | %s |
53 |
54 |
55 | HIGH | %s | %s | %s |
56 |
'''
57 |
58 | for data in Data:
59 | data = data[:]
60 | size = 4 * int(data[0]) + 17
61 | data.insert(1, "%d x %d" % (size, size))
62 | print Template % tuple(data)
63 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/QRCode/keywords.txt:
--------------------------------------------------------------------------------
1 |
2 | # Datatypes (KEYWORD1)
3 |
4 | bool KEYWORD1
5 | uint8_t KEYWORD1
6 | QRCode KEYWORD1
7 |
8 |
9 | # Methods and Functions (KEYWORD2)
10 |
11 | qrcode_getBufferSize KEYWORD2
12 | qrcode_initText KEYWORD2
13 | qrcode_initBytes KEYWORD2
14 | qrcode_getModule KEYWORD2
15 |
16 |
17 | # Instances (KEYWORD2)
18 |
19 |
20 | # Constants (LITERAL1)
21 |
22 | false LITERAL1
23 | true LITERAL1
24 |
25 | ECC_LOW LITERAL1
26 | ECC_MEDIUM LITERAL1
27 | ECC_QUARTILE LITERAL1
28 | ECC_HIGH LITERAL1
29 | MODE_NUMERIC LITERAL1
30 | MODE_ALPHANUMERIC LITERAL1
31 | MODE_BYTE LITERAL1
32 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/QRCode/library.properties:
--------------------------------------------------------------------------------
1 | name=QRCode
2 | version=0.0.1
3 | author=Richard Moore
4 | maintainer=Richard Moore
5 | sentence=A simple QR code generation library.
6 | paragraph=A simple QR code generation library.
7 | category=Other
8 | url=https://github.com/ricmoo/qrcode/
9 | architectures=*
10 | includes=qrcode.h
11 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/QRCode/src/qrcode.h:
--------------------------------------------------------------------------------
1 | /**
2 | * The MIT License (MIT)
3 | *
4 | * This library is written and maintained by Richard Moore.
5 | * Major parts were derived from Project Nayuki's library.
6 | *
7 | * Copyright (c) 2017 Richard Moore (https://github.com/ricmoo/QRCode)
8 | * Copyright (c) 2017 Project Nayuki (https://www.nayuki.io/page/qr-code-generator-library)
9 | *
10 | * Permission is hereby granted, free of charge, to any person obtaining a copy
11 | * of this software and associated documentation files (the "Software"), to deal
12 | * in the Software without restriction, including without limitation the rights
13 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14 | * copies of the Software, and to permit persons to whom the Software is
15 | * furnished to do so, subject to the following conditions:
16 | *
17 | * The above copyright notice and this permission notice shall be included in
18 | * all copies or substantial portions of the Software.
19 | *
20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
26 | * THE SOFTWARE.
27 | */
28 |
29 | /**
30 | * Special thanks to Nayuki (https://www.nayuki.io/) from which this library was
31 | * heavily inspired and compared against.
32 | *
33 | * See: https://github.com/nayuki/QR-Code-generator/tree/master/cpp
34 | */
35 |
36 |
37 | #ifndef __QRCODE_H_
38 | #define __QRCODE_H_
39 |
40 | #ifndef __cplusplus
41 | typedef unsigned char bool;
42 | static const bool false = 0;
43 | static const bool true = 1;
44 | #endif
45 |
46 | #include
47 |
48 |
49 | // QR Code Format Encoding
50 | #define MODE_NUMERIC 0
51 | #define MODE_ALPHANUMERIC 1
52 | #define MODE_BYTE 2
53 |
54 |
55 | // Error Correction Code Levels
56 | #define ECC_LOW 0
57 | #define ECC_MEDIUM 1
58 | #define ECC_QUARTILE 2
59 | #define ECC_HIGH 3
60 |
61 |
62 | // If set to non-zero, this library can ONLY produce QR codes at that version
63 | // This saves a lot of dynamic memory, as the codeword tables are skipped
64 | #ifndef LOCK_VERSION
65 | #define LOCK_VERSION 0
66 | #endif
67 |
68 |
69 | typedef struct QRCode {
70 | uint8_t version;
71 | uint8_t size;
72 | uint8_t ecc;
73 | uint8_t mode;
74 | uint8_t mask;
75 | uint8_t *modules;
76 | } QRCode;
77 |
78 |
79 | #ifdef __cplusplus
80 | extern "C"{
81 | #endif /* __cplusplus */
82 |
83 |
84 |
85 | uint16_t qrcode_getBufferSize(uint8_t version);
86 |
87 | int8_t qrcode_initText(QRCode *qrcode, uint8_t *modules, uint8_t version, uint8_t ecc, const char *data);
88 | int8_t qrcode_initBytes(QRCode *qrcode, uint8_t *modules, uint8_t version, uint8_t ecc, uint8_t *data, uint16_t length);
89 |
90 | bool qrcode_getModule(QRCode *qrcode, uint8_t x, uint8_t y);
91 |
92 |
93 |
94 | #ifdef __cplusplus
95 | }
96 | #endif /* __cplusplus */
97 |
98 |
99 | #endif /* __QRCODE_H_ */
100 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/QRCode/tests/BitBuffer.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * QR Code generator library (C++)
3 | *
4 | * Copyright (c) Project Nayuki
5 | * https://www.nayuki.io/page/qr-code-generator-library
6 | *
7 | * (MIT License)
8 | * Permission is hereby granted, free of charge, to any person obtaining a copy of
9 | * this software and associated documentation files (the "Software"), to deal in
10 | * the Software without restriction, including without limitation the rights to
11 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
12 | * the Software, and to permit persons to whom the Software is furnished to do so,
13 | * subject to the following conditions:
14 | * - The above copyright notice and this permission notice shall be included in
15 | * all copies or substantial portions of the Software.
16 | * - The Software is provided "as is", without warranty of any kind, express or
17 | * implied, including but not limited to the warranties of merchantability,
18 | * fitness for a particular purpose and noninfringement. In no event shall the
19 | * authors or copyright holders be liable for any claim, damages or other
20 | * liability, whether in an action of contract, tort or otherwise, arising from,
21 | * out of or in connection with the Software or the use or other dealings in the
22 | * Software.
23 | */
24 |
25 | #include
26 | #include "BitBuffer.hpp"
27 |
28 |
29 | qrcodegen::BitBuffer::BitBuffer() :
30 | data(),
31 | bitLength(0) {}
32 |
33 |
34 | int qrcodegen::BitBuffer::getBitLength() const {
35 | return bitLength;
36 | }
37 |
38 |
39 | std::vector qrcodegen::BitBuffer::getBytes() const {
40 | return data;
41 | }
42 |
43 |
44 | void qrcodegen::BitBuffer::appendBits(uint32_t val, int len) {
45 | if (len < 0 || len > 32 || (len < 32 && (val >> len) != 0))
46 | throw "Value out of range";
47 | size_t newBitLen = bitLength + len;
48 | while (data.size() * 8 < newBitLen)
49 | data.push_back(0);
50 | for (int i = len - 1; i >= 0; i--, bitLength++) // Append bit by bit
51 | data.at(bitLength >> 3) |= ((val >> i) & 1) << (7 - (bitLength & 7));
52 | }
53 |
54 |
55 | void qrcodegen::BitBuffer::appendData(const QrSegment &seg) {
56 | size_t newBitLen = bitLength + seg.bitLength;
57 | while (data.size() * 8 < newBitLen)
58 | data.push_back(0);
59 | for (int i = 0; i < seg.bitLength; i++, bitLength++) { // Append bit by bit
60 | int bit = (seg.data.at(i >> 3) >> (7 - (i & 7))) & 1;
61 | data.at(bitLength >> 3) |= bit << (7 - (bitLength & 7));
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/QRCode/tests/BitBuffer.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * QR Code generator library (C++)
3 | *
4 | * Copyright (c) Project Nayuki
5 | * https://www.nayuki.io/page/qr-code-generator-library
6 | *
7 | * (MIT License)
8 | * Permission is hereby granted, free of charge, to any person obtaining a copy of
9 | * this software and associated documentation files (the "Software"), to deal in
10 | * the Software without restriction, including without limitation the rights to
11 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
12 | * the Software, and to permit persons to whom the Software is furnished to do so,
13 | * subject to the following conditions:
14 | * - The above copyright notice and this permission notice shall be included in
15 | * all copies or substantial portions of the Software.
16 | * - The Software is provided "as is", without warranty of any kind, express or
17 | * implied, including but not limited to the warranties of merchantability,
18 | * fitness for a particular purpose and noninfringement. In no event shall the
19 | * authors or copyright holders be liable for any claim, damages or other
20 | * liability, whether in an action of contract, tort or otherwise, arising from,
21 | * out of or in connection with the Software or the use or other dealings in the
22 | * Software.
23 | */
24 |
25 | #pragma once
26 |
27 | #include
28 | #include
29 | #include "QrSegment.hpp"
30 |
31 |
32 | namespace qrcodegen {
33 |
34 | /*
35 | * An appendable sequence of bits. Bits are packed in big endian within a byte.
36 | */
37 | class BitBuffer {
38 |
39 | /*---- Fields ----*/
40 | private:
41 |
42 | std::vector data;
43 | int bitLength;
44 |
45 |
46 |
47 | /*---- Constructor ----*/
48 | public:
49 |
50 | // Creates an empty bit buffer (length 0).
51 | BitBuffer();
52 |
53 |
54 |
55 | /*---- Methods ----*/
56 | public:
57 |
58 | // Returns the number of bits in the buffer, which is a non-negative value.
59 | int getBitLength() const;
60 |
61 |
62 | // Returns a copy of all bytes, padding up to the nearest byte.
63 | std::vector getBytes() const;
64 |
65 |
66 | // Appends the given number of bits of the given value to this sequence.
67 | // If 0 <= len <= 31, then this requires 0 <= val < 2^len.
68 | void appendBits(uint32_t val, int len);
69 |
70 |
71 | // Appends the data of the given segment to this bit buffer.
72 | void appendData(const QrSegment &seg);
73 |
74 | };
75 |
76 | }
77 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/QRCode/tests/README.md:
--------------------------------------------------------------------------------
1 | Testing
2 | =======
3 |
4 | The testcases work by using the Nayuki QR code generating library, generating a QR code
5 | in both libraries and comparing them.
6 |
7 | Running
8 | -------
9 |
10 | ```
11 | ./run.sh
12 | ```
13 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/QRCode/tests/run-tests.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | #include "../src/qrcode.h"
5 | #include "QrCode.hpp"
6 |
7 | static uint32_t check(const qrcodegen::QrCode &nayuki, QRCode *ricmoo) {
8 | uint32_t wrong = 0;
9 |
10 | if (nayuki.size != ricmoo->size) { wrong += (1 << 20); }
11 |
12 | int border = 4;
13 | for (int y = -border; y < nayuki.size + border; y++) {
14 | for (int x = -border; x < nayuki.size + border; x++) {
15 | if (!!nayuki.getModule(x, y) != qrcode_getModule(ricmoo, x, y)) {
16 | wrong++;
17 | }
18 | }
19 | }
20 |
21 | return wrong;
22 | }
23 |
24 | int main() {
25 | std::clock_t t0, totalNayuki, totalRicMoo;
26 |
27 | int total = 0, passed = 0;
28 | for (char version = 1; version <= 40; version++) {
29 | if (LOCK_VERSION != 0 && LOCK_VERSION != version) { continue; }
30 |
31 | for (char ecc = 0; ecc < 4; ecc++) {
32 | const qrcodegen::QrCode::Ecc *errCorLvl;
33 | switch (ecc) {
34 | case 0:
35 | errCorLvl = &qrcodegen::QrCode::Ecc::LOW;
36 | break;
37 | case 1:
38 | errCorLvl = &qrcodegen::QrCode::Ecc::MEDIUM;
39 | break;
40 | case 2:
41 | errCorLvl = &qrcodegen::QrCode::Ecc::QUARTILE;
42 | break;
43 | case 3:
44 | errCorLvl = &qrcodegen::QrCode::Ecc::HIGH;
45 | break;
46 | }
47 |
48 | for (char tc = 0; tc < 3; tc++) {
49 | char *data;
50 | switch(tc) {
51 | case 0:
52 | data = (char*)"HELLO";
53 | break;
54 | case 1:
55 | data = (char*)"Hello";
56 | break;
57 | case 2:
58 | data = (char*)"1234";
59 | break;
60 | }
61 | t0 = std::clock();
62 | const qrcodegen::QrCode nayuki = qrcodegen::QrCode::encodeText(data, version, *errCorLvl);
63 | totalNayuki += std::clock() - t0;
64 |
65 | t0 = std::clock();
66 | QRCode ricmoo;
67 | uint8_t ricmooBytes[qrcode_getBufferSize(version)];
68 | qrcode_initText(&ricmoo, ricmooBytes, version, ecc, data);
69 | totalRicMoo += std::clock() - t0;
70 |
71 | uint32_t badModules = check(nayuki, &ricmoo);
72 | if (badModules) {
73 | printf("Failed test case: version=%d, ecc=%d, data=\"%s\", faliured=%d\n", version, ecc, data, badModules);
74 | } else {
75 | passed++;
76 | }
77 |
78 | total++;
79 | }
80 | }
81 | }
82 |
83 | printf("Tests complete: %d passed (out of %d)\n", passed, total);
84 | printf("Timing: Nayuki=%lu, RicMoo=%lu\n", totalNayuki, totalRicMoo);
85 | }
86 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/QRCode/tests/run.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | clang++ run-tests.cpp QrCode.cpp QrSegment.cpp BitBuffer.cpp ../src/qrcode.c -o test && ./test
4 | clang++ run-tests.cpp QrCode.cpp QrSegment.cpp BitBuffer.cpp ../src/qrcode.c -o test -D LOCK_VERSION=3 && ./test
5 |
6 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/README:
--------------------------------------------------------------------------------
1 |
2 | This directory is intended for project specific (private) libraries.
3 | PlatformIO will compile them to static libraries and link into executable file.
4 |
5 | The source code of each library should be placed in a an own separate directory
6 | ("lib/your_library_name/[here are source files]").
7 |
8 | For example, see a structure of the following two libraries `Foo` and `Bar`:
9 |
10 | |--lib
11 | | |
12 | | |--Bar
13 | | | |--docs
14 | | | |--examples
15 | | | |--src
16 | | | |- Bar.c
17 | | | |- Bar.h
18 | | | |- library.json (optional, custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html
19 | | |
20 | | |--Foo
21 | | | |- Foo.c
22 | | | |- Foo.h
23 | | |
24 | | |- README --> THIS FILE
25 | |
26 | |- platformio.ini
27 | |--src
28 | |- main.c
29 |
30 | and a contents of `src/main.c`:
31 | ```
32 | #include
33 | #include
34 |
35 | int main (void)
36 | {
37 | ...
38 | }
39 |
40 | ```
41 |
42 | PlatformIO Library Dependency Finder will find automatically dependent
43 | libraries scanning project source files.
44 |
45 | More information about PlatformIO Library Dependency Finder
46 | - https://docs.platformio.org/page/librarymanager/ldf.html
47 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/Shell/examples/Shell_Basic/Shell_Basic.ino:
--------------------------------------------------------------------------------
1 | /**
2 | * GeekFactory - "Construye tu propia tecnologia"
3 | * Distribucion de materiales para el desarrollo e innovacion tecnologica
4 | * www.geekfactory.mx
5 | *
6 | * Ejemplo de libreria Shell. Este ejemplo representa la configuracion minima
7 | * requerida para implementar la funcionalidad de interfaz de comandos. En esta
8 | * ocasion registramos 2 comandos y enviamos texto como respuesta a cada uno.
9 | *
10 | * Example for Shell library. This example shows the minimum setup needed to
11 | * implement a command line interface. This time we register 2 commands and we
12 | * send text as response for each command.
13 | */
14 |
15 | #include
16 |
17 | void setup()
18 | {
19 | // Prepare serial communication
20 | Serial.begin(9600);
21 | // Wait after reset or power on...
22 | delay(1000);
23 |
24 | // Initialize command line interface (CLI)
25 | // We pass the function pointers to the read and write functions that we implement below
26 | // We can also pass a char pointer to display a custom start message
27 | shell_init(shell_reader, shell_writer, 0);
28 |
29 | // Add commands to the shell
30 | shell_register(command_mycommand, PSTR("mycommand"));
31 | shell_register(command_othercommand, PSTR("othercommand"));
32 | }
33 |
34 | void loop()
35 | {
36 | // This should always be called to process user input
37 | shell_task();
38 | }
39 |
40 | /**
41 | * Test commands: The commands should always use this function prototype.
42 | * They receive 2 parameters: The total count of arguments (argc) and a pointer
43 | * to the begining of each one of the null-terminated argument strings.
44 | *
45 | * In this example we ignore the parameters passed to the functions
46 | */
47 | int command_mycommand(int argc, char** argv)
48 | {
49 | shell_println("Running \"mycommand\" now");
50 | shell_println("Exit...");
51 | return SHELL_RET_SUCCESS;
52 | }
53 |
54 | int command_othercommand(int argc, char** argv)
55 | {
56 | shell_println("Running \"othercommand\" now");
57 | shell_println("Exit...");
58 | return SHELL_RET_SUCCESS;
59 | }
60 |
61 | /**
62 | * Function to read data from serial port
63 | * Functions to read from physical media should use this prototype:
64 | * int my_reader_function(char * data)
65 | */
66 | int shell_reader(char * data)
67 | {
68 | // Wrapper for Serial.read() method
69 | if (Serial.available()) {
70 | *data = Serial.read();
71 | return 1;
72 | }
73 | return 0;
74 | }
75 |
76 | /**
77 | * Function to write data to serial port
78 | * Functions to write to physical media should use this prototype:
79 | * void my_writer_function(char data)
80 | */
81 | void shell_writer(char data)
82 | {
83 | // Wrapper for Serial.write() method
84 | Serial.write(data);
85 | }
86 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/Shell/examples/Shell_Command_Args/Shell_Command_Args.ino:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peng-zhihui/OpenHeat/db5a055e7a26242cbcab9cbef24936952850b85a/2.Firmware/OpenHeat-fw/lib/Shell/examples/Shell_Command_Args/Shell_Command_Args.ino
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/Shell/examples/Shell_Minimum/Shell_Minimum.ino:
--------------------------------------------------------------------------------
1 | /**
2 | * GeekFactory - "Construye tu propia tecnologia"
3 | * Distribucion de materiales para el desarrollo e innovacion tecnologica
4 | * www.geekfactory.mx
5 | *
6 | * Ejemplo de libreria Shell. Este ejemplo representa la configuracion minima
7 | * requerida para implementar la funcionalidad de interfaz de comandos.
8 | *
9 | * Example for Shell library. This example shows the minimum setup needed to
10 | * implement a command line interface.
11 | */
12 |
13 | #include
14 |
15 | void setup()
16 | {
17 | // Prepare serial communication
18 | Serial.begin(9600);
19 | // Wait after reset or power on...
20 | delay(1000);
21 |
22 | // Initialize command line interface (CLI)
23 | // We pass the function pointers to the read and write functions that we implement below
24 | // We can also pass a char pointer to display a custom start message
25 | shell_init(shell_reader, shell_writer, 0);
26 |
27 | // Add commands to the shell
28 | shell_register(command_example, PSTR("example"));
29 | }
30 |
31 | void loop()
32 | {
33 | // This should always be called to process user input
34 | shell_task();
35 | }
36 |
37 | int command_example(int argc, char** argv)
38 | {
39 | // Do something here...
40 |
41 | // And exit
42 | return SHELL_RET_SUCCESS;
43 | }
44 |
45 | /**
46 | * Function to read data from serial port
47 | * Functions to read from physical media should use this prototype:
48 | * int my_reader_function(char * data)
49 | */
50 | int shell_reader(char * data)
51 | {
52 | // Wrapper for Serial.read() method
53 | if (Serial.available()) {
54 | *data = Serial.read();
55 | return 1;
56 | }
57 | return 0;
58 | }
59 |
60 | /**
61 | * Function to write data to serial port
62 | * Functions to write to physical media should use this prototype:
63 | * void my_writer_function(char data)
64 | */
65 | void shell_writer(char data)
66 | {
67 | // Wrapper for Serial.write() method
68 | Serial.write(data);
69 | }
70 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/Shell/examples/Shell_RGB_Control/Shell_RGB_Control.ino:
--------------------------------------------------------------------------------
1 | /**
2 | * GeekFactory - "Construye tu propia tecnologia"
3 | * Distribucion de materiales para el desarrollo e innovacion tecnologica
4 | * www.geekfactory.mx
5 | *
6 | * Ejemplo de libreria Shell. Este ejemplo permite controlar el color mostrado
7 | * en un led RGB conectado a los pines PWM mediante comandos de texto. El programa
8 | * admite 3 parametros de 0 a 255 que representan la intensidad de cada led (RGB).
9 | *
10 | * Example for Shell library. This example controls the color displayed on the RGB
11 | * led connected to PWM pins using text commands. The program accepts 3 parameters
12 | * in a range from 0 to 255 that represent the intensity of each led.
13 | */
14 |
15 | #include
16 |
17 | void setup()
18 | {
19 | // Prepare serial communication
20 | Serial.begin(9600);
21 | // Wait after reset or power on...
22 | delay(1000);
23 |
24 | // Pins to connect RGB led (PWM outputs)
25 | pinMode(3,OUTPUT);
26 | pinMode(5,OUTPUT);
27 | pinMode(6,OUTPUT);
28 | pinMode(9,OUTPUT);
29 |
30 | // Initialize command line interface (CLI)
31 | // We pass the function pointers to the read and write functions that we implement below
32 | // We can also pass a char pointer to display a custom start message
33 | shell_init(shell_reader, shell_writer, 0);
34 |
35 | // Add commands to the shell
36 | shell_register(command_rgbled, PSTR("rgbled"));
37 | }
38 |
39 | void loop()
40 | {
41 | // This should always be called to process user input
42 | shell_task();
43 | }
44 |
45 | /**
46 | * This function implements the rgbled command and parses the required args
47 | * Type: rgbled 255 255 255 to set led to maximum brigtness
48 | * Type: rgbled 0 0 0 to set led to minimum brightess
49 | */
50 | int command_rgbled(int argc, char** argv)
51 | {
52 | // Variables that store parameter values
53 | uint8_t val_R, val_G, val_B;
54 |
55 | // Parse RGB values and write to PWM pins
56 | val_R = strtol(argv[1],NULL,0);
57 | analogWrite(3, val_R);
58 |
59 | val_G = strtol(argv[2],NULL,0);
60 | analogWrite(5, val_G);
61 |
62 | val_B = strtol(argv[3],NULL,0);
63 | analogWrite(6, val_B);
64 |
65 | val_B = strtol(argv[4],NULL,0);
66 | analogWrite(9, val_B);
67 |
68 | // Print the received falues to the terminal screen
69 | shell_printf("#RGB-COMPONENTS:%d,%d,%d\r\n", val_R, val_G, val_B);
70 |
71 | // Return success code
72 | return SHELL_RET_SUCCESS;
73 | }
74 |
75 | /**
76 | * Function to read data from serial port
77 | * Functions to read from physical media should use this prototype:
78 | * int my_reader_function(char * data)
79 | */
80 | int shell_reader(char * data)
81 | {
82 | // Wrapper for Serial.read() method
83 | if (Serial.available()) {
84 | *data = Serial.read();
85 | return 1;
86 | }
87 | return 0;
88 | }
89 |
90 | /**
91 | * Function to write data to serial port
92 | * Functions to write to physical media should use this prototype:
93 | * void my_writer_function(char data)
94 | */
95 | void shell_writer(char data)
96 | {
97 | // Wrapper for Serial.write() method
98 | Serial.write(data);
99 | }
100 |
101 |
102 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/Shell/examples/Shell_Telnet/Shell_Telnet.ino:
--------------------------------------------------------------------------------
1 | /**
2 | * GeekFactory - "Construye tu propia tecnologia"
3 | * Distribucion de materiales para el desarrollo e innovacion tecnologica
4 | * www.geekfactory.mx
5 | *
6 | * Ejemplo de libreria Shell. Este ejemplo permite controlar el color mostrado
7 | * en un led RGB conectado a los pines PWM mediante comandos de texto. El programa
8 | * admite 3 parametros de 0 a 255 que representan la intensidad de cada led (RGB).
9 | * Esta version del programa permite el control remoto a traves de un shield Ethernet
10 | * y demuestra la capacidad de la libreria para redirigir la entrada y salida de datos
11 | * desde y hacia cualquier medio.
12 | *
13 | * Example for Shell library. This example controls the color displayed on the RGB
14 | * led connected to PWM pins using text commands. The program accepts 3 parameters
15 | * in a range from 0 to 255 that represent the intensity of each led.
16 | * This version of the program allows the remote control through the Ethernet Shield
17 | * and shows the capacity of the library to redirect data input and output to any
18 | * physical medium.
19 | */
20 |
21 | #include
22 | #include
23 | #include
24 |
25 | // Ethernet and TCP/IP protocol configuration
26 | byte mac[] = {
27 | 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
28 |
29 | byte ip[] = {
30 | 192, 168, 1, 177 };
31 |
32 | byte gateway[] = {
33 | 192, 168, 1, 254 };
34 |
35 | byte subnet[] = {
36 | 255, 255, 255, 0 };
37 |
38 | // Create the server instance on port 23 (default port for telnet protocol)
39 | EthernetServer server = EthernetServer(23);
40 | // The client that is willing to connect to server
41 | EthernetClient client;
42 |
43 |
44 | void setup()
45 | {
46 | // Prepare serial communication
47 | Serial.begin(9600);
48 | // Setup ethernet shield
49 | Ethernet.begin(mac, ip, gateway, subnet);
50 | // Start TCP Server on port 23
51 | server.begin();
52 | // Wait after reset or power on...
53 | delay(1000);
54 |
55 | // Pins to connect RGB led (PWM outputs)
56 | pinMode(3,OUTPUT);
57 | pinMode(5,OUTPUT);
58 | pinMode(6,OUTPUT);
59 |
60 | // Initialize command line interface (CLI)
61 | // We pass the function pointers to the read and write functions that we implement below
62 | // We can also pass a char pointer to display a custom start message
63 | shell_init(shell_reader, shell_writer, 0);
64 |
65 | // Add commands to the shell
66 | shell_register(command_rgbled, PSTR("rgbled"));
67 |
68 | }
69 |
70 | void loop()
71 | {
72 | // Check if a client is willing to connect and get client object
73 | client = server.available();
74 | // This should always be called to process user input
75 | shell_task();
76 | }
77 |
78 | /**
79 | * This function implements the rgbled command and parses the required args
80 | * Type: rgbled 255 255 255 to set led to maximum brigtness
81 | * Type: rgbled 0 0 0 to set led to minimum brightess
82 | */
83 | int command_rgbled(int argc, char** argv)
84 | {
85 | // Variables that store parameter values
86 | uint8_t val_R, val_G, val_B;
87 |
88 | // Parse RGB values and write to PWM pins
89 | val_R = strtol(argv[1],NULL,0);
90 | analogWrite(3, val_R);
91 |
92 | val_G = strtol(argv[2],NULL,0);
93 | analogWrite(5, val_G);
94 |
95 | val_B = strtol(argv[3],NULL,0);
96 | analogWrite(6, val_B);
97 |
98 | // Print the received falues to the terminal screen
99 | shell_printf("#RGB-COMPONENTS:%d,%d,%d\r\n", val_R, val_G, val_B);
100 |
101 | // Return success code
102 | return SHELL_RET_SUCCESS;
103 | }
104 |
105 | /**
106 | * Function to read data from serial port
107 | * Functions to read from physical media should use this prototype:
108 | * int my_reader_function(char * data)
109 | */
110 | int shell_reader(char * data)
111 | {
112 | int ret = 0;
113 | // If a client is available and it´s connected
114 | if (client==true && client.connected()) {
115 | // Client has data?
116 | if (client.available()) {
117 | // Read data from client
118 | *data = client.read();
119 | ret = 1;
120 | }
121 | }
122 | else
123 | {
124 | client.stop();
125 | }
126 | return ret;
127 | }
128 |
129 | /**
130 | * Function to write data to serial port
131 | * Functions to write to physical media should use this prototype:
132 | * void my_writer_function(char data)
133 | */
134 | void shell_writer(char data)
135 | {
136 | // If we can write to a client
137 | if(client==true && client.connected())
138 | {
139 | // Wrapper for Serial.write() method
140 | client.write(data);
141 | }
142 | }
143 |
144 |
145 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/Shell/keywords.txt:
--------------------------------------------------------------------------------
1 | #######################################
2 | # Syntax Coloring Map for Shell
3 | #######################################
4 |
5 | #######################################
6 | # Datatypes (KEYWORD1)
7 | #######################################
8 |
9 | #######################################
10 | # Methods and Functions (KEYWORD2)
11 | #######################################
12 | shell_init KEYWORD2
13 | shell_use_buffered_output KEYWORD2
14 | shell_register KEYWORD2
15 | shell_unregister_all KEYWORD2
16 | shell_putc KEYWORD2
17 | shell_print KEYWORD2
18 | shell_println KEYWORD2
19 | shell_printf KEYWORD2
20 | shell_print_commands KEYWORD2
21 | shell_print_error KEYWORD2
22 | shell_task KEYWORD2
23 | shell_print_pm KEYWORD2
24 | shell_println_pm KEYWORD2
25 | shell_printf_pm KEYWORD2
26 |
27 | #######################################
28 | # Instances (KEYWORD2)
29 | #######################################
30 |
31 | #######################################
32 | # Constants (LITERAL1)
33 | #######################################
34 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/Shell/library.properties:
--------------------------------------------------------------------------------
1 | name=GeekFactory Shell Library
2 | version=1.2.0
3 | author=www.geekfactory.mx
4 | maintainer=Jesus Ruben Santa Anna Zamudio
5 | sentence=Library to create a simple Command Line Interface (CLI).
6 | paragraph=This library allows the user to control the device using simple text commands, the library is written in pure C so it can be easily ported to other microcontrollers.
7 | category=Communication
8 | url=https://github.com/geekfactory/Shell
9 | architectures=*
10 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/U8g2/LICENSE:
--------------------------------------------------------------------------------
1 |
2 | The U8g2lib code (http://code.google.com/p/u8g2/ and
3 | https://github.com/olikraus/U8g2_Arduino) is licensed under the terms of
4 | the new-bsd license (two-clause bsd license).
5 | See also: http://www.opensource.org/licenses/bsd-license.php
6 |
7 | The repository and optionally the releases contain icons, which are
8 | derived from the WPZOOM Developer Icon Set:
9 | http://www.wpzoom.com/wpzoom/new-freebie-wpzoom-developer-icon-set-154-free-icons/
10 | WPZOOM Developer Icon Set by WPZOOM is licensed under a Creative Commons
11 | Attribution-ShareAlike 3.0 Unported License.
12 |
13 | Fonts are licensed under different conditions.
14 | See
15 | https://github.com/olikraus/u8g2/wiki/fntgrp
16 | for detailed information on the licensing conditions for each font.
17 |
18 | ============ X11 Fonts COUR, HELV, NCEN, TIM, SYMB ============
19 |
20 | For fonts derived from the following files, the license below applies.
21 | COURB08.BDF COURB10.BDF COURB12.BDF COURB14.BDF COURB18.BDF
22 | COURB24.BDF COURR08.BDF COURR10.BDF COURR12.BDF COURR14.BDF
23 | COURR18.BDF COURR24.BDF HELVB08.BDF HELVB10.BDF HELVB12.BDF HELVB14.BDF
24 | HELVB18.BDF HELVB24.BDF HELVR08.BDF HELVR10.BDF HELVR12.BDF HELVR14.BDF
25 | HELVR18.BDF HELVR24.BDF NCENB08.BDF NCENB10.BDF NCENB12.BDF
26 | NCENB14.BDF NCENB18.BDF NCENB24.BDF NCENR08.BDF NCENR10.BDF
27 | NCENR12.BDF NCENR14.BDF NCENR18.BDF NCENR24.BDF SYMB08.BDF SYMB10.BDF
28 | SYMB12.BDF SYMB14.BDF SYMB18.BDF SYMB24.BDF TIMB08.BDF TIMB10.BDF
29 | TIMB12.BDF TIMB14.BDF TIMB18.BDF TIMB24.BDF TIMR08.BDF TIMR10.BDF
30 | TIMR12.BDF TIMR14.BDF TIMR18.BDF TIMR24.BDF
31 |
32 | Copyright 1984-1989, 1994 Adobe Systems Incorporated.
33 | Copyright 1988, 1994 Digital Equipment Corporation.
34 |
35 | Adobe is a trademark of Adobe Systems Incorporated which may be
36 | registered in certain jurisdictions.
37 | Permission to use these trademarks is hereby granted only in
38 | association with the images described in this file.
39 |
40 | Permission to use, copy, modify, distribute and sell this software
41 | and its documentation for any purpose and without fee is hereby
42 | granted, provided that the above copyright notices appear in all
43 | copies and that both those copyright notices and this permission
44 | notice appear in supporting documentation, and that the names of
45 | Adobe Systems and Digital Equipment Corporation not be used in
46 | advertising or publicity pertaining to distribution of the software
47 | without specific, written prior permission. Adobe Systems and
48 | Digital Equipment Corporation make no representations about the
49 | suitability of this software for any purpose. It is provided "as
50 | is" without express or implied warranty.
51 |
52 |
53 | ============ BSD License for U8g2lib Code ============
54 |
55 | Universal 8bit Graphics Library (http://code.google.com/p/u8g2/ and
56 | https://github.com/olikraus/U8g2_Arduino)
57 |
58 | Copyright (c) 2016, olikraus@gmail.com
59 | All rights reserved.
60 |
61 | Redistribution and use in source and binary forms, with or without modification,
62 | are permitted provided that the following conditions are met:
63 |
64 | * Redistributions of source code must retain the above copyright notice, this list
65 | of conditions and the following disclaimer.
66 |
67 | * Redistributions in binary form must reproduce the above copyright notice, this
68 | list of conditions and the following disclaimer in the documentation and/or other
69 | materials provided with the distribution.
70 |
71 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
72 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
73 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
74 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
75 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
76 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
77 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
78 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
79 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
80 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
81 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
82 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
83 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
84 |
85 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/U8g2/README.md:
--------------------------------------------------------------------------------
1 | # U8g2_Arduino: Arduino Monochrome Graphics Library
2 |
3 | 
4 |
5 | U8glib V2 library for Arduino
6 |
7 | Description: https://github.com/olikraus/u8g2/wiki
8 |
9 | Issue Tracker: https://github.com/olikraus/u8g2/issues
10 |
11 | Download (2.25.10): https://github.com/olikraus/U8g2_Arduino/archive/master.zip
12 |
13 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/U8g2/examples/u8x8/ArduboyTest/ArduboyTest.ino:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Arduboy.ino
4 |
5 | Arduboy Test Example with U8x8
6 |
7 | Universal 8bit Graphics Library (https://github.com/olikraus/u8g2/)
8 |
9 | Copyright (c) 2016, olikraus@gmail.com
10 | All rights reserved.
11 |
12 | Redistribution and use in source and binary forms, with or without modification,
13 | are permitted provided that the following conditions are met:
14 |
15 | * Redistributions of source code must retain the above copyright notice, this list
16 | of conditions and the following disclaimer.
17 |
18 | * Redistributions in binary form must reproduce the above copyright notice, this
19 | list of conditions and the following disclaimer in the documentation and/or other
20 | materials provided with the distribution.
21 |
22 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
23 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
24 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
25 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
27 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
29 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
32 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
34 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 |
36 | */
37 |
38 | #include
39 | #include
40 | #include
41 |
42 | #ifdef U8X8_HAVE_HW_SPI
43 | #include
44 | #endif
45 |
46 | // Arduboy 10 (Production, Kickstarter Edition)
47 | U8X8_SSD1306_128X64_NONAME_4W_HW_SPI u8x8(/* cs=*/ 12, /* dc=*/ 4, /* reset=*/ 6);
48 |
49 | ArduboyCore arduboyCore;
50 | ArduboyAudio arduboyAudio;
51 | ArduboyTunes arduboyTunes;
52 |
53 | void setup(void)
54 | {
55 | //u8x8.begin(/*Select=*/ A0, /*Right/Next=*/ 5, /*Left/Prev=*/ 9, /*Up=*/ 8, /*Down=*/ 10, /*Home/Cancel=*/ A1); // Arduboy DevKit
56 | u8x8.begin(/*Select=*/ 7, /*Right/Next=*/ A1, /*Left/Prev=*/ A2, /*Up=*/ A0, /*Down=*/ A3, /*Home/Cancel=*/ 8); // Arduboy 10 (Production)
57 |
58 | arduboyTunes.initChannel(PIN_SPEAKER_1);
59 | arduboyTunes.initChannel(PIN_SPEAKER_2);
60 | arduboyAudio.begin();
61 | }
62 |
63 | void msg(const char *txt)
64 | {
65 | u8x8.clear();
66 | u8x8.print(txt);
67 | }
68 |
69 | void loop(void)
70 | {
71 | static uint8_t c = 1;
72 | static uint8_t b = 0;
73 | u8x8.setFont(u8x8_font_chroma48medium8_r);
74 | c = u8x8.userInterfaceSelectionList("Arduboy Test\n", c, "LED Test\nButton Test\nSpeaker Test");
75 | if ( c == 1 )
76 | {
77 | msg("LED Test");
78 | arduboyCore.setRGBled(255, 0, 0);
79 | delay(500);
80 | arduboyCore.setRGBled(0, 255, 0); // green is not there ???
81 | delay(500);
82 | arduboyCore.setRGBled(0, 0, 255);
83 | delay(500);
84 | arduboyCore.setRGBled(0, 0, 0);
85 | }
86 | else if ( c == 2 )
87 | {
88 | u8x8.clear();
89 | for(;;)
90 | {
91 | u8x8.drawUTF8(0, 0, "Button Test");
92 | b = arduboyCore.buttonsState();
93 |
94 | u8x8.noInverse();
95 | if ( b & A_BUTTON )
96 | u8x8.inverse();
97 | u8x8.drawUTF8(0, 1, "A Button");
98 |
99 | u8x8.noInverse();
100 | if ( b & B_BUTTON )
101 | u8x8.inverse();
102 | u8x8.drawUTF8(0, 2, "B Button");
103 |
104 | u8x8.noInverse();
105 | if ( b & UP_BUTTON )
106 | u8x8.inverse();
107 | u8x8.drawUTF8(0, 3, "UP Button");
108 |
109 | u8x8.noInverse();
110 | if ( b & DOWN_BUTTON )
111 | u8x8.inverse();
112 | u8x8.drawUTF8(0, 4, "DOWN Button");
113 |
114 | u8x8.noInverse();
115 | if ( b & LEFT_BUTTON )
116 | u8x8.inverse();
117 | u8x8.drawUTF8(0, 5, "LEFT Button");
118 |
119 | u8x8.noInverse();
120 | if ( b & RIGHT_BUTTON )
121 | u8x8.inverse();
122 | u8x8.drawUTF8(0, 6, "RIGHT Button");
123 |
124 | u8x8.noInverse();
125 | u8x8.drawUTF8(0, 7, "Quit: A&B Button");
126 |
127 | if ( (b & A_BUTTON) && (b & B_BUTTON) )
128 | break;
129 | }
130 | }
131 | else if ( c == 3 )
132 | {
133 | u8x8.clear();
134 | u8x8.drawUTF8(0, 0, "Speaker Test");
135 | arduboyTunes.tone(1000, 1000);
136 | delay(1000);
137 | arduboyTunes.tone(2000, 1000);
138 | delay(1000);
139 | }
140 | }
141 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/U8g2/library.properties:
--------------------------------------------------------------------------------
1 | name=U8g2
2 | version=2.25.10
3 | author=oliver
4 | maintainer=oliver
5 | sentence=Monochrome LCD, OLED and eInk Library. Display controller: SSD1305, SSD1306, SSD1309, SSD1322, SSD1325, SSD1327, SSD1329, SSD1606, SSD1607, SH1106, SH1107, SH1108, SH1122, T6963, RA8835, LC7981, PCD8544, PCF8812, HX1230, UC1601, UC1604, UC1608, UC1610, UC1611, UC1701, ST7565, ST7567, ST7588, ST75256, NT7534, IST3020, ST7920, LD7032, KS0108, SED1520, SBN1661, IL3820, MAX7219. Interfaces: I2C, SPI, Parallel.
6 | paragraph=Monochrome LCD, OLED and eInk Library. Successor of U8glib. Supported display controller: SSD1305, SSD1306, SSD1309, SSD1322, SSD1325, SSD1327, SSD1329, SSD1606, SSD1607, SH1106, SH1107, SH1108, SH1122, T6963, RA8835, LC7981, PCD8544, PCF8812, HX1230, UC1601, UC1604, UC1608, UC1610, UC1611, UC1701, ST7565, ST7567, ST7588, ST75256, NT7534, IST3020, ST7920, LD7032, KS0108, SED1520, SBN1661, IL3820, MAX7219. Supported interfaces: I2C, SPI, Parallel. Features: UTF8, >700 fonts, U8x8 char output.
7 | category=Display
8 | url=https://github.com/olikraus/u8g2
9 | architectures=*
10 | license=BSD-2-Clause
11 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/U8g2/src/clib/u8g2_cleardisplay.c:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | u8g2_cleardisplay.c
4 |
5 | Universal 8bit Graphics Library (https://github.com/olikraus/u8g2/)
6 |
7 | Copyright (c) 2016, olikraus@gmail.com
8 | All rights reserved.
9 |
10 | Redistribution and use in source and binary forms, with or without modification,
11 | are permitted provided that the following conditions are met:
12 |
13 | * Redistributions of source code must retain the above copyright notice, this list
14 | of conditions and the following disclaimer.
15 |
16 | * Redistributions in binary form must reproduce the above copyright notice, this
17 | list of conditions and the following disclaimer in the documentation and/or other
18 | materials provided with the distribution.
19 |
20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
21 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
22 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
23 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
25 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
27 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
30 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
32 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 |
34 | */
35 | #include "u8g2.h"
36 |
37 | /* Clear screen buffer & display reliable for all u8g2 displays. */
38 | /* This is done with u8g2 picture loop, because we can not use the u8x8 function in all cases */
39 | void u8g2_ClearDisplay(u8g2_t *u8g2)
40 | {
41 | u8g2_FirstPage(u8g2);
42 | do {
43 | } while ( u8g2_NextPage(u8g2) );
44 | /*
45 | This function is usually called during startup (u8g2.begin()).
46 | However the user might want to use full buffer mode with clear and
47 | send commands.
48 | This will not work because the current tile row is modified by the picture
49 | loop above. To fix this, reset the tile row to 0, issue #370
50 | A workaround would be, that the user sets the current tile row to 0 manually.
51 | */
52 | u8g2_SetBufferCurrTileRow(u8g2, 0);
53 | }
54 |
55 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/U8g2/src/clib/u8g2_fonts.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peng-zhihui/OpenHeat/db5a055e7a26242cbcab9cbef24936952850b85a/2.Firmware/OpenHeat-fw/lib/U8g2/src/clib/u8g2_fonts.c
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/U8g2/src/clib/u8g2_input_value.c:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | u8g2_input_value.c
4 |
5 | Universal 8bit Graphics Library (https://github.com/olikraus/u8g2/)
6 |
7 | Copyright (c) 2016, olikraus@gmail.com
8 | All rights reserved.
9 |
10 | Redistribution and use in source and binary forms, with or without modification,
11 | are permitted provided that the following conditions are met:
12 |
13 | * Redistributions of source code must retain the above copyright notice, this list
14 | of conditions and the following disclaimer.
15 |
16 | * Redistributions in binary form must reproduce the above copyright notice, this
17 | list of conditions and the following disclaimer in the documentation and/or other
18 | materials provided with the distribution.
19 |
20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
21 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
22 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
23 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
25 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
27 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
30 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
32 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 |
34 | */
35 |
36 | #include "u8g2.h"
37 |
38 | /*
39 | return:
40 | 0: value is not changed (HOME/Break Button pressed)
41 | 1: value has been updated
42 | */
43 |
44 | uint8_t u8g2_UserInterfaceInputValue(u8g2_t *u8g2, const char *title, const char *pre, uint8_t *value, uint8_t lo, uint8_t hi, uint8_t digits, const char *post)
45 | {
46 | uint8_t line_height;
47 | uint8_t height;
48 | u8g2_uint_t pixel_height;
49 | u8g2_uint_t y, yy;
50 | u8g2_uint_t pixel_width;
51 | u8g2_uint_t x, xx;
52 |
53 | uint8_t local_value = *value;
54 | //uint8_t r; /* not used ??? */
55 | uint8_t event;
56 |
57 | /* only horizontal strings are supported, so force this here */
58 | u8g2_SetFontDirection(u8g2, 0);
59 |
60 | /* force baseline position */
61 | u8g2_SetFontPosBaseline(u8g2);
62 |
63 | /* calculate line height */
64 | line_height = u8g2_GetAscent(u8g2);
65 | line_height -= u8g2_GetDescent(u8g2);
66 |
67 |
68 | /* calculate overall height of the input value box */
69 | height = 1; /* value input line */
70 | height += u8x8_GetStringLineCnt(title);
71 |
72 | /* calculate the height in pixel */
73 | pixel_height = height;
74 | pixel_height *= line_height;
75 |
76 |
77 | /* calculate offset from top */
78 | y = 0;
79 | if ( pixel_height < u8g2_GetDisplayHeight(u8g2) )
80 | {
81 | y = u8g2_GetDisplayHeight(u8g2);
82 | y -= pixel_height;
83 | y /= 2;
84 | }
85 |
86 | /* calculate offset from left for the label */
87 | x = 0;
88 | pixel_width = u8g2_GetUTF8Width(u8g2, pre);
89 | pixel_width += u8g2_GetUTF8Width(u8g2, "0") * digits;
90 | pixel_width += u8g2_GetUTF8Width(u8g2, post);
91 | if ( pixel_width < u8g2_GetDisplayWidth(u8g2) )
92 | {
93 | x = u8g2_GetDisplayWidth(u8g2);
94 | x -= pixel_width;
95 | x /= 2;
96 | }
97 |
98 | /* event loop */
99 | for(;;)
100 | {
101 | u8g2_FirstPage(u8g2);
102 | do
103 | {
104 | /* render */
105 | yy = y;
106 | yy += u8g2_DrawUTF8Lines(u8g2, 0, yy, u8g2_GetDisplayWidth(u8g2), line_height, title);
107 | xx = x;
108 | xx += u8g2_DrawUTF8(u8g2, xx, yy, pre);
109 | xx += u8g2_DrawUTF8(u8g2, xx, yy, u8x8_u8toa(local_value, digits));
110 | u8g2_DrawUTF8(u8g2, xx, yy, post);
111 | } while( u8g2_NextPage(u8g2) );
112 |
113 | #ifdef U8G2_REF_MAN_PIC
114 | return 0;
115 | #endif
116 |
117 | for(;;)
118 | {
119 | event = u8x8_GetMenuEvent(u8g2_GetU8x8(u8g2));
120 | if ( event == U8X8_MSG_GPIO_MENU_SELECT )
121 | {
122 | *value = local_value;
123 | return 1;
124 | }
125 | else if ( event == U8X8_MSG_GPIO_MENU_HOME )
126 | {
127 | return 0;
128 | }
129 | else if ( event == U8X8_MSG_GPIO_MENU_NEXT || event == U8X8_MSG_GPIO_MENU_UP )
130 | {
131 | if ( local_value >= hi )
132 | local_value = lo;
133 | else
134 | local_value++;
135 | break;
136 | }
137 | else if ( event == U8X8_MSG_GPIO_MENU_PREV || event == U8X8_MSG_GPIO_MENU_DOWN )
138 | {
139 | if ( local_value <= lo )
140 | local_value = hi;
141 | else
142 | local_value--;
143 | break;
144 | }
145 | }
146 | }
147 |
148 | /* never reached */
149 | //return r;
150 | }
151 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/U8g2/src/clib/u8g2_intersection.c:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | u8g2_intersection.c
4 |
5 | Intersection calculation, code taken from u8g_clip.c
6 |
7 | Universal 8bit Graphics Library (https://github.com/olikraus/u8g2/)
8 |
9 | Copyright (c) 2016, olikraus@gmail.com
10 | All rights reserved.
11 |
12 | Redistribution and use in source and binary forms, with or without modification,
13 | are permitted provided that the following conditions are met:
14 |
15 | * Redistributions of source code must retain the above copyright notice, this list
16 | of conditions and the following disclaimer.
17 |
18 | * Redistributions in binary form must reproduce the above copyright notice, this
19 | list of conditions and the following disclaimer in the documentation and/or other
20 | materials provided with the distribution.
21 |
22 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
23 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
24 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
25 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
27 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
29 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
32 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
34 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 |
36 | */
37 |
38 | #include "u8g2.h"
39 |
40 | #ifdef __GNUC__
41 | #define U8G2_ALWAYS_INLINE __inline__ __attribute__((always_inline))
42 | #else
43 | #define U8G2_ALWAYS_INLINE
44 | #endif
45 |
46 |
47 | #if defined(U8G2_WITH_INTERSECTION) || defined(U8G2_WITH_CLIP_WINDOW_SUPPORT)
48 |
49 | #ifdef OLD_VERSION_WITH_SYMETRIC_BOUNDARIES
50 |
51 | /*
52 | intersection assumptions:
53 | a1 <= a2 is always true
54 |
55 | minimized version
56 | ---1----0 1 b1 <= a2 && b1 > b2
57 | -----1--0 1 b2 >= a1 && b1 > b2
58 | ---1-1--- 1 b1 <= a2 && b2 >= a1
59 | */
60 |
61 |
62 | /*
63 | calculate the intersection between a0/a1 and v0/v1
64 | The intersection check returns one if the range of a0/a1 has an intersection with v0/v1.
65 | The intersection check includes the boundary values v1 and a1.
66 |
67 | The following asserts will succeed:
68 | assert( u8g2_is_intersection_decision_tree(4, 6, 7, 9) == 0 );
69 | assert( u8g2_is_intersection_decision_tree(4, 6, 6, 9) != 0 );
70 | assert( u8g2_is_intersection_decision_tree(6, 9, 4, 6) != 0 );
71 | assert( u8g2_is_intersection_decision_tree(7, 9, 4, 6) == 0 );
72 | */
73 |
74 | //static uint8_t U8G2_ALWAYS_INLINE u8g2_is_intersection_decision_tree(u8g_uint_t a0, u8g_uint_t a1, u8g_uint_t v0, u8g_uint_t v1)
75 | static uint8_t u8g2_is_intersection_decision_tree(u8g2_uint_t a0, u8g2_uint_t a1, u8g2_uint_t v0, u8g2_uint_t v1)
76 | {
77 | if ( v0 <= a1 )
78 | {
79 | if ( v1 >= a0 )
80 | {
81 | return 1;
82 | }
83 | else
84 | {
85 | if ( v0 > v1 )
86 | {
87 | return 1;
88 | }
89 | else
90 | {
91 | return 0;
92 | }
93 | }
94 | }
95 | else
96 | {
97 | if ( v1 >= a0 )
98 | {
99 | if ( v0 > v1 )
100 | {
101 | return 1;
102 | }
103 | else
104 | {
105 | return 0;
106 | }
107 | }
108 | else
109 | {
110 | return 0;
111 | }
112 | }
113 | }
114 |
115 | #endif /* OLD_VERSION_WITH_SYMETRIC_BOUNDARIES */
116 |
117 |
118 | /*
119 | version with asymetric boundaries.
120 | a1 and v1 are excluded
121 | v0 == v1 is not support end return 1
122 | */
123 | uint8_t u8g2_is_intersection_decision_tree(u8g2_uint_t a0, u8g2_uint_t a1, u8g2_uint_t v0, u8g2_uint_t v1)
124 | {
125 | if ( v0 < a1 ) // v0 <= a1
126 | {
127 | if ( v1 > a0 ) // v1 >= a0
128 | {
129 | return 1;
130 | }
131 | else
132 | {
133 | if ( v0 > v1 ) // v0 > v1
134 | {
135 | return 1;
136 | }
137 | else
138 | {
139 | return 0;
140 | }
141 | }
142 | }
143 | else
144 | {
145 | if ( v1 > a0 ) // v1 >= a0
146 | {
147 | if ( v0 > v1 ) // v0 > v1
148 | {
149 | return 1;
150 | }
151 | else
152 | {
153 | return 0;
154 | }
155 | }
156 | else
157 | {
158 | return 0;
159 | }
160 | }
161 | }
162 |
163 |
164 |
165 | /* upper limits are not included (asymetric boundaries) */
166 | uint8_t u8g2_IsIntersection(u8g2_t *u8g2, u8g2_uint_t x0, u8g2_uint_t y0, u8g2_uint_t x1, u8g2_uint_t y1)
167 | {
168 | if ( u8g2_is_intersection_decision_tree(u8g2->user_y0, u8g2->user_y1, y0, y1) == 0 )
169 | return 0;
170 |
171 | return u8g2_is_intersection_decision_tree(u8g2->user_x0, u8g2->user_x1, x0, x1);
172 | }
173 |
174 |
175 | #endif /* U8G2_WITH_INTERSECTION */
176 |
177 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/U8g2/src/clib/u8g2_kerning.c:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | u8g2_kerning.c
4 |
5 | Universal 8bit Graphics Library (https://github.com/olikraus/u8g2/)
6 |
7 | Copyright (c) 2016, olikraus@gmail.com
8 | All rights reserved.
9 |
10 | Redistribution and use in source and binary forms, with or without modification,
11 | are permitted provided that the following conditions are met:
12 |
13 | * Redistributions of source code must retain the above copyright notice, this list
14 | of conditions and the following disclaimer.
15 |
16 | * Redistributions in binary form must reproduce the above copyright notice, this
17 | list of conditions and the following disclaimer in the documentation and/or other
18 | materials provided with the distribution.
19 |
20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
21 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
22 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
23 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
25 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
27 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
30 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
32 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 |
34 | */
35 |
36 | #include "u8g2.h"
37 |
38 | /* this function is used as "u8g2_get_kerning_cb" */
39 | /*
40 | uint8_t u8g2_GetNullKerning(u8g2_t *u8g2, uint16_t e1, uint16_t e2)
41 | {
42 | return 0;
43 | }
44 | */
45 |
46 | /* this function is used as "u8g2_get_kerning_cb" */
47 | uint8_t u8g2_GetKerning(U8X8_UNUSED u8g2_t *u8g2, u8g2_kerning_t *kerning, uint16_t e1, uint16_t e2)
48 | {
49 | uint16_t i1, i2, cnt, end;
50 | if ( kerning == NULL )
51 | return 0;
52 |
53 | /* search for the encoding in the first table */
54 | cnt = kerning->first_table_cnt;
55 | cnt--; /* ignore the last element of the table, which is 0x0ffff */
56 | for( i1 = 0; i1 < cnt; i1++ )
57 | {
58 | if ( kerning->first_encoding_table[i1] == e1 )
59 | break;
60 | }
61 | if ( i1 >= cnt )
62 | return 0; /* e1 not part of the kerning table, return 0 */
63 |
64 | /* get the upper index for i2 */
65 | end = kerning->index_to_second_table[i1+1];
66 | for( i2 = kerning->index_to_second_table[i1]; i2 < end; i2++ )
67 | {
68 | if ( kerning->second_encoding_table[i2] == e2 )
69 | break;
70 | }
71 |
72 | if ( i2 >= end )
73 | return 0; /* e2 not part of any pair with e1, return 0 */
74 |
75 | return kerning->kerning_values[i2];
76 | }
77 |
78 | uint8_t u8g2_GetKerningByTable(U8X8_UNUSED u8g2_t *u8g2, const uint16_t *kt, uint16_t e1, uint16_t e2)
79 | {
80 | uint16_t i;
81 | i = 0;
82 | if ( kt == NULL )
83 | return 0;
84 | for(;;)
85 | {
86 | if ( kt[i] == 0x0ffff )
87 | break;
88 | if ( kt[i] == e1 && kt[i+1] == e2 )
89 | return kt[i+2];
90 | i+=3;
91 | }
92 | return 0;
93 | }
94 |
95 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/U8g2/src/clib/u8g2_line.c:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | u8g2_box.c
4 |
5 | Universal 8bit Graphics Library (https://github.com/olikraus/u8g2/)
6 |
7 | Copyright (c) 2016, olikraus@gmail.com
8 | All rights reserved.
9 |
10 | Redistribution and use in source and binary forms, with or without modification,
11 | are permitted provided that the following conditions are met:
12 |
13 | * Redistributions of source code must retain the above copyright notice, this list
14 | of conditions and the following disclaimer.
15 |
16 | * Redistributions in binary form must reproduce the above copyright notice, this
17 | list of conditions and the following disclaimer in the documentation and/or other
18 | materials provided with the distribution.
19 |
20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
21 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
22 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
23 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
25 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
27 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
30 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
32 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 |
34 | */
35 |
36 | #include "u8g2.h"
37 |
38 |
39 | void u8g2_DrawLine(u8g2_t *u8g2, u8g2_uint_t x1, u8g2_uint_t y1, u8g2_uint_t x2, u8g2_uint_t y2)
40 | {
41 | u8g2_uint_t tmp;
42 | u8g2_uint_t x,y;
43 | u8g2_uint_t dx, dy;
44 | u8g2_int_t err;
45 | u8g2_int_t ystep;
46 |
47 | uint8_t swapxy = 0;
48 |
49 | /* no intersection check at the moment, should be added... */
50 |
51 | if ( x1 > x2 ) dx = x1-x2; else dx = x2-x1;
52 | if ( y1 > y2 ) dy = y1-y2; else dy = y2-y1;
53 |
54 | if ( dy > dx )
55 | {
56 | swapxy = 1;
57 | tmp = dx; dx =dy; dy = tmp;
58 | tmp = x1; x1 =y1; y1 = tmp;
59 | tmp = x2; x2 =y2; y2 = tmp;
60 | }
61 | if ( x1 > x2 )
62 | {
63 | tmp = x1; x1 =x2; x2 = tmp;
64 | tmp = y1; y1 =y2; y2 = tmp;
65 | }
66 | err = dx >> 1;
67 | if ( y2 > y1 ) ystep = 1; else ystep = -1;
68 | y = y1;
69 |
70 | #ifndef U8G2_16BIT
71 | if ( x2 == 255 )
72 | x2--;
73 | #else
74 | if ( x2 == 0xffff )
75 | x2--;
76 | #endif
77 |
78 | for( x = x1; x <= x2; x++ )
79 | {
80 | if ( swapxy == 0 )
81 | u8g2_DrawPixel(u8g2, x, y);
82 | else
83 | u8g2_DrawPixel(u8g2, y, x);
84 | err -= (uint8_t)dy;
85 | if ( err < 0 )
86 | {
87 | y += (u8g2_uint_t)ystep;
88 | err += (u8g2_uint_t)dx;
89 | }
90 | }
91 | }
92 |
93 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/U8g2/src/clib/u8log_u8g2.c:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | u8log_u8g2.c
4 |
5 |
6 | Universal 8bit Graphics Library (https://github.com/olikraus/u8g2/)
7 |
8 | Copyright (c) 2018, olikraus@gmail.com
9 | All rights reserved.
10 |
11 | Redistribution and use in source and binary forms, with or without modification,
12 | are permitted provided that the following conditions are met:
13 |
14 | * Redistributions of source code must retain the above copyright notice, this list
15 | of conditions and the following disclaimer.
16 |
17 | * Redistributions in binary form must reproduce the above copyright notice, this
18 | list of conditions and the following disclaimer in the documentation and/or other
19 | materials provided with the distribution.
20 |
21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
22 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
23 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
24 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
26 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
28 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
30 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
31 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
33 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 |
35 | */
36 |
37 | #include "u8g2.h"
38 | /*
39 | Draw the u8log text at the specified x/y position.
40 | x/y position is the reference position of the first char of the first line.
41 | the line height is
42 | u8g2_GetAscent(u8g2) - u8g2_GetDescent(u8g2) + line_height_offset;
43 | line_height_offset can be set with u8log_SetLineHeightOffset()
44 | Use
45 | u8g2_SetFontRefHeightText(u8g2_t *u8g2);
46 | u8g2_SetFontRefHeightExtendedText(u8g2_t *u8g2);
47 | u8g2_SetFontRefHeightAll(u8g2_t *u8g2);
48 | to change the return values for u8g2_GetAscent and u8g2_GetDescent
49 |
50 | */
51 | void u8g2_DrawLog(u8g2_t *u8g2, u8g2_uint_t x, u8g2_uint_t y, u8log_t *u8log)
52 | {
53 | u8g2_uint_t disp_x, disp_y;
54 | uint8_t buf_x, buf_y;
55 | uint8_t c;
56 |
57 | disp_y = y;
58 | u8g2_SetFontDirection(u8g2, 0);
59 | for( buf_y = 0; buf_y < u8log->height; buf_y++ )
60 | {
61 | disp_x = x;
62 | for( buf_x = 0; buf_x < u8log->width; buf_x++ )
63 | {
64 | c = u8log->screen_buffer[buf_y * u8log->width + buf_x];
65 | disp_x += u8g2_DrawGlyph(u8g2, disp_x, disp_y, c);
66 | }
67 | disp_y += u8g2_GetAscent(u8g2) - u8g2_GetDescent(u8g2);
68 | disp_y += u8log->line_height_offset;
69 | }
70 | }
71 |
72 | /*
73 | u8lib callback for u8g2
74 |
75 | Only font direction 0 is supported: u8g2_SetFontDirection(u8g2, 0)
76 | Use
77 | u8g2_SetFontRefHeightText(u8g2_t *u8g2);
78 | u8g2_SetFontRefHeightExtendedText(u8g2_t *u8g2);
79 | u8g2_SetFontRefHeightAll(u8g2_t *u8g2);
80 | to change the top offset and the line height and
81 | u8log_SetLineHeightOffset(u8log_t *u8log, int8_t line_height_offset)
82 | to change the line height.
83 |
84 | */
85 | void u8log_u8g2_cb(u8log_t * u8log)
86 | {
87 | u8g2_t *u8g2 = (u8g2_t *)(u8log->aux_data);
88 | if ( u8log->is_redraw_line || u8log->is_redraw_all )
89 | {
90 | u8g2_FirstPage(u8g2);
91 | do
92 | {
93 | u8g2_DrawLog( u8g2, 0, u8g2_GetAscent(u8g2), u8log);
94 | }
95 | while( u8g2_NextPage(u8g2) );
96 | }
97 | }
98 |
99 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/U8g2/src/clib/u8log_u8x8.c:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | u8log_u8x8.c
4 |
5 |
6 | Universal 8bit Graphics Library (https://github.com/olikraus/u8g2/)
7 |
8 | Copyright (c) 2018, olikraus@gmail.com
9 | All rights reserved.
10 |
11 | Redistribution and use in source and binary forms, with or without modification,
12 | are permitted provided that the following conditions are met:
13 |
14 | * Redistributions of source code must retain the above copyright notice, this list
15 | of conditions and the following disclaimer.
16 |
17 | * Redistributions in binary form must reproduce the above copyright notice, this
18 | list of conditions and the following disclaimer in the documentation and/or other
19 | materials provided with the distribution.
20 |
21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
22 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
23 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
24 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
26 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
28 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
30 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
31 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
33 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 |
35 | */
36 |
37 | #include "u8x8.h"
38 |
39 | static void u8x8_DrawLogLine(u8x8_t *u8x8, uint8_t disp_x, uint8_t disp_y, uint8_t buf_y, u8log_t *u8log) U8X8_NOINLINE;
40 | static void u8x8_DrawLogLine(u8x8_t *u8x8, uint8_t disp_x, uint8_t disp_y, uint8_t buf_y, u8log_t *u8log)
41 | {
42 | uint8_t buf_x;
43 | uint8_t c;
44 | for( buf_x = 0; buf_x < u8log->width; buf_x++ )
45 | {
46 | c = u8log->screen_buffer[buf_y * u8log->width + buf_x];
47 | u8x8_DrawGlyph(u8x8, disp_x, disp_y, c);
48 | disp_x++;
49 | }
50 | }
51 |
52 | void u8x8_DrawLog(u8x8_t *u8x8, uint8_t x, uint8_t y, u8log_t *u8log)
53 | {
54 | uint8_t buf_y;
55 | for( buf_y = 0; buf_y < u8log->height; buf_y++ )
56 | {
57 | u8x8_DrawLogLine(u8x8, x, y, buf_y, u8log);
58 | y++;
59 | }
60 | }
61 |
62 |
63 | void u8log_u8x8_cb(u8log_t * u8log)
64 | {
65 | u8x8_t *u8x8 = (u8x8_t *)(u8log->aux_data);
66 | if ( u8log->is_redraw_all )
67 | {
68 | u8x8_DrawLog(u8x8, 0, 0, u8log);
69 | }
70 | else if ( u8log->is_redraw_line )
71 | {
72 | u8x8_DrawLogLine(u8x8, 0, u8log->redraw_line, u8log->redraw_line, u8log);
73 | }
74 | }
75 |
76 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/U8g2/src/clib/u8x8_d_stdio.c:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | u8x8_d_stdio.c
4 |
5 | Universal 8bit Graphics Library (https://github.com/olikraus/u8g2/)
6 |
7 | Copyright (c) 2016, olikraus@gmail.com
8 | All rights reserved.
9 |
10 | Redistribution and use in source and binary forms, with or without modification,
11 | are permitted provided that the following conditions are met:
12 |
13 | * Redistributions of source code must retain the above copyright notice, this list
14 | of conditions and the following disclaimer.
15 |
16 | * Redistributions in binary form must reproduce the above copyright notice, this
17 | list of conditions and the following disclaimer in the documentation and/or other
18 | materials provided with the distribution.
19 |
20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
21 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
22 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
23 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
25 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
27 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
30 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
32 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 |
34 | */
35 |
36 | #include "u8x8.h"
37 |
38 | #include
39 |
40 | #define W 8
41 | #define H 2
42 |
43 | uint8_t bitmap[W * H * 8];
44 |
45 | void bitmap_place_tile(uint8_t x, uint8_t y, uint8_t *tile)
46 | {
47 | uint8_t i;
48 | for (i = 0; i < 8; i++)
49 | bitmap[x * 8 + y * W * 8 + i] = tile[i];
50 | }
51 |
52 | void bitmap_show(void)
53 | {
54 | int x, y;
55 | for (y = 0; y < H * 8; y++)
56 | {
57 | for (x = 0; x < W * 8; x++)
58 | {
59 | if ((bitmap[x + (y / 8) * W * 8] & (1 << ((y & 7)))) != 0)
60 | {
61 | printf("*");
62 | } else
63 | {
64 | printf(".");
65 | }
66 | }
67 | printf("\n");
68 | }
69 | }
70 |
71 |
72 | uint8_t u8x8_d_stdio(U8X8_UNUSED u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr)
73 | {
74 | switch (msg)
75 | {
76 | case U8X8_MSG_DISPLAY_INIT:
77 | break;
78 | case U8X8_MSG_DISPLAY_SET_POWER_SAVE:
79 | if (arg_int == 0)
80 | bitmap_show();
81 | break;
82 | case U8X8_MSG_DISPLAY_SET_CONTRAST:
83 | break;
84 | case U8X8_MSG_DISPLAY_DRAW_TILE:
85 | bitmap_place_tile(((u8x8_tile_t *) arg_ptr)->x_pos, ((u8x8_tile_t *) arg_ptr)->y_pos,
86 | ((u8x8_tile_t *) arg_ptr)->tile_ptr);
87 | break;
88 | default:
89 | break;
90 | }
91 | return 1;
92 | }
93 |
94 |
95 | void u8x8_SetupStdio(u8x8_t *u8x8)
96 | {
97 | u8x8_SetupDefaults(u8x8);
98 | u8x8->display_cb = u8x8_d_stdio;
99 | }
100 |
101 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/U8g2/src/clib/u8x8_fonts.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peng-zhihui/OpenHeat/db5a055e7a26242cbcab9cbef24936952850b85a/2.Firmware/OpenHeat-fw/lib/U8g2/src/clib/u8x8_fonts.c
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/U8g2/src/clib/u8x8_gpio.c:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | u8x8_gpio.c
4 |
5 | Universal 8bit Graphics Library (https://github.com/olikraus/u8g2/)
6 |
7 | Copyright (c) 2016, olikraus@gmail.com
8 | All rights reserved.
9 |
10 | Redistribution and use in source and binary forms, with or without modification,
11 | are permitted provided that the following conditions are met:
12 |
13 | * Redistributions of source code must retain the above copyright notice, this list
14 | of conditions and the following disclaimer.
15 |
16 | * Redistributions in binary form must reproduce the above copyright notice, this
17 | list of conditions and the following disclaimer in the documentation and/or other
18 | materials provided with the distribution.
19 |
20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
21 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
22 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
23 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
25 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
27 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
30 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
32 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 |
34 | */
35 |
36 |
37 | #include "u8x8.h"
38 |
39 |
40 | void u8x8_gpio_call(u8x8_t *u8x8, uint8_t msg, uint8_t arg)
41 | {
42 | u8x8->gpio_and_delay_cb(u8x8, msg, arg, NULL);
43 | }
44 |
45 | /*
46 | void u8x8_gpio_Delay(u8x8_t *u8x8, uint8_t msg, uint8_t dly)
47 | {
48 | u8x8->gpio_and_delay_cb(u8x8, msg, dly, NULL);
49 | }
50 | */
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/U8g2/src/clib/u8x8_input_value.c:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | u8x8_input_value.c
4 |
5 | Universal 8bit Graphics Library (https://github.com/olikraus/u8g2/)
6 |
7 | Copyright (c) 2016, olikraus@gmail.com
8 | All rights reserved.
9 |
10 | Redistribution and use in source and binary forms, with or without modification,
11 | are permitted provided that the following conditions are met:
12 |
13 | * Redistributions of source code must retain the above copyright notice, this list
14 | of conditions and the following disclaimer.
15 |
16 | * Redistributions in binary form must reproduce the above copyright notice, this
17 | list of conditions and the following disclaimer in the documentation and/or other
18 | materials provided with the distribution.
19 |
20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
21 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
22 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
23 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
25 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
27 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
30 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
32 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 |
34 | */
35 |
36 | #include "u8x8.h"
37 |
38 | /*
39 | return:
40 | 0: value is not changed (HOME/Break Button pressed)
41 | 1: value has been updated
42 | */
43 |
44 | uint8_t u8x8_UserInterfaceInputValue(u8x8_t *u8x8, const char *title, const char *pre, uint8_t *value, uint8_t lo, uint8_t hi, uint8_t digits, const char *post)
45 | {
46 | uint8_t height;
47 | uint8_t y;
48 | uint8_t width;
49 | uint8_t x;
50 | uint8_t local_value = *value;
51 | uint8_t r;
52 | uint8_t event;
53 |
54 | /* calculate overall height of the input value box */
55 | height = 1; /* button line */
56 | height += u8x8_GetStringLineCnt(title);
57 |
58 | /* calculate offset from top */
59 | y = 0;
60 | if ( height < u8x8_GetRows(u8x8) )
61 | {
62 | y = u8x8_GetRows(u8x8);
63 | y -= height;
64 | y /= 2;
65 | }
66 |
67 | /* calculate offset from left for the label */
68 | x = 0;
69 | width = u8x8_GetUTF8Len(u8x8, pre);
70 | width += digits;
71 | width += u8x8_GetUTF8Len(u8x8, post);
72 | if ( width < u8x8_GetCols(u8x8) )
73 | {
74 | x = u8x8_GetCols(u8x8);
75 | x -= width;
76 | x /= 2;
77 | }
78 |
79 | /* render */
80 | u8x8_ClearDisplay(u8x8); /* required, because not everything is filled */
81 | u8x8_SetInverseFont(u8x8, 0);
82 | y += u8x8_DrawUTF8Lines(u8x8, 0, y, u8x8_GetCols(u8x8), title);
83 | x += u8x8_DrawUTF8(u8x8, x, y, pre);
84 | u8x8_DrawUTF8(u8x8, x+digits, y, post);
85 | u8x8_SetInverseFont(u8x8, 1);
86 |
87 | /* event loop */
88 | u8x8_DrawUTF8(u8x8, x, y, u8x8_u8toa(local_value, digits));
89 | for(;;)
90 | {
91 | event = u8x8_GetMenuEvent(u8x8);
92 | if ( event == U8X8_MSG_GPIO_MENU_SELECT )
93 | {
94 | *value = local_value;
95 | r = 1;
96 | break;
97 | }
98 | else if ( event == U8X8_MSG_GPIO_MENU_HOME )
99 | {
100 | r = 0;
101 | break;
102 | }
103 | else if ( event == U8X8_MSG_GPIO_MENU_NEXT || event == U8X8_MSG_GPIO_MENU_UP )
104 | {
105 | if ( local_value >= hi )
106 | local_value = lo;
107 | else
108 | local_value++;
109 | u8x8_DrawUTF8(u8x8, x, y, u8x8_u8toa(local_value, digits));
110 | }
111 | else if ( event == U8X8_MSG_GPIO_MENU_PREV || event == U8X8_MSG_GPIO_MENU_DOWN )
112 | {
113 | if ( local_value <= lo )
114 | local_value = hi;
115 | else
116 | local_value--;
117 | u8x8_DrawUTF8(u8x8, x, y, u8x8_u8toa(local_value, digits));
118 | }
119 | }
120 |
121 | u8x8_SetInverseFont(u8x8, 0);
122 | return r;
123 | }
124 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/U8g2/src/clib/u8x8_message.c:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | u8x8_message.c
4 |
5 | Universal 8bit Graphics Library (https://github.com/olikraus/u8g2/)
6 |
7 | Copyright (c) 2016, olikraus@gmail.com
8 | All rights reserved.
9 |
10 | Redistribution and use in source and binary forms, with or without modification,
11 | are permitted provided that the following conditions are met:
12 |
13 | * Redistributions of source code must retain the above copyright notice, this list
14 | of conditions and the following disclaimer.
15 |
16 | * Redistributions in binary form must reproduce the above copyright notice, this
17 | list of conditions and the following disclaimer in the documentation and/or other
18 | materials provided with the distribution.
19 |
20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
21 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
22 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
23 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
25 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
27 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
30 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
32 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 |
34 | */
35 |
36 | #include "u8x8.h"
37 |
38 | uint8_t u8x8_draw_button_line(u8x8_t *u8x8, uint8_t y, uint8_t w, uint8_t cursor, const char *s)
39 | {
40 | uint8_t i;
41 | uint8_t cnt;
42 | uint8_t total;
43 | uint8_t d;
44 | uint8_t x;
45 | cnt = u8x8_GetStringLineCnt(s);
46 |
47 | /* calculate the width of the button */
48 | total = 0;
49 | for( i = 0; i < cnt; i++ )
50 | {
51 | total += u8x8_GetUTF8Len(u8x8, u8x8_GetStringLineStart(i, s));
52 | }
53 | total += (cnt-1); /* had one space between the buttons */
54 |
55 | /* calculate the left offset */
56 | d = 0;
57 | if ( total < w )
58 | {
59 | d = w;
60 | d -= total;
61 | d /= 2;
62 | }
63 |
64 | /* draw the buttons */
65 | x = d;
66 | u8x8_SetInverseFont(u8x8, 0);
67 | for( i = 0; i < cnt; i++ )
68 | {
69 | if ( i == cursor )
70 | u8x8_SetInverseFont(u8x8, 1);
71 |
72 | x+=u8x8_DrawUTF8(u8x8, x, y, u8x8_GetStringLineStart(i, s));
73 | u8x8_SetInverseFont(u8x8, 0);
74 | x+=u8x8_DrawUTF8(u8x8, x, y, " ");
75 | }
76 |
77 | /* return the number of buttons */
78 | return cnt;
79 | }
80 |
81 | /*
82 | title1: Multiple lines,separated by '\n'
83 | title2: A single line/string which is terminated by '\0' or '\n' . "title2" accepts the return value from u8x8_GetStringLineStart()
84 | title3: Multiple lines,separated by '\n'
85 | buttons: one more more buttons separated by '\n' and terminated with '\0'
86 | */
87 |
88 | uint8_t u8x8_UserInterfaceMessage(u8x8_t *u8x8, const char *title1, const char *title2, const char *title3, const char *buttons)
89 | {
90 | uint8_t height;
91 | uint8_t y;
92 | uint8_t cursor = 0;
93 | uint8_t button_cnt;
94 | uint8_t event;
95 |
96 | u8x8_SetInverseFont(u8x8, 0);
97 |
98 | /* calculate overall height of the message box */
99 | height = 1; /* button line */
100 | height += u8x8_GetStringLineCnt(title1);
101 | if ( title2 != NULL )
102 | height ++;
103 | height += u8x8_GetStringLineCnt(title3);
104 |
105 | /* calculate offset from top */
106 | y = 0;
107 | if ( height < u8x8_GetRows(u8x8) )
108 | {
109 | y = u8x8_GetRows(u8x8);
110 | y -= height;
111 | y /= 2;
112 | }
113 |
114 | /* draw message box */
115 |
116 | u8x8_ClearDisplay(u8x8); /* required, because not everything is filled */
117 |
118 | y += u8x8_DrawUTF8Lines(u8x8, 0, y, u8x8_GetCols(u8x8), title1);
119 | if ( title2 != NULL )
120 | {
121 | u8x8_DrawUTF8Line(u8x8, 0, y, u8x8_GetCols(u8x8), title2);
122 | y++;
123 | }
124 | y += u8x8_DrawUTF8Lines(u8x8, 0, y, u8x8_GetCols(u8x8), title3);
125 |
126 | button_cnt = u8x8_draw_button_line(u8x8, y, u8x8_GetCols(u8x8), cursor, buttons);
127 |
128 | for(;;)
129 | {
130 | event = u8x8_GetMenuEvent(u8x8);
131 | if ( event == U8X8_MSG_GPIO_MENU_SELECT )
132 | return cursor+1;
133 | else if ( event == U8X8_MSG_GPIO_MENU_HOME )
134 | break;
135 | else if ( event == U8X8_MSG_GPIO_MENU_NEXT || event == U8X8_MSG_GPIO_MENU_UP )
136 | {
137 | cursor++;
138 | if ( cursor >= button_cnt )
139 | cursor = 0;
140 | u8x8_draw_button_line(u8x8, y, u8x8_GetCols(u8x8), cursor, buttons);
141 | }
142 | else if ( event == U8X8_MSG_GPIO_MENU_PREV || event == U8X8_MSG_GPIO_MENU_DOWN )
143 | {
144 | if ( cursor == 0 )
145 | cursor = button_cnt;
146 | cursor--;
147 | u8x8_draw_button_line(u8x8, y, u8x8_GetCols(u8x8), cursor, buttons);
148 | }
149 | }
150 | return 0;
151 | }
152 |
153 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/U8g2/src/clib/u8x8_string.c:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | u8x8_string.c
4 |
5 | string line procedures
6 |
7 | Universal 8bit Graphics Library (https://github.com/olikraus/u8g2/)
8 |
9 | Copyright (c) 2016, olikraus@gmail.com
10 | All rights reserved.
11 |
12 | Redistribution and use in source and binary forms, with or without modification,
13 | are permitted provided that the following conditions are met:
14 |
15 | * Redistributions of source code must retain the above copyright notice, this list
16 | of conditions and the following disclaimer.
17 |
18 | * Redistributions in binary form must reproduce the above copyright notice, this
19 | list of conditions and the following disclaimer in the documentation and/or other
20 | materials provided with the distribution.
21 |
22 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
23 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
24 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
25 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
27 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
29 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
32 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
34 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 |
36 | */
37 |
38 | #include "u8x8.h"
39 |
40 | uint8_t u8x8_GetStringLineCnt(const char *str)
41 | {
42 | char e;
43 | uint8_t line_cnt = 1;
44 | if ( str == NULL )
45 | return 0;
46 | for(;;)
47 | {
48 | e = *str;
49 | if ( e == '\0' )
50 | break;
51 | str++;
52 | if ( e == '\n' )
53 | line_cnt++;
54 | }
55 | return line_cnt;
56 | }
57 |
58 |
59 | /*
60 | Assumes strings, separated by '\n' in "str".
61 | Returns the string at index "line_idx". First strng has line_idx = 0
62 | Example:
63 | Returns "xyz" for line_idx = 1 with str = "abc\nxyz"
64 | Support both UTF8 and normal strings.
65 | */
66 | const char *u8x8_GetStringLineStart(uint8_t line_idx, const char *str )
67 | {
68 | char e;
69 | uint8_t line_cnt = 1;
70 |
71 | if ( line_idx == 0 )
72 | return str;
73 |
74 | for(;;)
75 | {
76 | e = *str;
77 | if ( e == '\0' )
78 | break;
79 | str++;
80 | if ( e == '\n' )
81 | {
82 | if ( line_cnt == line_idx )
83 | return str;
84 | line_cnt++;
85 | }
86 | }
87 | return NULL; /* line not found */
88 | }
89 |
90 | /* copy until first '\n' or '\0' in str */
91 | /* Important: There is no string overflow check, ensure */
92 | /* that the destination buffer is large enough */
93 | void u8x8_CopyStringLine(char *dest, uint8_t line_idx, const char *str)
94 | {
95 | if ( dest == NULL )
96 | return;
97 | str = u8x8_GetStringLineStart( line_idx, str );
98 | if ( str != NULL )
99 | {
100 | for(;;)
101 | {
102 | if ( *str == '\n' || *str == '\0' )
103 | break;
104 | *dest = *str;
105 | dest++;
106 | str++;
107 | }
108 | }
109 | *dest = '\0';
110 | }
111 |
112 | /*
113 | Draw a string
114 | Extend the string to size "w"
115 | Center the string within "w"
116 | return the size of the string
117 |
118 | */
119 | uint8_t u8x8_DrawUTF8Line(u8x8_t *u8x8, uint8_t x, uint8_t y, uint8_t w, const char *s)
120 | {
121 | uint8_t d, lw;
122 | uint8_t cx, dx;
123 |
124 | d = 0;
125 |
126 | lw = u8x8_GetUTF8Len(u8x8, s);
127 | if ( lw < w )
128 | {
129 | d = w;
130 | d -=lw;
131 | d /= 2;
132 | }
133 |
134 | cx = x;
135 | dx = cx + d;
136 | while( cx < dx )
137 | {
138 | u8x8_DrawUTF8(u8x8, cx, y, " ");
139 | cx++;
140 | }
141 | cx += u8x8_DrawUTF8(u8x8, cx, y, s);
142 | dx = x + w;
143 | while( cx < dx )
144 | {
145 | u8x8_DrawUTF8(u8x8, cx, y, " ");
146 | cx++;
147 | }
148 | cx -= x;
149 | return cx;
150 | }
151 |
152 | /*
153 | draw several lines at position x,y.
154 | lines are stored in s and must be separated with '\n'.
155 | lines can be centered with respect to "w"
156 | if s == NULL nothing is drawn and 0 is returned
157 | returns the number of lines in s
158 | */
159 | uint8_t u8x8_DrawUTF8Lines(u8x8_t *u8x8, uint8_t x, uint8_t y, uint8_t w, const char *s)
160 | {
161 | uint8_t i;
162 | uint8_t cnt;
163 | cnt = u8x8_GetStringLineCnt(s);
164 | for( i = 0; i < cnt; i++ )
165 | {
166 | u8x8_DrawUTF8Line(u8x8, x, y, w, u8x8_GetStringLineStart(i, s));
167 | y++;
168 | }
169 | return cnt;
170 | }
171 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/U8g2/src/clib/u8x8_u16toa.c:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | u8x8_u16toa.c
4 |
5 | Universal 8bit Graphics Library (https://github.com/olikraus/u8g2/)
6 |
7 | Copyright (c) 2016, olikraus@gmail.com
8 | All rights reserved.
9 |
10 | Redistribution and use in source and binary forms, with or without modification,
11 | are permitted provided that the following conditions are met:
12 |
13 | * Redistributions of source code must retain the above copyright notice, this list
14 | of conditions and the following disclaimer.
15 |
16 | * Redistributions in binary form must reproduce the above copyright notice, this
17 | list of conditions and the following disclaimer in the documentation and/or other
18 | materials provided with the distribution.
19 |
20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
21 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
22 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
23 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
25 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
27 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
30 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
32 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 |
34 |
35 | */
36 |
37 |
38 | #include "u8x8.h"
39 |
40 | const char *u8x8_u16toap(char * dest, uint16_t v)
41 | {
42 | uint8_t pos;
43 | uint8_t d;
44 | uint16_t c;
45 | c = 10000;
46 | for( pos = 0; pos < 5; pos++ )
47 | {
48 | d = '0';
49 | while( v >= c )
50 | {
51 | v -= c;
52 | d++;
53 | }
54 | dest[pos] = d;
55 | c /= 10;
56 | }
57 | dest[5] = '\0';
58 | return dest;
59 | }
60 |
61 | /* v = value, d = number of digits */
62 | const char *u8x8_u16toa(uint16_t v, uint8_t d)
63 | {
64 | static char buf[6];
65 | d = 5-d;
66 | return u8x8_u16toap(buf, v) + d;
67 | }
68 |
69 | const char *u8x8_utoa(uint16_t v)
70 | {
71 | const char *s = u8x8_u16toa(v, 5);
72 | while( *s == '0' )
73 | s++;
74 | if ( *s == '\0' )
75 | s--;
76 | return s;
77 | }
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/lib/U8g2/src/clib/u8x8_u8toa.c:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | u8x8_u8toa.c
4 |
5 | Universal 8bit Graphics Library (https://github.com/olikraus/u8g2/)
6 |
7 | Copyright (c) 2016, olikraus@gmail.com
8 | All rights reserved.
9 |
10 | Redistribution and use in source and binary forms, with or without modification,
11 | are permitted provided that the following conditions are met:
12 |
13 | * Redistributions of source code must retain the above copyright notice, this list
14 | of conditions and the following disclaimer.
15 |
16 | * Redistributions in binary form must reproduce the above copyright notice, this
17 | list of conditions and the following disclaimer in the documentation and/or other
18 | materials provided with the distribution.
19 |
20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
21 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
22 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
23 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
25 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
27 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
30 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
32 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 |
34 | */
35 |
36 |
37 | #include "u8x8.h"
38 |
39 | static const unsigned char u8x8_u8toa_tab[3] = { 100, 10, 1 } ;
40 | const char *u8x8_u8toap(char * dest, uint8_t v)
41 | {
42 | uint8_t pos;
43 | uint8_t d;
44 | uint8_t c;
45 | for( pos = 0; pos < 3; pos++ )
46 | {
47 | d = '0';
48 | c = *(u8x8_u8toa_tab+pos);
49 | while( v >= c )
50 | {
51 | v -= c;
52 | d++;
53 | }
54 | dest[pos] = d;
55 | }
56 | dest[3] = '\0';
57 | return dest;
58 | }
59 |
60 | /* v = value, d = number of digits */
61 | const char *u8x8_u8toa(uint8_t v, uint8_t d)
62 | {
63 | static char buf[4];
64 | d = 3-d;
65 | return u8x8_u8toap(buf, v) + d;
66 | }
67 |
68 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/platformio.ini:
--------------------------------------------------------------------------------
1 | ; PlatformIO Project Configuration File
2 | ;
3 | ; Build options: build flags, source filter
4 | ; Upload options: custom upload port, speed and extra flags
5 | ; Library options: dependencies, extra library storages
6 | ; Advanced options: extra scripting
7 | ;
8 | ; Please visit documentation for the other options and examples
9 | ; https://docs.platformio.org/page/projectconf.html
10 |
11 | [env:pico32]
12 | platform = espressif32
13 | board = pico32
14 | framework = arduino
15 |
16 | upload_port = COM8
17 | upload_speed = 921600
18 |
19 | board_build.partitions = min_spiffs.csv
20 | monitor_speed = 115200
21 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/src/BLE.cpp:
--------------------------------------------------------------------------------
1 | #include "OpenT12.h"
2 |
3 | char BLE_name[20] = "OpenHeat-BT";
4 | uint8_t BLE_State = true;
5 |
6 | void BLE_Init(void)
7 | {
8 |
9 | if (!BLE_State) return;
10 |
11 | SerialBT.begin(BLE_name);
12 | }
13 |
14 | void BLE_Restart(void)
15 | {
16 | SerialBT.end();
17 | BLE_Init();
18 | }
19 |
20 | void BLE_Rename(void)
21 | {
22 | TextEditor("蓝牙设备名", BLE_name);
23 | BLE_Restart();
24 | }
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/src/BLE.h:
--------------------------------------------------------------------------------
1 | #ifndef BLE_H
2 | #define BLE_H
3 |
4 | #include "Type.h"
5 |
6 | extern char BLE_name[20];
7 | extern uint8_t BLE_State;
8 |
9 | void BLE_Init(void);
10 | void BLE_Restart(void);
11 | void BLE_Rename(void);
12 |
13 | #endif
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/src/Beep.h:
--------------------------------------------------------------------------------
1 | #ifndef BEEP_H
2 | #define BEEP_H
3 |
4 | #include "Type.h"
5 |
6 | enum CALCULATORMUSICTONE
7 | {
8 | CMT_NULL = 255,
9 | CMT_1 = 0,
10 | CMT_2 = 2,
11 | CMT_3 = 3,
12 | CMT_4 = 5,
13 | CMT_5 = 7,
14 | CMT_6 = 9,
15 | CMT_7 = 11,
16 | CMT_8 = 12,
17 | CMT_9 = 14,
18 | CMT_P = 15,
19 | CMT_S = 17,
20 | CMT_M = 18,
21 | CMT_D = 21,
22 | CMT_E = 22,
23 | };
24 | struct TONE
25 | {
26 | note_t note;
27 | uint8_t rp;
28 | uint16_t delay;
29 | };
30 | extern TONE testSound[];
31 | extern TONE BootSound[];
32 | extern TONE TipInstall[];
33 | extern TONE TipRemove[];
34 | extern TONE Beep1[];
35 | extern TONE Beep2[];
36 | extern TONE Beep3[];
37 |
38 | extern uint32_t PlayTonesTimer;
39 | extern uint16_t PlayTonesDelayTime;
40 | extern uint16_t PlayTones_Schedule;
41 | extern TONE* MySound;
42 | //�ײ㺯��
43 | void BeepInit(void);
44 | void SetTone(double freq);
45 | double GetNote(note_t note, uint8_t rp);
46 | void SetNote(note_t note, uint8_t rp);
47 | //�߲�Ӧ��
48 | void SetSound(TONE sound[]);
49 | void PlaySoundLoop(void);
50 | uint8_t PlayTones(TONE sound[], uint16_t* Schedule);
51 |
52 | #endif
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/src/Bezier.cpp:
--------------------------------------------------------------------------------
1 | #include "OpenT12.h"
2 |
3 | //https://github.com/ArduboyCollection/arduboy-moire
4 |
5 | const int screenWidth = 128;
6 | const int screenHeight = 64;
7 |
8 | const int numberOfLines = 20;
9 |
10 | const int maxSpeed = 6;
11 |
12 | /*
13 | * structs that describe the scene
14 | */
15 |
16 | struct Point
17 | {
18 | int x;
19 | int y;
20 | };
21 |
22 | struct Velocity
23 | {
24 | int dx;
25 | int dy;
26 | };
27 |
28 | struct End
29 | {
30 | Point p;
31 | Velocity v;
32 | };
33 |
34 | struct Line
35 | {
36 | End e0;
37 | End e1;
38 | };
39 |
40 | struct Scene
41 | {
42 | Line lines[numberOfLines];
43 | int indexOfHeadLine = numberOfLines - 1;
44 | };
45 |
46 | /*
47 | * scene initialization
48 | */
49 |
50 | static Point randomPoint()
51 | {
52 | return {random(screenWidth), random(screenHeight)};
53 | }
54 |
55 | static int randomSpeed()
56 | {
57 | return random(1, maxSpeed);
58 | }
59 |
60 | static Velocity randomVelocity()
61 | {
62 | return {randomSpeed(), randomSpeed()};
63 | }
64 |
65 | static End randomEnd()
66 | {
67 | return {randomPoint(), randomVelocity()};
68 | }
69 |
70 | static Line randomLine()
71 | {
72 | return {randomEnd(), randomEnd()};
73 | }
74 |
75 | static Point PointZero = {0, 0};
76 | static Velocity VelocityZero = {0, 0};
77 | static End EndZero = {PointZero, VelocityZero};
78 | static Line LineZero = {EndZero, EndZero};
79 |
80 |
81 | /*
82 | * functions to advance basic value types
83 | */
84 | static End endByAdvancingEnd(End en)
85 | {
86 |
87 | int ndx = en.v.dx;
88 | int ndy = en.v.dy;
89 |
90 | int nx = en.p.x + ndx;
91 | int ny = en.p.y + ndy;
92 |
93 | if (nx < 0 || nx > screenWidth)
94 | {
95 | ndx = -1 * sign(ndx) * randomSpeed();
96 | nx = en.p.x + ndx;
97 | }
98 | if (ny < 0 || ny > screenHeight)
99 | {
100 | ndy = -1 * sign(ndy) * randomSpeed();
101 | ny = en.p.y + ndy;
102 | }
103 |
104 | return {
105 | {nx, ny},
106 | {ndx, ndy}
107 | };
108 | }
109 |
110 | static Line lineByAdvancingLine(Line line)
111 | {
112 | return {
113 | endByAdvancingEnd(line.e0),
114 | endByAdvancingEnd(line.e1)
115 | };
116 | }
117 |
118 | /*
119 | * functions to operate on pointer to scene
120 | */
121 |
122 | static void sceneInit(Scene* scene)
123 | {
124 | for (int i = 0; i < numberOfLines; i++)
125 | {
126 | scene->lines[i] = LineZero;
127 | }
128 | scene->lines[scene->indexOfHeadLine] = randomLine();
129 | }
130 |
131 | static Line* sceneLine(Scene* scene, int index)
132 | {
133 | int j = (scene->indexOfHeadLine + 1 + index) % numberOfLines;
134 | return &(scene->lines[j]);
135 | }
136 |
137 | static void sceneAdvance(Scene* scene)
138 | {
139 | Line head = scene->lines[scene->indexOfHeadLine];
140 | Line nextHead = lineByAdvancingLine(head);
141 | scene->indexOfHeadLine = (scene->indexOfHeadLine + 1) % numberOfLines;
142 | scene->lines[scene->indexOfHeadLine] = nextHead;
143 | }
144 |
145 |
146 | static void drawLine(Line* line, uint16_t color)
147 | {
148 | Disp.drawLine(line->e0.p.x, line->e0.p.y, line->e1.p.x, line->e1.p.y);
149 | }
150 |
151 |
152 | void RunSleepLoop(void)
153 | {
154 | static Scene scene;
155 |
156 | static bool SleepScreenInit = false;
157 | if (!SleepScreenInit)
158 | {
159 | sceneInit(&scene);
160 | SleepScreenInit = true;
161 | }
162 |
163 | if (!SleepEvent) return;
164 |
165 | Line* tail = sceneLine(&scene, 0);
166 | drawLine(tail, 0);
167 | sceneAdvance(&scene);
168 | for (int i = 0; i < numberOfLines; i++)
169 | {
170 | Line* line = sceneLine(&scene, i);
171 | drawLine(line, 1);
172 | }
173 | }
174 |
175 |
176 |
177 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/src/Bezier.h:
--------------------------------------------------------------------------------
1 | #ifndef Bezier_H
2 | #define Bezier_H
3 | void RunSleepLoop(void);
4 | #endif
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/src/Bitmap.h:
--------------------------------------------------------------------------------
1 | #ifndef BITMAP_H
2 | #define BITMAP_H
3 |
4 | #include "Type.h"
5 |
6 | //128x64
7 | extern uint8_t Logo[];
8 | // width: 170, height: 128
9 | extern uint8_t Logo2[];
10 |
11 | extern uint8_t TranAnimation[];
12 | extern uint8_t TranAnimation2[];
13 |
14 | extern uint8_t QRC[];
15 | extern uint8_t Set0[];
16 | extern uint8_t Set1[];
17 | extern uint8_t Set2[];
18 | extern uint8_t Set3[];
19 | extern uint8_t Set4[];
20 | extern uint8_t Set4F[];
21 | extern uint8_t Set4FF[];
22 | extern uint8_t Set5[];
23 | extern uint8_t Set5_1[];
24 | extern uint8_t Set6[];
25 | extern uint8_t Set_LANG[];
26 | extern uint8_t Set7[];
27 | extern uint8_t Set11[];
28 | extern uint8_t Set8[];
29 | extern uint8_t Set9[];
30 | extern uint8_t Set10[];
31 | extern uint8_t Set13[];
32 | extern uint8_t Set12[];
33 | extern uint8_t Set14[];
34 | extern uint8_t Set15[];
35 | extern uint8_t Set16[];
36 | extern uint8_t Set17[];
37 | extern uint8_t Set18[];
38 | extern uint8_t Lang_CN[];
39 | extern uint8_t Lang_EN[];
40 | extern uint8_t Lang_JP[];
41 | extern uint8_t Save[];
42 | extern uint8_t Load[];
43 | extern uint8_t Lock[];
44 | extern uint8_t Set19[];
45 | extern uint8_t IMG_Pen[];
46 | extern uint8_t IMG_Pen2[];
47 | extern uint8_t IMG_Tip[];
48 | extern uint8_t IMG_Files[];
49 | extern uint8_t IMG_Flip[];
50 | extern uint8_t IMG_Sun[];
51 | extern uint8_t IMG_Size[];
52 | extern uint8_t IMG_Animation[];
53 | extern uint8_t IMG_Animation_DISABLE[];
54 | extern uint8_t IMG_Trigger[];
55 | extern uint8_t IMG_VibrationSwitch[];
56 | extern uint8_t IMG_ReedSwitch[];
57 | extern uint8_t IMG_BLE[];
58 | extern uint8_t IMG_ListMode[];
59 |
60 | extern uint8_t IMG_Load[];
61 | extern uint8_t PositioningCursor[];
62 | extern uint8_t Pointer[];
63 | extern uint8_t Lightning[];
64 | extern uint8_t Battery_NoPower[];
65 | extern uint8_t IMG_BLE_S[];
66 | //状态提示图标
67 | //width:14,height:14
68 | extern uint8_t c1[];
69 | extern uint8_t c2[];
70 | extern uint8_t c3[];
71 | extern uint8_t c5[];
72 | extern uint8_t c6[];
73 | extern uint8_t c7[];
74 | extern uint8_t* C_table[];
75 |
76 | #endif
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/src/Calibration.h:
--------------------------------------------------------------------------------
1 | #ifndef Calibration_H
2 | #define Calibration_H
3 |
4 | #include "Type.h"
5 | //温度拟合
6 | /*
7 | 50-50
8 | 100-70
9 | 150-134
10 | 200-221
11 | 250-300
12 | 300-379
13 | 350-460
14 | 400-520
15 | 450-579
16 | */
17 |
18 | //温度拟合经验常数:按照实际情况通过拟合得到
19 | #define TempP1 51.6128997803
20 | #define TempP2 0.1443523616
21 | #define TempP3 0.0000061750
22 | #define TempP4 -0.0000000001
23 |
24 | #define FixNum 10
25 | extern double PTemp[FixNum]; //温度拟合系数
26 | extern long Calibration_Base[FixNum];
27 | extern long Calibration_Input[FixNum];
28 |
29 | void ShowCurveCoefficient(void);
30 | void DrawTempCurve(void);
31 | void CalibrationTemperature(void);
32 | void gauss_solve(long n, double A[], double x[], double b[]);
33 | void polyfit(long n, long x[], long y[], long poly_n, double p[]);
34 | #endif
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/src/Event.h:
--------------------------------------------------------------------------------
1 | #ifndef SYSEvent_H
2 | #define SYSEvent_H
3 |
4 | #include "Type.h"
5 |
6 | extern uint32_t BoostTimer;
7 |
8 | extern uint32_t EventTimerUpdate;
9 | void TimerUpdateEvent(void);
10 |
11 | void BoostButton_EventLoop(void);
12 | void FastPID_MenuSummon_EventLoop(void);
13 | void ShutdownEventLoop(void);
14 |
15 | bool EnterPasswd(void);
16 | void SetPasswd(void);
17 |
18 | void TimerEventLoop(void);
19 | void SYS_StateCode_Update(void);
20 |
21 | void SW_IRQHandler(void);
22 | void SW_WakeLOOP(void);
23 | #endif
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/src/ExternDraw.h:
--------------------------------------------------------------------------------
1 | #ifndef ExternDraw
2 | #define ExternDraw
3 |
4 | #include "Type.h"
5 |
6 | void EnterLogo(void);
7 | void ShowBootMsg(void);
8 |
9 |
10 | extern uint8_t DisplayFlashTick;
11 | void Clear(void);
12 | void Display(void);
13 |
14 | void Draw_Utf(int x, int y, char* s);
15 | void Blur(int sx, int sy, int ex, int ey, int f, int delay);
16 | void Draw_Scale(int x, int y, int w, int h, int s, int v);
17 | void Draw_Num_Bar(float i, float a, float b, int x, int y, int w, int h, int c);
18 | void Draw_Pixel_Resize(int x, int y, int ox, int oy, int w, int h);
19 | void Draw_Slow_Bitmap(int x, int y, const unsigned char* bitmap, unsigned char w, unsigned char h);
20 | void Draw_Slow_Bitmap_Resize(int x, int y, uint8_t* bitmap, int w1, int h1, int w2, int h2);
21 | void DrawStatusBar(bool color);
22 |
23 | void DrawIntensiveComputingLine(void);
24 | void DrawIntensiveComputing(void);
25 |
26 | void DrawMsgBox(char* s);
27 | void DrawHighLightText(int x, int y, char* s);
28 |
29 |
30 | void TextEditor(char* title, char* text);
31 | #endif
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/src/FilesSystem.h:
--------------------------------------------------------------------------------
1 | #ifndef FILESSYSTEM_H
2 | #define FILESSYSTEM_H
3 |
4 | #include "Type.h"
5 | #include "FS.h"
6 | #include "SPIFFS.h"
7 |
8 | extern char SYS_SVAE_PATH[];
9 |
10 | void FilesSystemInit(void);
11 |
12 | void SYS_Save(void);
13 | void SYS_Load(void);
14 |
15 | void listDir(fs::FS &fs, const char* dirname, uint8_t levels);
16 | void readFile(fs::FS &fs, const char* path);
17 | void writeFile(fs::FS &fs, const char* path, const char* message);
18 | void appendFile(fs::FS &fs, const char* path, const char* message);
19 | void renameFile(fs::FS &fs, const char* path1, const char* path2);
20 | void deleteFile(fs::FS &fs, const char* path);
21 | void testFileIO(fs::FS &fs, const char* path);
22 | #endif
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/src/MathFun.cpp:
--------------------------------------------------------------------------------
1 | #include "OpenT12.h"
2 |
3 | extern U8G2_SSD1306_128X64_NONAME_F_HW_I2C Disp;
4 | /*
5 | @作用 获取数值某一位
6 | @传入 数值 指定位数
7 | @传出 数值指定位数的十进制值
8 | */
9 | int get_Dec_Bit(int x, int n)
10 | {
11 | return (int) (x / pow(10.0, n)) % 10;
12 | }
13 |
14 | /*
15 | @作用 获取数值长度
16 | @传入 数值
17 | @传出 数值长度
18 | */
19 | int Get_Dec_Deep(int x)
20 | {
21 | int i = 0;
22 | do
23 | {
24 | i++;
25 | x /= 10;
26 | } while (x != 0);
27 | return i;
28 | }
29 |
30 | /*
31 | @作用 获取数字每一位的和
32 | @传入 数字
33 | @输出 数字每一位的和
34 | */
35 | int Get_Int_Bit_Sum(int x)
36 | {
37 | int sum = 0;
38 | for (int i = 0; i < Get_Dec_Deep(x); i++)
39 | sum += get_Dec_Bit(x, i);
40 | return sum;
41 | }
42 |
43 |
44 | void GetUtf8Length(char const* str, int* cnt)
45 | {
46 | while (*str != '\0')
47 | {
48 | if (*str & 1 << 7)
49 | {/* 第8位(从右到左)为1*/
50 | if (*str & (1 << 6))
51 | {/*第7位为1*/
52 | if (*str & (1 << 5))
53 | {/*第6位为1*/
54 | if (*str & (1 << 4))
55 | {/*第5位为1 11110xxx*/
56 | cnt[4]++, cnt[0]++, str += 4;/*4字节的字符总数加1,各种长度总数加1,指针向后移动4位*/
57 | continue;/*开始下次循环*/
58 | }
59 |
60 | cnt[3]++, cnt[0]++, str += 3;/* 1110xxxx*/
61 | continue;
62 |
63 | }
64 |
65 | cnt[2]++, cnt[0]++, str += 2;/*110xxxxx*/
66 | continue;
67 |
68 | }
69 | }
70 | cnt[1]++, cnt[0]++, str += 1;/*0xxxxxxx*/
71 | continue;
72 | }
73 | }
74 |
75 | uint32_t Get_UTF8_Ascii_Pix_Len(uint8_t size, char* s)
76 | {
77 | return Disp.getUTF8Width(s);
78 | }
79 |
80 | /*
81 | @作用 UTF8混合字符串计算水平居中
82 | @输入:UTF8字符串
83 | @输出:居中位置
84 | */
85 | uint32_t UTF8_HMiddle(uint32_t x, uint32_t w, uint8_t size, char* s)
86 | {
87 | return x + (w - Get_UTF8_Ascii_Pix_Len(size, s)) / 2;
88 | }
89 |
90 | //串口打印内存
91 | void ShowBuffer(uint8_t* buffer, uint32_t size)
92 | {
93 | uint8_t AsciiBuffer[17];
94 | uint32_t OutputSize = 0;
95 | for (uint32_t i = 0; i < size; i++)
96 | {
97 | if (i % 16 == 0)
98 | {
99 | memcpy(AsciiBuffer, buffer + i, 16);
100 | AsciiBuffer[16] = '\0';
101 | printf("\n0X%08X | ", i + &(*buffer));
102 | for (uint8_t j = 0; j < 16; j++)
103 | {
104 | OutputSize++;
105 | if (OutputSize > size) break;
106 | printf("%02X ", buffer[i + j]);
107 | }
108 |
109 | printf("| %s", AsciiBuffer);
110 | }
111 | }
112 | printf("\n\n\n%s", buffer);
113 | }
114 |
115 |
116 | /**
117 | *卡尔曼滤波器
118 | *@param KFP *kfp 卡尔曼结构体参数
119 | * float input 需要滤波的参数的测量值(即传感器的采集值)
120 | *@return 滤波后的参数(最优值)
121 | */
122 | float kalmanFilter(KFP* kfp, float input)
123 | {
124 | //预测协方差方程:k时刻系统估算协方差 = k-1时刻的系统协方差 + 过程噪声协方差
125 | kfp->Now_P = kfp->LastP + kfp->Q;
126 | //卡尔曼增益方程:卡尔曼增益 = k时刻系统估算协方差 / (k时刻系统估算协方差 + 观测噪声协方差)
127 | kfp->Kg = kfp->Now_P / (kfp->Now_P + kfp->R);
128 | //更新最优值方程:k时刻状态变量的最优值 = 状态变量的预测值 + 卡尔曼增益 * (测量值 - 状态变量的预测值)
129 | kfp->out = kfp->out + kfp->Kg * (input - kfp->out);//因为这一次的预测值就是上一次的输出值
130 | //更新协方差方程: 本次的系统协方差付给 kfp->LastP 威下一次运算准备。
131 | kfp->LastP = (1 - kfp->Kg) * kfp->Now_P;
132 | return kfp->out;
133 | }
134 |
135 | /***
136 | * @description: 把ESP32的原生ADC采样数据通过经验公式转换为电压
137 | * @param {uint16_t} adc
138 | * @return 电压(单位:V)
139 | */
140 | #define ADC1_MinVol 0.128
141 | #define ADC1_MaxVol 3.11
142 | double ESP32_ADC2Vol(uint16_t adc)
143 | {
144 | //return ((adc / 4095.0) * (ADC1_MaxVol - ADC1_MinVol)) + ADC1_MinVol;
145 | return (adc / 4095.0) * 3.3;
146 | }
147 |
148 | /***
149 | * @description: 分钟转毫秒
150 | * @param {uint32_t} min
151 | * @return {*}
152 | */
153 | uint32_t Minute2Millis(float min)
154 | {
155 | return min * 60 * 1000;
156 | }
157 | /***
158 | * @description: 判断符号正负
159 | * @param {int} x
160 | * @return {*}
161 | */
162 | int sign(int x)
163 | {
164 | return (x > 0) - (x < 0);
165 | }
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/src/MathFun.h:
--------------------------------------------------------------------------------
1 | #ifndef MathFun_H
2 | #define MathFun_H
3 |
4 | #include "Type.h"
5 |
6 | int get_Dec_Bit(int x, int n);
7 | int Get_Dec_Deep(int x);
8 | int Get_Int_Bit_Sum(int x);
9 | uint32_t Get_UTF8_Ascii_Pix_Len(uint8_t size, char* s);
10 | uint32_t UTF8_HMiddle(uint32_t x, uint32_t w, uint8_t size, char* s);
11 | uint32_t Minute2Millis(float min);
12 |
13 | void ShowBuffer(uint8_t* buffer, uint32_t size);
14 |
15 | //卡尔曼滤波
16 | typedef struct
17 | {
18 | float LastP;//上次估算协方差 初始化值为0.02
19 | float Now_P;//当前估算协方差 初始化值为0
20 | float out;//卡尔曼滤波器输出 初始化值为0
21 | float Kg;//卡尔曼增益 初始化值为0
22 | float Q;//过程噪声协方差 初始化值为0.001
23 | float R;//观测噪声协方差 初始化值为0.543
24 | } KFP;//Kalman Filter parameter
25 | float kalmanFilter(KFP* kfp, float input);
26 |
27 | double ESP32_ADC2Vol(uint16_t adc);
28 | int sign(int x);
29 |
30 | #endif
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/src/Menu.h:
--------------------------------------------------------------------------------
1 | #ifndef __MENU_H
2 | #define __MENU_H
3 |
4 | #include
5 | #include "Type.h"
6 |
7 | extern uint8_t Menu_System_State;
8 | extern uint32_t pages_Tip_Display_timer;
9 | extern uint8_t Menu_JumpAndExit;
10 | extern uint8_t Menu_JumpAndExit_Level;
11 |
12 | void System_TipMenu_Init(void);
13 | void System_PIDMenu_Init(void);
14 | void System_Menu_Init(void);
15 | void System_UI_Init(void);
16 | void System_UI(void);
17 |
18 | int Get_Real_Menu_Level_Id(uint8_t id);
19 | int Get_Menu_Id(uint8_t lid, uint8_t id);
20 |
21 |
22 | void Menu_Control(void);
23 | void Draw_APP(int x, int y, char* bitmap);
24 | void Page_Footnotes(int a, int b);
25 | void Text_Reader(char* s);
26 | void Run_Menu_Id(uint8_t lid, uint8_t id);
27 | void Next_Menu(void);
28 | void Pop_Windows(char* s);
29 | void Exit_Menu_System(void);
30 | void Save_Exit_Menu_System(void);
31 | void JumpWithTitle(void);
32 | void SmoothAnimationSystem_Clean(void);
33 |
34 | void Smooth_Animation_System(void);
35 |
36 | void Update_OLED_Light_Level(void);
37 | void Update_OLED_Flip(void);
38 |
39 | void PopMsg_RotaryDirection(void);
40 | void PopMsg_ScreenFlip(void);
41 | void PopMsg_ListMode(void);
42 | void SYS_About(void);
43 |
44 | /*
45 | @名称 Smooth_Animation
46 | @变量
47 | x 过渡值
48 | last 上次的值
49 | val 目标值
50 | w 平滑权重
51 | */
52 | struct Smooth_Animation
53 | {
54 | float x; //过渡值
55 | int last; //上次的值
56 | int val; //目标值
57 | float w; //平滑权重
58 | uint8_t a; //是否允许累加
59 | uint8_t b; //选择过渡动画计算函数
60 | };
61 | extern struct Smooth_Animation Menu_Smooth_Animation[];
62 | /*
63 | @名称 Slide_Bar
64 | @变量
65 | x 值
66 | min 最小值
67 | max 最大值
68 | step 步进
69 | */
70 | struct Slide_Bar
71 | {
72 | float* x; //值
73 | float min;
74 | float max;
75 | float step;
76 | };
77 | extern struct Slide_Bar Slide_space[];
78 |
79 | struct Menu_Level_System
80 | {
81 | uint8_t id; //当前层id
82 | int x; //当前层所指选项
83 | uint8_t min; //最小页
84 | uint8_t max; //最大页
85 | uint8_t a; //参数A 0:无动作 1:开启图标化菜单
86 | };
87 |
88 | struct Menu_System
89 | {
90 | uint8_t lid; //层id
91 | uint8_t id; //选项id
92 | uint8_t x; //执行操作 0-跳转到菜单 1-执行函数 2-菜单名 3-开关控件 4-滑动条控件
93 | char* name; //选项名称
94 | uint8_t* icon;
95 | uint8_t a; //附加参数_1 (0-jump_Level_id) (3-开关id) (4-滑动条id)
96 | uint8_t b; //附加参数_2 (0-jump_id) (4-滑动条:true?执行函数:无操作)
97 | void (* function)();
98 | };
99 |
100 | extern struct Menu_System Menu[];
101 | extern struct Menu_Level_System MenuLevel[];
102 |
103 | #endif
104 |
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/src/MyShell.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peng-zhihui/OpenHeat/db5a055e7a26242cbcab9cbef24936952850b85a/2.Firmware/OpenHeat-fw/src/MyShell.h
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/src/OpenT12.h:
--------------------------------------------------------------------------------
1 | #ifndef OPENT12_H
2 | #define OPENT12_H
3 |
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 | #include
10 | #include
11 | #include "BluetoothSerial.h"
12 | #include "Type.h"
13 | #include "serial_putc.h"
14 | #include "MyShell.h"
15 | #include "Rotary.h"
16 | #include "MathFun.h"
17 | #include "ExternDraw.h"
18 | #include "Event.h"
19 | #include "Menu.h"
20 | #include "Calibration.h"
21 | #include "TipControl.h"
22 | #include "Beep.h"
23 | #include "Bezier.h"
24 | #include "TipManager.h"
25 | #include "FilesSystem.h"
26 | #include "qrcode.h"
27 | #include "BLE.h"
28 | #include "Bitmap.h"
29 |
30 | #define setbit(x, y) x|=(1<> (y)&1)
34 |
35 | //注意Pin36与Pin39连接了内部霍尔传感器,不建议复用高敏感用途
36 | //另外,建议给ADC输入串联一个0.1uF的电容,有利于减少噪声
37 | #define LED_Pin 2
38 | #define BEEP_PIN 25
39 |
40 | #define ROTARY_PIN1 27
41 | #define ROTARY_PIN2 14
42 | #define BUTTON_PIN 33
43 |
44 | #define TIP_ADC_PIN -1
45 | #define NTC_ADC -1
46 | #define POWER_ADC_PIN 4
47 | #define CUR_ADC -1
48 |
49 | #define PWM1_PIN 26
50 | #define PWM2_PIN -1
51 | #define SW_PIN -1
52 |
53 | //计算主电源电压
54 | #define POWER_ADC_VCC_R1 10000
55 | #define POWER_ADC_R2_GND 1000
56 |
57 | #define CNSize 12
58 | #define SCREEN_COLUMN 128
59 | #define SCREEN_ROW 64
60 | #define SCREEN_PAGE_NUM 8
61 | #define SCREEN_FONT_ROW 4
62 |
63 | //温度限制
64 | #define TipMaxTemp 300
65 | #define TipMinTemp 0
66 |
67 | //烙铁安装移除事件计时器冷却时间:防止事件临界值抖动
68 | #define TipEvent_CoolTime 1500
69 | //到温提示声播放稳定期:防止温度没有稳定下来就播放到温音效
70 | #define TempToneStabilitytime 1000
71 |
72 | enum SYSLANG
73 | {
74 | LANG_English = 0,
75 | LANG_Chinese,
76 | LANG_Russian,
77 | };
78 |
79 | enum PANELSET
80 | {
81 | PANELSET_Simple = 0,
82 | PANELSET_Detailed,
83 | };
84 |
85 | enum HANDLETRIGGER
86 | {
87 | HANDLETRIGGER_VibrationSwitch = 0,
88 | HANDLETRIGGER_ReedSwitch,
89 | };
90 |
91 | enum MESSAGETYPE
92 | {
93 | LOG_INFO = 0,
94 | LOG_OK,
95 | LOG_FAILED,
96 | LOG_WARNING,
97 | LOG_ERROR,
98 | };
99 |
100 | void Log(MESSAGETYPE type, char* s);
101 | void SYS_Reboot(void);
102 | void About(void);
103 |
104 |
105 | extern uint64_t ChipMAC;
106 | extern char ChipMAC_S[19];
107 | extern char CompileTime[20];
108 |
109 | extern BluetoothSerial SerialBT;
110 | extern OneButton RButton;
111 | extern U8G2_SSD1306_128X64_NONAME_F_HW_I2C Disp;
112 | extern PID MyPID;
113 | extern KFP KFP_Temp;
114 |
115 | extern uint8_t DEBUG_MODE;
116 |
117 | extern char* TipName;
118 |
119 | extern float BootTemp;
120 | extern float SleepTemp;
121 | extern float ScreenProtectorTime;
122 | extern float BoostTemp;
123 |
124 | extern float ShutdownTime;
125 | extern float SleepTime;
126 | extern float BoostTime;
127 |
128 | extern bool SYS_Ready;
129 |
130 | extern bool TipInstallEvent;
131 | extern bool TipCallSleepEvent;
132 | extern bool TempToneFlag;
133 | extern bool SleepScreenProtectFlag;
134 |
135 | extern bool ERROREvent;
136 | extern bool ShutdownEvent;
137 | extern bool SleepEvent;
138 | extern bool BoostEvent;
139 | extern bool UnderVoltageEvent;
140 |
141 | extern bool PWM_WORKY;
142 |
143 |
144 | extern uint8_t PIDMode;
145 | extern uint8_t Use_KFP;
146 |
147 | extern uint8_t PanelSettings;
148 | extern uint8_t ScreenFlip;
149 | extern uint8_t SmoothAnimation_Flag;
150 | extern float ScreenBrightness;
151 | extern uint8_t OptionStripFixedLength_Flag;
152 |
153 | extern uint8_t Volume;
154 | extern uint8_t RotaryDirection;
155 | extern uint8_t HandleTrigger;
156 |
157 | extern double SYS_Voltage;
158 | extern float UndervoltageAlert;
159 | extern char BootPasswd[20];
160 | extern uint8_t Language;
161 | extern uint8_t MenuListMode;
162 |
163 | extern float ADC_PID_Cycle;
164 |
165 | extern double Get_MainPowerVoltage(void);
166 |
167 | enum TEMP_CTRL_STATUS_CODE
168 | {
169 | TEMP_STATUS_ERROR = 0,
170 | TEMP_STATUS_OFF,
171 | TEMP_STATUS_SLEEP,
172 | TEMP_STATUS_BOOST,
173 | TEMP_STATUS_WORKY,
174 | TEMP_STATUS_HEAT,
175 | TEMP_STATUS_HOLD,
176 | };
177 | extern uint8_t TempCTRL_Status;
178 | extern char* TempCTRL_Status_Mes[];
179 |
180 |
181 | #endif
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/src/Rotary.h:
--------------------------------------------------------------------------------
1 | #ifndef sys_Counter_H
2 | #define sys_Counter_H
3 |
4 | #include
5 | #include "Type.h"
6 |
7 | #define ROTARY_TYPE 2
8 |
9 | extern uint8_t SYSKey;
10 | extern bool Counter_LOCK_Flag;
11 |
12 | void sys_RotaryInit(void);
13 | void sys_Counter_Set(double min, double max, double step, double c);
14 | void sys_Counter_SetVal(double c);
15 | void RotaryUp(void);
16 | void RotaryDown(void);
17 |
18 | void sys_Counter_click(void);
19 | void sys_Counter_doubleclick(void);
20 | void sys_Counter_longclick(void);
21 | void sys_Counter_IRQHandler(void);
22 | double sys_Counter_Get(void);
23 | uint8_t sys_Counter_Change(void);
24 |
25 | void Clear_RButton_FIFO(void);
26 | uint8_t sys_KeyProcess(void);
27 | #endif
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/src/TipControl.h:
--------------------------------------------------------------------------------
1 | #ifndef TipControl_H
2 | #define TipControl_H
3 |
4 | #include "Type.h"
5 |
6 | extern uint8_t MyMOS;
7 | extern uint8_t POWER;
8 | extern uint8_t PWM;
9 | extern uint8_t LastPWM;
10 | extern uint16_t LastADC;
11 | extern double TipTemperature;
12 | extern double PID_Output;
13 | extern double PID_Setpoint;
14 | extern double TempGap;
15 |
16 | extern float SamplingRatioWork;
17 | extern float ADC_PID_Cycle_List[3];
18 |
19 | extern float aggKp, aggKi, aggKd;
20 | extern float consKp, consKi, consKd;
21 |
22 | extern uint8_t PWMOutput_Lock;
23 |
24 | void TipControlInit(void);
25 | void PWMOutput(uint8_t pin, uint8_t pwm);
26 | int GetADC0(void);
27 | double CalculateTemp(double ADC, double P[]);
28 | void SetPOWER(uint8_t POWER);
29 |
30 | void TemperatureControlLoop(void);
31 |
32 | #endif
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/src/TipManager.cpp:
--------------------------------------------------------------------------------
1 | #include "OpenT12.h"
2 |
3 | uint8_t TipID = 0;
4 | uint8_t TipTotal = 1;
5 |
6 | TIPCONFIG MyTip[MaxTipConfig] = {
7 | {{51.6128997803, 0.1443523616, 0.0000061750, -0.0000000001}, {{30.0, 0, 0.5}, {20.0, 0, 0.5}}, "智能加热台"},
8 | };
9 |
10 | /***
11 | * @description: 载入烙铁头配置到系统环境
12 | * @param {*}
13 | * @return {*}
14 | */
15 | void LoadTipConfig(void)
16 | {
17 | //载入温度系数
18 | for (uint8_t i = 0; i < 4; i++)
19 | {
20 | PTemp[i] = MyTip[TipID].PTemp[i];
21 | }
22 | //载入PID参数
23 | aggKp = MyTip[TipID].PID[0][0];
24 | aggKi = MyTip[TipID].PID[0][1];
25 | aggKd = MyTip[TipID].PID[0][2];
26 |
27 | consKp = MyTip[TipID].PID[1][0];
28 | consKi = MyTip[TipID].PID[1][1];
29 | consKd = MyTip[TipID].PID[1][2];
30 | //载入名称
31 | TipName = MyTip[TipID].name;
32 |
33 | }
34 |
35 | /***
36 | * @description: 保存烙铁头配置到系统环境
37 | * @param {*}
38 | * @return {*}
39 | */
40 | void SaveTipConfig(void)
41 | {
42 | //载入温度系数
43 | for (uint8_t i = 0; i < 4; i++)
44 | {
45 | MyTip[TipID].PTemp[i] = PTemp[i];
46 | }
47 | //载入PID参数
48 | MyTip[TipID].PID[0][0] = aggKp;
49 | MyTip[TipID].PID[0][1] = aggKi;
50 | MyTip[TipID].PID[0][2] = aggKd;
51 |
52 | MyTip[TipID].PID[1][0] = consKp;
53 | MyTip[TipID].PID[1][1] = consKi;
54 | MyTip[TipID].PID[1][2] = consKd;
55 |
56 | //由于名称是用指针传递,所以不需要重新赋值
57 | }
58 |
59 | /***
60 | * @description: 更新菜单配置列表
61 | * @param {*}
62 | * @return {*}
63 | */
64 | void FlashTipMenu(void)
65 | {
66 | uint8_t MLID = Get_Real_Menu_Level_Id(15); //查询配置列表所在的菜单系统层级
67 | uint8_t MID;
68 |
69 | MenuLevel[MLID].max = TipTotal; //修改菜单最大项目数量
70 |
71 | for (uint8_t i = 0; i < TipTotal; i++)
72 | {
73 | MID = Get_Menu_Id(MLID, i + (1)); //查询配置列表项目id,另外 +(1)是为了跳过标题
74 | Menu[MID].name = MyTip[i].name; //刷新名称
75 |
76 | }
77 | }
78 | /***
79 | * @description: 新建配置
80 | * @param {*}
81 | * @return {*}
82 | */
83 | void NewTipConfig(void)
84 | {
85 | if (TipTotal < MaxTipConfig)
86 | {
87 | TipID = TipTotal;
88 |
89 | // char NewName = "---未命名---";
90 | strcpy(MyTip[TipTotal].name, "NewTip");
91 |
92 | for (uint8_t i = 0; i < 4; i++)
93 | {
94 | MyTip[TipID].PTemp[i] = 0;
95 | }
96 |
97 | MyTip[TipID].PID[0][0] = 0;
98 | MyTip[TipID].PID[0][1] = 0;
99 | MyTip[TipID].PID[0][2] = 0;
100 | MyTip[TipID].PID[1][0] = 0;
101 | MyTip[TipID].PID[1][1] = 0;
102 | MyTip[TipID].PID[1][2] = 0;
103 |
104 |
105 | TipTotal++;
106 | Pop_Windows("新建成功");
107 |
108 | TipRename();
109 | } else Pop_Windows("达到上限");
110 |
111 | //重新加载烙铁头参数
112 | LoadTipConfig();
113 | }
114 |
115 | /***
116 | * @description: 重命名当前的配置
117 | * @param {*}
118 | * @return {*}
119 | */
120 | void TipRename(void)
121 | {
122 | TextEditor("[重命名]", MyTip[TipID].name);
123 | }
124 |
125 | /***
126 | * @description: 删除配置
127 | * @param {*}
128 | * @return {*}
129 | */
130 | void TipDel(void)
131 | {
132 | if (TipTotal > 1)
133 | {
134 | //覆盖并移动配置
135 | for (uint8_t i = TipID; i < TipTotal - 1; i++)
136 | {
137 | MyTip[i] = MyTip[i + 1];
138 | }
139 | TipTotal--;
140 | Pop_Windows("删除成功");
141 | } else Pop_Windows("这是最后一个配置");
142 |
143 | //重新加载烙铁头参数
144 | LoadTipConfig();
145 | }
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/src/TipManager.h:
--------------------------------------------------------------------------------
1 | #ifndef TIPMANAGER_H
2 | #define TIPMANAGER_H
3 |
4 | #include "Type.h"
5 |
6 | //最大烙铁头配置数量
7 | #define MaxTipConfig 10
8 | extern uint8_t TipID; //当前选择的烙铁头
9 | extern uint8_t TipTotal; //有效烙铁头配置总数
10 |
11 | struct TIPCONFIG
12 | {
13 | double PTemp[4]; //温度系数
14 | float PID[2][3]; //PID系数{远PID,近PID}
15 | char name[20]; //名称
16 | };
17 |
18 | extern TIPCONFIG MyTip[MaxTipConfig];
19 |
20 | void LoadTipConfig(void);
21 | void SaveTipConfig(void);
22 |
23 | void FlashTipMenu(void);
24 |
25 | void NewTipConfig(void);
26 | void TipRename(void);
27 | void TipDel(void);
28 |
29 | #endif
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/src/Type.h:
--------------------------------------------------------------------------------
1 | #ifndef TYPE_H
2 | #define TYPE_H
3 |
4 | #include
5 |
6 | static const uint8_t D0 = 16;
7 | static const uint8_t D1 = 5;
8 | static const uint8_t D2 = 4;
9 | static const uint8_t D3 = 0;
10 | static const uint8_t D4 = 2;
11 | static const uint8_t D5 = 14;
12 | static const uint8_t D6 = 12;
13 | static const uint8_t D7 = 13;
14 | static const uint8_t D8 = 15;
15 | static const uint8_t D9 = 3;
16 | static const uint8_t D10 = 1;
17 |
18 | #endif
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/src/serial_putc.cpp:
--------------------------------------------------------------------------------
1 | #include "OpenT12.h"
2 |
3 | int fputc(int c, FILE* f)
4 | {
5 | Serial.write(c);
6 | //SerialBT.write(c);
7 | return c;
8 | }
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/src/serial_putc.h:
--------------------------------------------------------------------------------
1 | #ifndef PRINTF_H
2 | #define PRINTF_H
3 | int fputc(int ch, FILE* f);
4 | #endif
--------------------------------------------------------------------------------
/2.Firmware/OpenHeat-fw/test/README:
--------------------------------------------------------------------------------
1 |
2 | This directory is intended for PlatformIO Unit Testing and project tests.
3 |
4 | Unit Testing is a software testing method by which individual units of
5 | source code, sets of one or more MCU program modules together with associated
6 | control data, usage procedures, and operating procedures, are tested to
7 | determine whether they are fit for use. Unit testing finds problems early
8 | in the development cycle.
9 |
10 | More information about PlatformIO Unit Testing:
11 | - https://docs.platformio.org/page/plus/unit-testing.html
12 |
--------------------------------------------------------------------------------
/3.Docs/1.Images/1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peng-zhihui/OpenHeat/db5a055e7a26242cbcab9cbef24936952850b85a/3.Docs/1.Images/1.jpg
--------------------------------------------------------------------------------
/3.Docs/1.Images/2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peng-zhihui/OpenHeat/db5a055e7a26242cbcab9cbef24936952850b85a/3.Docs/1.Images/2.jpg
--------------------------------------------------------------------------------
/3.Docs/1.Images/3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peng-zhihui/OpenHeat/db5a055e7a26242cbcab9cbef24936952850b85a/3.Docs/1.Images/3.jpg
--------------------------------------------------------------------------------
/3.Docs/1.Images/4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peng-zhihui/OpenHeat/db5a055e7a26242cbcab9cbef24936952850b85a/3.Docs/1.Images/4.jpg
--------------------------------------------------------------------------------
/3.Docs/1.Images/5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peng-zhihui/OpenHeat/db5a055e7a26242cbcab9cbef24936952850b85a/3.Docs/1.Images/5.jpg
--------------------------------------------------------------------------------
/3.Docs/1.Images/BUG.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peng-zhihui/OpenHeat/db5a055e7a26242cbcab9cbef24936952850b85a/3.Docs/1.Images/BUG.png
--------------------------------------------------------------------------------
/3.Docs/1.Images/接线说明.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peng-zhihui/OpenHeat/db5a055e7a26242cbcab9cbef24936952850b85a/3.Docs/1.Images/接线说明.png
--------------------------------------------------------------------------------
/3.Docs/2.Datasheet/ESP32-PICO-D4_cn.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peng-zhihui/OpenHeat/db5a055e7a26242cbcab9cbef24936952850b85a/3.Docs/2.Datasheet/ESP32-PICO-D4_cn.pdf
--------------------------------------------------------------------------------
/3.Docs/2.Datasheet/MAX6675ISA.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peng-zhihui/OpenHeat/db5a055e7a26242cbcab9cbef24936952850b85a/3.Docs/2.Datasheet/MAX6675ISA.pdf
--------------------------------------------------------------------------------
/3.Docs/2.Datasheet/NTMFS5C628NLT.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/peng-zhihui/OpenHeat/db5a055e7a26242cbcab9cbef24936952850b85a/3.Docs/2.Datasheet/NTMFS5C628NLT.pdf
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # OpenHeat:开源智能加热台
2 |
3 | > 用于PCB回流焊的实用加热台,比较炫酷,可能目前市面上 **颜值最高** & **功能最强** 的加热台。
4 |
5 | **参数:** 硬件方面基于`ESP32PICO-D4`芯片,输入电源`24V/10A`,最大功率200W,加热温度最高300℃;带蓝牙功能,***后续有空的话我会开发手机APP用于设置升温曲线*** 。
6 |
7 | ## 21-9-17 修复说明:
8 |
9 | 
10 |
11 | ---
12 |
13 | ## 关于本项目
14 |
15 | 
16 |
17 | * 本项目参考了 [createskyblue](https://gitee.com/createskyblue) / [OpenT12](https://gitee.com/createskyblue/OpenT12)开源T12电烙铁项目的固件,感谢这位同学设计的优秀交互动画体验,UI设计深得我心哈哈~
18 |
19 | * 另外铝基板热床的设计采用了[MRobot-Origin](https://github.com/MRobot-Origin)/ [GS_Hbed](https://github.com/MRobot-Origin/GS_Hbed)同学的分型曲线设计,非常有创意~
20 |
21 | ## 使用说明
22 |
23 | #### 1. 打样说明
24 |
25 | 直接用Hardware文件夹里的Gerber文件打样即可:主控制器为4层PCB,无特殊工艺要求;热床为铝基板PCB,可以在嘉立创打样。
26 |
27 | > 铝基板是一种专门用来散热的PCB板材,大家看到的很多大功率LED灯珠就是这种,前阵子嘉立创开放了铝基板打样业务,还很便宜。所以相比于设计一个金属块做热床,这种方式不但成本低而且美观实用。
28 |
29 | 另外其实还有一块可选两层板作为固定件的,这个我还没来得及设计,也很简单,大家可以根据自己情况画一个,或者直接3D打印结构件固定也行。
30 |
31 | #### 2. 固件说明
32 |
33 | 固件我这边是基于PlatformIO移植的,所以大家用这个平台的话直接打开下载就行了;如果是用Arduino IDE的话,先安装Library里面的库文件,然后一样下载。
34 |
35 | 固件库没有完全配置完成(因为原版固件是设计为电烙铁使用的),晚些我硬件都就位了会调试好固件供大家直接下载。
36 |
37 | #### 3. 关于结构件
38 |
39 | 这个我也还在设计,我的风格肯定是以美观小巧为主,大家可以等我放出3D打印文件。
40 |
41 | #### 4. 关于温度传感器
42 |
43 | 我这边是用的是K型热电偶,在PCB上已经集成了采集芯片,需要自己买一个表贴式的K型热电偶连接到板子下方的两个焊盘。
44 |
45 | > 注意热电偶和热床的接触要绝缘,用高温胶带隔一下就行。另外热电偶是有极性的,如果发现加热后温度反而下降说明接反了。
46 | >
47 | > 现在代码中还没有加热电偶的代码,晚一点有空了会调好完整固件。大家自己添加也很容易,MAX6675使用SPI驱动,Arduino平台有很多例程。
48 |
49 | #### 5. 关于元器件BOM
50 |
51 | **注意!!!** C9电容一定要选耐压足够的,因为是并联到24V的VCC上,如果耐压不够短路的话可以看到烟花!!
52 |
53 | #### 接线图
54 |
55 | 
56 |
57 | ## 欢迎star支持 :D
58 |
59 | 
60 |
61 | 
62 |
63 | 
64 |
65 | 
66 |
--------------------------------------------------------------------------------