尝试搭建K210的Micropython开发环境(Win10)-Arduino中文社区 - Powered by Discuz!

Arduino中文社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

楼主: eagler8

尝试搭建K210的Micropython开发环境(Win10)

[复制链接]
 楼主| 发表于 2020-3-28 08:33 | 显示全部楼层
07.jpg
 楼主| 发表于 2020-3-28 08:54 | 显示全部楼层
#尝试搭建K210的Micropython开发环境(Win10)
#实验程序之三:更新频率演示

[mw_shl_code=python,true]#尝试搭建K210的Micropython开发环境(Win10)
#实验程序之三:更新频率演示

from Maix import freq

cpu_freq, kpu_freq = freq.get()
print(cpu_freq, kpu_freq)

freq.set(cpu = 400, pll1=400, kpu_div = 1)[/mw_shl_code]

 楼主| 发表于 2020-3-28 08:55 | 显示全部楼层
08.jpg
 楼主| 发表于 2020-3-28 09:02 | 显示全部楼层
#尝试搭建K210的Micropython开发环境(Win10)
#实验程序之四:LCD屏显示"hello maixpy"

[mw_shl_code=python,true]#尝试搭建K210的Micropython开发环境(Win10)
#实验程序之四:LCD屏显示"hello maixpy"

import lcd, time
import image

bg = (236,36,36)
lcd.init(freq=15000000)
lcd.direction(lcd.YX_RLDU)
lcd.clear(lcd.RED)
time.sleep(1)
lcd.draw_string(120, 120, "hello maixpy", lcd.WHITE, lcd.RED)
time.sleep(2)


img = image.Image()
img.draw_string(60, 100, "hello maixpy", scale=2)
img.draw_rectangle((120,120,30,30))
lcd.display(img)[/mw_shl_code]

 楼主| 发表于 2020-3-28 09:10 | 显示全部楼层
12.gif
 楼主| 发表于 2020-3-28 09:11 | 显示全部楼层
11.jpg
 楼主| 发表于 2020-3-28 09:24 | 显示全部楼层
#尝试搭建K210的Micropython开发环境(Win10)
#实验程序之五:LCD液晶显示器彩条测试

[mw_shl_code=python,true]#尝试搭建K210的Micropython开发环境(Win10)
#实验程序之五:LCD液晶显示器彩条测试

import lcd,image, time


lcd.init(type=1, freq=15000000)
# lcd.init(type=2, freq=20000000)
# lcd.init(type=1, width=320, height=240, invert=True, freq=20000000)

img = image.Image(size=(240,240))

img.draw_rectangle(0,0,30, 240, fill=True, color=(0xff, 0xff, 0xff))
img.draw_rectangle(30,0,30, 240, fill=True, color=(250, 232, 25))
img.draw_rectangle(60,0,30, 240, fill=True, color=(106, 198, 218))
img.draw_rectangle(90,0,30, 240, fill=True, color=(98, 177, 31))
img.draw_rectangle(120,0,30, 240, fill=True, color=(180, 82, 155))
img.draw_rectangle(150,0,30, 240, fill=True, color=(231, 47, 29))
img.draw_rectangle(180,0,30, 240, fill=True, color=(32, 77, 158))
img.draw_rectangle(210,0,30, 240, fill=True, color=(27, 28, 32))

lcd.display(img)

count = 500
while count > 0:
    t = time.ticks_ms()
    lcd.display(img)
    print(time.ticks_ms() - t)
    count -= 1[/mw_shl_code]


 楼主| 发表于 2020-3-28 09:26 | 显示全部楼层
13.jpg
 楼主| 发表于 2020-3-28 09:30 | 显示全部楼层
14.jpg
 楼主| 发表于 2020-3-28 09:55 | 显示全部楼层
#尝试搭建K210的Micropython开发环境(Win10)
#实验程序之六:测试Microphone阵列算法
[mw_shl_code=python,true]#尝试搭建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()[/mw_shl_code]


您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|Archiver|手机版|Arduino中文社区

GMT+8, 2024-12-27 10:26 , Processed in 0.081064 second(s), 15 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表