Cov txheej txheem:

UI rau MicroPython: 9 Kauj Ruam
UI rau MicroPython: 9 Kauj Ruam

Video: UI rau MicroPython: 9 Kauj Ruam

Video: UI rau MicroPython: 9 Kauj Ruam
Video: Raspberry Pi Pico для робототехники 2024, Hlis ntuj nqeg
Anonim
UI rau MicroPython
UI rau MicroPython

Tsis ntev los no, Kuv tau txais ib qho esp8266 board thiab teeb tsa MicroPython rau nws. Nws tuaj yeem tswj tau los ntawm kev hais kom ntaus lossis xa tus nab npawb nab npawb rau nws.

Txhawm rau txhim kho MicroPython ntawm esp8266, thov txheeb xyuas https://MicroPython.org/download/#esp8266 lossis

Nab hab sej code:

lub sij hawm ntshuam

los ntawm tshuab ntshuam Pin

coj = Pin (2, Pin. OUT) // Pin 2 yog nyob ntawm board LED.

coj.off ()

coj.on ()

Qhov sib txawv version MicroPython, cov cai tej zaum txawv.

Nws txias heev rau kev sau cov lus txib kom tswj hwm esp8266, tab sis nws tseem tsis tau siv tus phooj ywg. Raws li lub vev xaib programmer, Kuv nyiam tsim kev sib txuas nrog html thiab JavaScript.

Kuv pom Android App OGT UI. Nws yog qhov sib xyaw APP; koj tuaj yeem tsim cov duab nraaj nrog Html thiab JavaScript. Nws simulates lub davhlau ya nyob twg, tau txais tag nrho cov ntawv xov xwm los ntawm MicroPython thiab lim nws, tsuas yog xa cov ntaub ntawv muaj txiaj ntsig rov qab rau JavaScript. Nrog JavaScript, koj tuaj yeem ua tiav qhov txiaj ntsig tau yooj yim.

Lub OGT UI los nrog tus demo UI. Txhawm rau ntsuas nws, koj xav tau rub tus lej nab npawb nab npawb thiab muab tso rau MicroPython.

Kauj ruam 1: Nruab OTG UI

Nruab OTG UI
Nruab OTG UI
Nruab OTG UI
Nruab OTG UI

Mus rau google ua si thiab tshawb nrhiav "otg ui". Nruab nws. Nws yuav xav tau qee qhov kev tso cai.

Kauj ruam 2: Rub tawm Main.zip

Rub tawm Main.zip
Rub tawm Main.zip

Mus rau https://www.otgui.com/home?mc=download thiab rub tawm main.py.

Kauj ruam 3: Upload Main.py rau Koj MicroPython

Tshaj tawm Main.py rau koj MicroPython
Tshaj tawm Main.py rau koj MicroPython

Tshaj tawm main.py rau koj MicroPython los ntawm kev hais kom ua:

ampy --port com5 muab main.py

Koj tuaj yeem sim nws los ntawm putty thiab paub tseeb tias txoj cai ua haujlwm.

Kauj Ruam 4: Txuas Esp8266 rau Koj Lub Xov Tooj Hauv Los Ntawm OTG Adapter

Txuas Esp8266 rau Koj Lub Xov Tooj Android Los ntawm OTG Adapter
Txuas Esp8266 rau Koj Lub Xov Tooj Android Los ntawm OTG Adapter
Txuas Esp8266 rau Koj Lub Xov Tooj Android Los ntawm OTG Adapter
Txuas Esp8266 rau Koj Lub Xov Tooj Android Los ntawm OTG Adapter

Thawj thawj zaug, Nws yuav qhia qhov sib tham, khij lub npov thiab nyem OK khawm. Tom qab ntawd qhov demo UI yuav tshwm. Koj tuaj yeem nyem khawm hloov kom tswj coj On/Off.

Kauj ruam 5: Tsim Koj Tus UI

Txhawm rau tsim koj li UI, koj xav tau sau npe tus account thiab rub tawm cov cuab yeej ntsuas.

Kauj ruam 6: Sau npe tus as khauj

Sau npe tus account
Sau npe tus account
Sau npe tus account
Sau npe tus account

Mus rau www.otgui.com thiab nyem "Kuv UIs". nws yuav pom nplooj ntawv nkag mus, nyem "Sau npe". Sau tag nrho cov ntaub ntawv thiab nyem

nyem "Sau npe".

Tam sim no koj tuaj yeem nkag mus nrog koj tus lej nyiaj thiab tus lej zais tsis raug yog "123456", koj tuaj yeem hloov nws tom qab.

Kauj Ruam 7: Tsim UI tshiab

Tsim UI tshiab
Tsim UI tshiab

Tom qab nkag mus, nyem "Text UIs". nws yuav qhia tag nrho koj li UIs.

  • Nyem Ntxiv khawm.
  • Sau tag nrho cov ntaub ntawv.
  • Nyem Txuag khawm
  • Nws yuav tsim UI tshiab nrog qee qhov chaws hauv nws.
  • Kho qhov chaws.

Kauj ruam 8: Kuaj UI

Kuaj UI
Kuaj UI

Nyem saib ua ntej kom pom qhov tshwm sim.

Kauj ruam 9: Upload UI rau Koj Hauv

Upload UI rau Koj Hauv
Upload UI rau Koj Hauv
Upload UI rau Koj Hauv
Upload UI rau Koj Hauv

Nrhiav App Code hauv koj nplooj ntawv qhia meej UI. Tom qab ntawd qhib qhov browser ntawm koj lub hauv xov tooj thiab ntaus "https:// localhost: 8889".

Nkag mus rau App Code thiab nyem tseg khawm. Rov pib dua OTG UI App.

Nws yuav rub tawm UI rau koj hauv.

Pom zoo: