I-Espurino: IJavaScript yama-microcontroller

I-Atmel microcontroller, i-Espurino

Cishe wake wezwa I-Spurine, njengoba lo msebenzi ubhapathizwe ngegama lesazi sezombangazwe nesempi yaseRiphabhulikhi YaseRoma. Noma mhlawumbe uze kule ndatshana ufuna imininingwane eminingi ngoba usuvele uyayazi futhi ufuna ukuqala ukuyisebenzisa.

Kunoma ikuphi, ngizozama ukukunika okhiye ngokuthi yini i-Espurino nokuthi ingakwenzelani amaphrojekthi akho esikhathi esizayo, kanye nezinye izincomo zokufunda ukuthi ungayihlela kanjani ngendlela elula.

Esikhathini esedlule besikutshela mayelana no-Anaconda, enye iphrojekthi ethokozisayo yabathandi bePython ababefuna uhlelo amabhodi we-arduino ngalolu limi lohlelo oludume kakhulu. Okuthile okufana nokwenzayo IMicrosoftPython, kepha manje, nge-Espurino, ikulethela elinye ithuba elisha usebenzisa ulimi oluhlukile ...

Yini i-Espurino?

I-Spurine

I-Spurine yiphrojekthi yomthombo ovulekile yokwakha ukutolika kolimi lohlelo lweJavaScript labalawuli bama-microcontroller. Ngamanye amagama, le IDE ephelele yenzelwe ukuthi ikwazi ukuhlela amadivayisi nge-microcontroller ehlelwe enezinkumbulo ezincane ze-RAM, njengalezo ezine-8kB kuphela futhi ezisetshenziswa kakhulu kumadivayisi amaningi ashumekiwe.

Iphrojekthi ye-Espurino yadalwa ngu UGordon Williams ngo-2012, njengomzamo wokuvumela ukuthuthukiswa kwama-microcontroller kuzingxenyekazi eziningi. Ekuqaleni bekungewona umthombo ovulekile, umane unikeze ukulanda kwe-firmware kwamahhala kwama-STM32 MCUs.

Ngo-2013 iphrojekthi ibizothatha isinyathelo esibaluleke kakhulu, iba umthombo ovulekile ngemuva komkhankaso wezezimali ophumelele kakhulu endaweni yesikhulumi sokubuyisa imali ye-Kickstarter. Lo mkhankaso wedlula imvelo yokuqala yentuthuko, wafuna izimali zokwakha amabhodi angaxhasa le software.

I-firmware yakwa-Espurino manje isinelayisense ngaphansi kweMozilla Public License 2.0, kanti amakhodi esampula angaphansi kweLayisense ye-MIT, imibhalo ngaphansi kwe-Creative Commons Attribution-ShareAlike 3.0, namafayili wedizayini yehadiwe ngaphansi kwalokhu.

Nakhu ukuthi Ibheji elisemthethweni lase-Espurino, Ezolandelwa ukukhishwa okuningi kwezinye izinhlobo njengoba kwenzekile nakwamanye amaphrojekthi afana ne-Arduino. Ngaphezu kwalokho, lawa mabhodi abuye afaka ukuhambisana kwezihlangu ezihambisana ne-Arduino, ezibanikeza amakhono athokozisa kakhulu abenzi nama-DIYers.

Njengamanje iphrojekthi inokuduma okuthile, ngokubalulekile umphakathi wentuthuko kanye nenqwaba yezifundo nosizo ongazithola ku-Intanethi. Ngakho-ke, uma uthanda i-JS nokuhlela ama-microcontroller, awukaze ube lula kangako ...

Ikhodi yomthombo wephrojekthi - GitHub

Iwebhusayithi Esemthethweni - I-Spurine

I-firmware - Landa (ukuthola amapuleti ahlukile)

IJavaScript? Microcontroller?

Uma ngabe uqale kulo mhlaba, ungahle uzibuze ayini lawo magama noma yini abangayifaka kumaphrojekthi akho. Uma usifunda kaningi uzokwazi ukuthi yini i-microcontroller, futhi impela uyazi neJavaScript noma iJS.

Un isilawuli esincaneEbizwa nangokuthi i-MCU (Micro Controller Unit), iyi-chip ehlelwe kahle ekwazi ukwenza ama-oda athile avela kwimemori. Lokhu kungafana nencazelo ye-CPU futhi, kepha esimweni se-MCU, imvamisa ayithuthuki kangako futhi inamandla, ikhomba imisebenzi ethile ethile, njengamadivayisi ashumekiwe.

Ngaphezu kwe umehluko kusuka ku-CPU, i-microcontroller iyisifunda esihlanganisiwe esifaka phakathi i-CPU uqobo, kanye namanye amabhulokhi asebenzayo njengememori nohlelo lwe-I / O. Ngisho, empeleni kuyikhompyutha ephelele kwi-chip eyodwa ...

Ngakho-ke, uzoba nedivayisi eshibhile nelula leyo ungahlela ukuze okufakwayo nemiphumela yayo isebenze njengoba ufuna futhi ngaleyo ndlela ikhiqize izenzo. Ungayenza ithole imininingwane evela kuzinzwa zangaphandle noma kuma-actuator, futhi ngokususelwa kulokho okuthumela amasiginali athile ngemiphumela yayo kwabanye Izingxenye ze-elekthronikhi kuxhunyiwe.

Kepha i-JavaScript, wulimi oluhunyushiwe. Lokho ukusho, ngokungafani naleyo ehlanganisiwe yokuthi ngemuva kokuhlanganiswa kukhiqize kanambambili okungenziwa yi-CPU, esimweni semibhalo ehunyushiwe, kuzodingeka isoftware engumlamuli ebizwa ngokuthi utolika ezohumusha imiyalo yekhodi ukuthi "itshele" lokho i-CPU okufanele ikwenze.

JS Kubaluleke kakhulu namuhla ngenxa yezinhlelo zokusebenza eziningi enazo, ikakhulukazi kuzinhlelo zokusebenza zewebhu. Eqinisweni, yaqala yakhiwa nguNetscape kaBrendan Eich (owabe enguMocha, wabe esethiwa kabusha i-LiveScript, ekugcineni iJavaScript).

Lokho kuduma kuholele kwinani elikhulu le- onentshisekelo nabasebenzisi ngeJavaScript, namaphrojekthi afana ne-Espurino angabasondeza bonke ekuhleleni ama-microcontroller ngayo.

Ngendlela, ngoba qalisa nge-Espurino IDE, ngeke kudingeke ufake noma yini kuhlelo lwakho lokusebenza, kuyimvelo esekwe kuwebhu ongayisebenzisa kusuka khona lapha kusiphequluli sakho sewebhu osithandayo.

Yize iziphequluli zewebhu ezahlukahlukene zingasetshenziswa, ukukhanyisa i-firmware yalawa mabhodi kunconywa ukuthi usebenzise i-Chrome kanye ne-plugin ebizwa nge-Espurino Web IDE enconyelwe kuwebhusayithi esemthethweni nokuthi ungayitholela i-Chrome yakho ku lesi sixhumanisi.

Ungayifunda kanjani iJavaScript?

Uma ungazi ukuthi ungahlela kanjani kuJavaScript, kufanele wazi ukuthi, njenganoma yiluphi olunye ulimi, kunezincwadi ze- ukufunda, izifundo, izifundo zevidiyo, kanye nenani elikhulu lezinsizakufunda mahhala. Kepha kukhona omunye umthombo mhlawumbe okukhulunywa ngawo kancane futhi othakazelisa ngokukhethekile ekwenzeni i-gamification inqubo yokufunda ye-JS.

Ngibhekise kubo amagama evidiyo lokho kukusiza ukuthi ufunde ukuhlela ngezilimi ezithile zokuhlela, kufaka phakathi iJS. Ngale midlalo, esikhundleni sokusebenzisa ikhibhodi noma igundane ukuqondisa umlingiswa noma ukusebenzisana nemvelo ebonakalayo, ozoba nakho ngumhumushi walolu limi kolunye uhlangothi lwesikrini nalapho uzoqala khona ukufaka ikhodi (kuqala nge elula kakhulu futhi esithuthuke kakhulu).

Ngale ndlela, uzolawula umdlalo usebenzisa ulimi lohlelo, ngakho-ke ngesikhathi semidlalo yakho uzohamba ukufunda cishe ngaphandle kokuqaphela futhi njengoba uthuthuka emishini ulwazi lwakho luzokhula.

Uma unentshisekelo kule ndlela yokufunda ukuqala nge-Espurino, nakhu ngikushiya ezinye izinsiza zokufunda IJavaScript isebenzisa imidlalo:

Amapuleti asemthethweni e-Espurino

Amapuleti we-Spurine

Ngemuva kokuthuthukiswa kokuqala kwe- ipuleti Okwangempela kuka-Espurino kweza namaphrojekthi amaningi atholakala ukusetshenziswa ne-IDE neJS. Uma ufuna ukwazi kabanzi ngabo, nansi isingeniso kulowo nalowo:

  • I-Espurino (yangempela): yipuleti yoqobo, eyokuqala ukwakhiwa ngaphansi kwale phrojekthi. Izici zabo yilezi:
    • STM32F103RCT6 32-bit 72Mhz ARM Cortex-M3 MCU
    • I-256Kb yememori ye-flash, i-28Kb ye-RAM
    • i-microUSB, isixhumi se-SD, ne-JST PHR-2 isixhumi sebhethri sangaphandle
    • Ama-LED abomvu, aluhlaza okwesibhakabhaka noluhlaza okotshani
    • Ama-pads avumela ukuxhumeka kwamamojula we-Bluetooth HC-05
    • I-44 GPIO ene-26 PWM, 16 ADC, 3 UARTS, 2 SPI, 2 I2C kanye ne-2 DACs.
    • Ubukhulu: 54x41mm
  • Inani eliphakeme le-Spurino: Ibhodi elincane eline-microcontroller ukuqala ukusebenzisa amaphrojekthi wakho weJavaScript nokulawula izinto ngendaba yemizuzwana. Ihlelwe ngokusebenzisa isikhombimsebenzisi sayo se-USB ukulayisha iskripthi osibhalayo nge-Espurino IDE. Ngaphezu kwalokho, inentengo yokonga futhi ungayithola ngezikhonkwane futhi ngaphandle kwezikhonkwane ezithengisiwe emakhanda ayo. Imininingwane engaphezulu:
      • I-22 GPIO (okokufaka okungu-9 kwe-analog, i-21 PWM, i-serial engu-2, i-3 SPI ne-3 I2C).
      • Isixhumi se-USB-A ebhodini.
      • Ama-LED ama-2 nenkinobho engu-1 ku-PCB.
      • STM32F401CDU6 32-bit 84Mhz ARM Cortex-M4 MCU
      • Imemori: 384 Kb ye-flash ne-96Kb ye-RAM
      • Ubukhulu be-33x15mm
  • I-Spurino WiFi: Kuyibhodi cishe lamawele kweledlule, kuphela ukuthi kungezwe okunye ukuthuthuka. Isibonelo, ubukhulu bayo bungu-30x23mm, bukhula buvulele isikhala se-ESP8266 WiFi chip. Ngaphezu kwalokho, i-USB ishintshiwe yaba yi-microUSB, inani lama-GPIOs lehliselwe ku-21 (8 analog, 20 PWM, 1 serial, 3 SPI and 3 I2C). Ngakolunye uhlangothi, i-microcontroller nayo ithuthukisiwe, manje sekuyi-STM32F411CEU6 32-bit 100Mhz ARM Cortex-M4 ene-512kb yememori ye-flash kanye ne-128 kb ye-RAM.
  • I-Espurino Puck.js: Ngokuyisisekelo kuyinkinobho ehlakaniphile ye-Bluetooth ongayihlelela ngenxa ye-microcontroller yayo yangaphakathi notolika (ofakwe kuqala) nge-JS. Ngaphezu kwalokho, ine-52832Mhz ARM Cortex-M4 nRF64 SoC ene-64kB ye-RAM ne-512Kb ye-flash, i-GPIO, ithegi ye-NFC, i-MAG3110 magnetometer, i-IR transmitter, i-thermometer eyakhelwe ngaphakathi, kanye nezinzwa zezinga lokukhanya nebhethri.
  • Spurino Pixl.js: Yidivayisi efana neyangaphambilini, kepha esikhundleni sebhathini iyisikrini se-Bluetooth LE esihleliwe. Isikrini sayo sinobukhulu obungu-128 × 64 i-monochrome, kanti ezinye izici zifana nePuck.js.
  • I-MDBT42Q: kuyimodyuli efanayo nePixl.js nePuck.js, kepha nge-antenna ye-ceramic. Zonke ezinye izici zobuchwepheshe zihambisana nezimbili ezedlule, kepha ngaphandle kwesikrini noma inkinobho kulokhu ...
  • I-Bangle.js: ngumkhiqizo omusha sha. Kuyabukeka, iwashi elihlakaniphile noma iwashi elihlakaniphile. Uzokwazi ukufaka izinhlelo zokusebenza futhi uthuthukise imisebenzi emisha usebenzisa iJavaScript noma ulimi lokuqhafaza (iBlockly). Uzodinga kuphela isiphequluli sewebhu ukuze ukwazi ukubhala amakhodi akho bese uwafaka kuwashi… Ngaphezu kwalokho, ayinamanzi, ine-Bluetooth, i-GPS, i-accelerometer, i-magnetometer (ukulinganisa amandla nokuqondisa kwamasignali kazibuthe), njll.

Uma udinga thenga ezinye yalezi zingcwecwe ze-Espurino ungazithola ku- isitolo sewebhusayithi esisemthethweni Kusuka kule phrojekthi. Ungayithola ngochungechunge lwe- abahambisa Izikhulu ezinikezwe iphrojekthi, njengokudla okuthile okudumile njenge-Adafruit, njll.


Okuqukethwe yi-athikili kunamathela ezimisweni zethu ze izimiso zokuhlelela. Ukubika iphutha chofoza lapha.

Yiba ngowokuqala ukuphawula

Shiya umbono wakho

Ikheli lakho le ngeke ishicilelwe.

*

*

  1. Ubhekele imininingwane: Miguel Ángel Gatón
  2. Inhloso yedatha: Lawula Ugaxekile, ukuphathwa kwamazwana.
  3. Ukusemthethweni: Imvume yakho
  4. Ukuxhumana kwemininingwane: Imininingwane ngeke idluliselwe kubantu besithathu ngaphandle kwesibopho esisemthethweni.
  5. Isitoreji sedatha: Idatabase ebanjwe yi-Occentus Networks (EU)
  6. Amalungelo: Nganoma yisiphi isikhathi ungakhawulela, uthole futhi ususe imininingwane yakho.

Isivivinyo sesiNgisiHlola isiCatalanimibuzo yeSpanishi