[Diao Ye learns programming] MicroPython hands-on (02) - try to build the IDE environment of the K210 development board 6

#Try to build a Micropython development environment for K210 (Win10)
#Experimental program six: Test the Microphone array algorithm

#尝试搭建K210的Micropython开发环境(Win10)
#实验程序之六:测试Microphone阵列算法

from Maix import MIC_ARRAY as mic
import lcd

lcd.init()
mic.init()

while True:
    imga = mic.get_map()
    b = mic.get_dir(imga)
    a = mic.set_led(b,(0,0,255))
    imgb = imga.resize(160,160)
    imgc = imgb.to_rainbow(1)
    a = lcd.display(imgc)
mic.deinit()

insert image description here

insert image description here

#Try to build a Micropython development environment for K210 (Win10)
#Experimental program seven: graphics and hello maixpy

#尝试搭建K210的Micropython开发环境(Win10)
#实验程序之七:图形与hello maixpy

import lcd, time
import image

bg = (236,36,36)
lcd.init(freq=15000000)
lcd.direction(lcd.YX_RLDU)

img = image.Image()
img.draw_string(60, 100, "hello maixpy", scale=2)
img.draw_rectangle((120,120,30,30))
img.draw_circle((150,140, 80))
img.draw_cross((250,40))
img.draw_arrow((250,200,20,200), color=(236,36,36))
lcd.display(img)

insert image description here
insert image description here

#Try to build a Micropython development environment for K210 (Win10)
#Experimental program eight: Bumper ball demonstration

#尝试搭建K210的Micropython开发环境(Win10)
#实验程序之八:碰碰球演示

import image, lcd

lcd.init(freq=20000000)

i = 0
dir = 1

while(True):
    img = image.Image(copy_to_fb=1)
    img.clear()
    img.draw_rectangle(i,50,50,50)
    lcd.display(img)
   
    if dir:
        i += 5
        if i==270:
           dir = 0
    else:
        i -= 5
        if i==0:
            dir = 1

insert image description here

Searching on the Internet, I found a "K210 Forum", the link is: http://loboris.eu/forum/

insert image description here
insert image description here

Supongo que te gusta

Origin blog.csdn.net/weixin_41659040/article/details/131974515
Recomendado
Clasificación