移植 Arduino IDE 裡面的 Blink 範例程式到 MicroPython,需要用到兩個 MicroPython 模組,time模組用來處理時間延遲,在 MicroPython 裡面,不會直接碰硬體計時器 Timer,或計數器 Counter,他把這些工作,包進去實時作業系統 RTOS 的管理中,以虛擬計時器的方式來實現。machine 模組裡面的 Pin 類別,則是用來控制 NodeMCU 的 GPIO 腳位。
[教學] 認識 MicroPython (二) - 啟用 WebREPL 遠端 WebSocket 服務
安裝了 MicroPython 之後,花了一點時間,參考官網介紹的那些模組與指令,粗淺了解一下支援 NodeMCU、ESP8266 的 Python 模組,同時也想試驗一下,把 Arduino IDE 中,最簡單的 Blink 範例程式移植到 MicroPython 來。
要在 MicroPython 裡面寫入程式,你可以直接用 Python 語言的寫檔語法:
fp = open('main.py', 'w')
fp.writeline('import time\n")
fp.writeline('from machine import Pin\n')
...
只是這樣的搞法,程式出現小錯誤,要用上述寫檔方法改正,會很麻煩。WebREPL目前有上傳、下載檔案的功能,還不如在電腦編輯好,再用這個工具上傳比較方便。
[教學] 認識 MicroPython (一) - 安裝 MicroPython 核心進去 NodeMCU v3
買來 Node MCU v3 也快一年了,開始試著學用 Arduino IDE 來操作,之前也先試驗過 ESP8266。但總覺得用 Arduino IDE 來開發 IoT ,實在不是個聰明的方法,太多瑣碎的東西需要處理。C語言缺乏一些簡單現成的資料結構、沒有好用的字串處理功能,加上Arduino IDE 對網路、檔案的處理還停留在韌體的概念,對於需要大量處理資料、字串的 IoT 應用,Arduino IDE 簡直是個惡夢。所以自從設計了 Node MCU + NodeMCU Base Ver 1.0 的殼子之後,這玩意兒就這麼擱置了。最近重新發現 MicroPython 這個社群,原來 NodeMCU (ESP8266) 或 NodeMCU 可以裝上他們的 Firmware,並用 Python 語言來開發應用,前幾年曾經看過 MicroPython,但那時還沒有學會 Python,也沒有特別注意。
如果 Microcontroller 單片機,可以用 Python 開發程式,那該是多幸福的事情啊?
如果 Microcontroller 單片機,可以用 Python 開發程式,那該是多幸福的事情啊?
3D列印,改用 ABS 線材。如何預防翹邊?
![]() |
| 用過OK的「蝦皮牌」 ABS線材 |
另外,ABS 線材比 PLA 多耐熱一百度,到 160、170度才會變軟。還能溶於便宜的丙酮,清理噴頭的時候,直接把噴頭拆下,丟到裝有丙酮的小玻璃瓶裡面(我是用雞精瓶、保鮮膜封口),隔天用牙籤、牙刷,就能把噴頭管壁上的陳年線材,清理得乾乾淨淨、開口通暢。更重要的是,ABS 線材的價格不貴,蝦皮上一捆 2xx元的ABS就很好用了。
如何讓3D列印機,印出完美的第一層?
Is Gallery3 Compatible with PHP7? Yes!
Gallery3 (http://galleryproject.org/) is a free easy-to-manage photo gallery web application. It managed the photos like the way you put them in a HDD, but allows you to make a linkage to the file with website assess. I've used it for many years as the photo storage places for blog. However, I faced some problems after the OS was upgraded from Ubuntu 16.04 Server to Ubuntu 18.04 Server, while the PHP was upgraded from PHP5 to PHP7 in Ubuntu 18.04. The gallery3 version I've installed was version 3.0.9.
After the OS was upgraded, Gallery3 service showed an error message of HTTP Error 500. I've tried to debug the reason with xdebug, but it didn't show any helpful messages. I tried to find out some information from Google, but it is said that someone said Gallery 3 is not compatible to PHP7. It was sad of the compatibility bad news.
After the OS was upgraded, Gallery3 service showed an error message of HTTP Error 500. I've tried to debug the reason with xdebug, but it didn't show any helpful messages. I tried to find out some information from Google, but it is said that someone said Gallery 3 is not compatible to PHP7. It was sad of the compatibility bad news.
Anycubic Mega-S Cura Settings 列印機設定
In order to slice the stl model correctly and use full functions in Cura for my new Anycubic i3 Mega S, I need to modify the settings from the original default settings of "Anycubic i3 Mega" in the "Add Printer" menu. Most of the default settings are incorrect for my new Mega-S, need to be corrected.
Cura 新增列印機的選單中,有個現成的設定,但是裡面的設定不對,需要改動。選用多模型各別完成列印 (One at a Time) 的功能(在列印順序,Print Sequence 選項),設定錯誤,會造成模型撞機,擺放會造成撞機的狀況,Cura 會自動警告,而且不會執行切片工作。
Cura 新增列印機的選單中,有個現成的設定,但是裡面的設定不對,需要改動。選用多模型各別完成列印 (One at a Time) 的功能(在列印順序,Print Sequence 選項),設定錯誤,會造成模型撞機,擺放會造成撞機的狀況,Cura 會自動警告,而且不會執行切片工作。
Print Sequence selection in Cura
訂閱:
文章 (Atom)





