Example: air traffic controller

Nanobit - inex.co.th

Nanobit microPython CPU nRF51822 32-bit ARM Cortex M0 : 16 MHz RAM 16 KB 256 KB BL E : Bluetooth Low ( ) ( ) 2 LED P15 / I2C OLED V Nanobit C PU STM32F103 CBT6 Nanobit microUSB 5V P5P11 Nanobit Arduino Nano Arduino Nano ( ) Nanobit 1. USB micro:USB Power:Bank 2.

from microbit import * display.scroll("Hello, World!") โปรแกรมแรก frommicrobit import * เรียกใช้งานทุกฟังก์ชั่นในโมดูล microbit. display. scroll ("Hello, inex") แสดงข้อความแบบเลื่อน (scroll) display. scroll ("Hello, inex",50)

Tags:

  Microbit

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Advertisement

Transcription of Nanobit - inex.co.th

1 Nanobit microPython CPU nRF51822 32-bit ARM Cortex M0 : 16 MHz RAM 16 KB 256 KB BL E : Bluetooth Low ( ) ( ) 2 LED P15 / I2C OLED V Nanobit C PU STM32F103 CBT6 Nanobit microUSB 5V P5P11 Nanobit Arduino Nano Arduino Nano ( ) Nanobit 1. USB micro:USB Power:Bank 2.

2 (Li -ion,Li-po,Pi-Fe) 2 3. Vin 3 Nanobit Nanobit 30 Nanobit +5 V + / R ESET JST 3 / inex IDC 4 ( P2) I2C JST 4 LED 5x5 OLED I2C : 57x89 AX- Nanobit AX- Nanobit Nanobit Nanobit LED OLED AX- Nanobit Nanobit Nanobit Let's Code Go to Make Code editor MakeCode editor Home MakeCode New Project Project Code Option MakeCodePROJECT01 LED P15 Blinkon PIN15 Simulator Simulator Nanobit USBcopy Nanobit Pair device Nanobit webUSB (Browser Chrome/Edge )

3 Nanobit Google Chrome Microsoft Edge Windows 10 online online windows 10 Edge Chrome Nanobit WebUSB REPL Download Flash (Connect) Nanobit Python Editor WebUSB Nanobit 03/12/64 23:40:38 .WebUSB Browser USB Google Browser Google Chrome Microsoft Edge Windows 10 WebUSB Tab Browser ICON USB (Microsoft Edge ) Load/Save Load.

4 Py .hex Save 2 .py .hex NanobitProject Files Add file .py Nanobit , module( ) ( ) Nanobit Open Serial WebUSB Command Line(REPL) Python >>> REPL Nanobit MakeCode Flash Open Serial REPL Ctrl+C Send CTRL+C for REPL Send CTRL+D to reset Soft reboot Nanobit CTRL+D REPL ?

5 REPL Read-Eval-Print Loop Interactive Read = Eval = Evaluate Print = Loop = 03/12/64 23:40:38 . Compiler interpreter1. AX- Nanobit Browser 3. Connect Connect Connect Disconnect 344. Open Serial REPL5. Ctrl+C Nanobit REPL6. >>> >>> 2 + 24>>> 50 - 5*620>>> (50 - 5*6) / >>> 8 / 5 >>> 17 / >>> 5 ** 225 Float int 03/12/64 23:40:38 . microPython type (var) >>> x = 400>>> y = >>> Z = True>>> S = 'inex'x Integer : inty Float : floatZ Boolean : boolS String : str>>> i = [1, 2, 3, 4, inex , 5 , KRIT ]Python Array List >>> print (i[4])inex>>> print (i[2:6])[3,4,'inex',5]03/12/64 23:40:38.

6 >>> x = 100>>> y = 20>>> x+y120 = >>> x = >>> y = 5>>> x* 23:40:38 . Nanobit >>> ('hello')>>> running_time()>>> ()>>> sleep(1000) TAB (auto-complete) 9 help() 03/12/64 23:40:38 . help( ) dir( ) help() CTRL+C CTRL+D NanobitCTRL+E Copy Paste Tab 23:40:38 .03/12/64 23:40:38 .Python Editor Offline 23:40:38.

7 Micro Python Offline Com Port Com Port Driver xe Nanobit 03/12/64 23:40:38 . MCU BBC Nanobit03/12/64 23:40:38 .Mu Editor REPL LED 5x503/12/64 23:40:38 . REPL REPL Nanobit FlashMu Mu Nanobit Nanobit TM1637 Flash C:\Users\< >\mu_code Files 03/12/64 23:40:38 . TM1637 frommicrobit import*importtm1637tm = (clk=pin13,dio=pin14)whileTrue:temp=temp erature() ('{:4d}'.)

8 Format(temp))sleep(500) C:\Users\< >\mu_code03/12/64 23:40:38 . Files Nanobit flash Reset frommicrobit import* ("Hello, World!") frommicrobit import* ("Hello, inex") (scroll) ("Hello, inex",50) 03/12/64 23:40:38 . displayclear()get_pixel(x,y)is_on()off() on() display . display scroll(Msg)set_pixel(x,y,B)show(Msg) LED pixel LED LED LED ' Msg ' Pixel (B) 0-9 ' Msg ' frommicrobit import* (1,2,9)03/12/64 23:40:38 .read_light_level() LED 5x5 0-255 (x,delay=400,wait=True,loop=False,clear= False) x ( ) Image( ) delay ( 400 )wait ( True)loop ( False)clear ( False)03/12/64 23:40:38.

9 Pixel 23:40:38 .['HEART','HEART_SMALL','HAPPY','SMILE', 'SAD','CONFUSED','ANGRY','ASLEEP','SURPR ISED','SILLY','FABULOUS','MEH','YES','NO ','CLOCK12','CLOCK1','CLOCK2','CLOCK3',' CLOCK4','CLOCK5','CLOCK6','CLOCK7','CLOC K8','CLOCK9','CLOCK10','CLOCK11','ARROW_ N','ARROW_NE','ARROW_E','ARROW_SE','ARRO W_S','ARROW_SW','ARROW_W','ARROW_NW','TR IANGLE','TRIANGLE_LEFT','CHESSBOARD','DI AMOND','DIAMOND_SMALL','SQUARE','SQUARE_ SMALL','RABBIT','COW','MUSIC_CROTCHET',' MUSIC_QUAVER','MUSIC_QUAVERS','PITCHFORK ','XMAS','PACMAN','TARGET','ALL_CLOCKS', 'ALL_ARROWS','TSHIRT','ROLLERSKATE','DUC K','HOUSE','TORTOISE','BUTTERFLY','STICK FIGURE','GHOST','SWORD','GIRAFFE','SKULL ','UMBRELLA','SNAKE'] Pixel Image03/12/64 23:40:38 .frommicrobit import* ( ) 1 HAPPY LED Image LED 5x5frommicrobit import*human =Image(" 00900 :" 777778.)

10 7. ' (human) LED 0 9 0 9 203/12/64 23:40:38 . sleep sleep(time) time ( 1000 1 ) sleep(1500)# 03/12/64 23:40:38 .frommicrobitimport* ( )sleep(200) ( )sleep(200) 3 03/12/64 23:40:38 .whileCondition: ..frommicrobitimport*x=0whilex<5 (x,0,9)sleep(100)x=x+1 while breakwhile 03/12/64 23:40:38 .ifCondition: .. import* ( )while () () ()sleep(300) if else03/12/64 23:40:38 .ifCondition: .. frommicrobit import*x=0whilex<4:ifx==0 ( )elifx==1 ( )elifx==2 ( ) ( )sleep(1000)x=x+103/12/64 23:40:38.


Related search queries