9
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

MaixAmigo を試す

Last updated at Posted at 2020-10-12

はじめに

Sipeedの新製品MaixAmigoを入手してみました

MaixAmigo1.jpg

仕様

CPUはK210で、基本的な仕様はMaixシリーズ、M5StickVと同じです。

Sipeedの仕様で目に付く点では、

仕様 説明
ストレージ micro-SD 最大128G
ディスプレイ タッチスクリーン付き 3.5インチTFT液晶320*480
カメラ フロント GC0328 30万画素
リア OV7740 30万画素
外部I/F Grove3、SP-MOD3、USBタイプC*2

回路図: https://dl.sipeed.com/MAIX/HDK/Sipeed-Amigo/Maix_Amigo_2960(Schematic).pdf

使ってみる

起動画面

MaixAmigo2.jpg

初期ファームウェア

v0.5.0-168

MaixAmigo3.png

MaixPy

カメラ画像を表示してみるサンプル。リアとフロントのカメラを交互に表示します。
Sipeed社MaixPyのドキュメントより
https://maixpy.sipeed.com/dev/zh/develop_kit_board/maix_amigo.html

# -*- coding: UTF-8 -*-
# Amigo_sensor - By: Echo - 周五 4月 2 2020
# start of pmu_axp173.py
import sensor, image, time, utime, lcd
from machine import I2C, Timer
from fpioa_manager import fm
from Maix import GPIO

'''
说明: 该例程为 Amigo 前后摄像头切换的 example.
注意事项: 由于 Amigo 电源管理电路的设计 需要配置 PMU AXP173 的输出电压, 才可以正常使用摄像头
'''

# -------------
class AXP173:
    class PMUError(Exception):
        pass
    class OutOfRange(PMUError):
        pass
    def __init__(self, i2c_dev=None, i2c_addr=0x34):
        from machine import I2C
        if i2c_dev is None:
            try:
                self.i2cDev = I2C(I2C.I2C0, freq=400000, scl=24, sda=27)
            except Exception:
                raise PMUError("Unable to init I2C0 as Master")
        else:
            self.i2cDev = i2c_dev
        self.i2cDev.scan()
        self.axp173Addr = i2c_addr
    def __write_reg(self, reg_address, value):
        self.i2cDev.writeto_mem(
            self.axp173Addr, reg_address, value, mem_size=8)
    def writeREG(self, regaddr, value):
        self.__write_reg(regaddr, value)

# end of pmu_axp173.py
# ------------------------

# i2cDev = I2C(I2C.I2C0, freq=400000, scl=24, sda=27)
# print(i2cDev.scan())
axp173 = AXP173()
axp173.writeREG(0x27, 0x20)
axp173.writeREG(0x28, 0x0C)

lcd.init(freq=20000000)

while True:
    try:
        sensor.reset(choice=1)
        sensor.set_pixformat(sensor.YUV422)
        sensor.set_framesize(sensor.QVGA)
        sensor.skip_frames(time=2000)
        for i in range(50):
            img = sensor.snapshot()
            lcd.display(img)
    except Exception as e:
        print(e)

    try:
        sensor.reset(choice=2)
        sensor.set_pixformat(sensor.YUV422)
        sensor.set_framesize(sensor.QVGA)
        sensor.skip_frames(time=2000)
        for i in range(50):
            img = sensor.snapshot()
            lcd.display(img)

    except Exception as e:
        print(e)
        
9
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?