This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## M5StickV SH200Q maixpy | |
## Referred to the following | |
## https://github.com/m5stack/M5StickC/blob/master/src/utility/SH200Q.cpp | |
## https://github.com/m5stack/M5-Schematic/blob/master/Core/SH200Q.pdf | |
## https://bbs.sipeed.com/t/topic/863 | |
from machine import I2C | |
i2c = I2C(I2C.I2C0, freq=100000, scl=28, sda=29) | |
devices = i2c.scan() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## M5StickV MPU6886 maixpy | |
## Referred to the following | |
## https://github.com/m5stack/M5StickC/blob/master/src/utility/MPU6886.cpp | |
##https://github.com/m5stack/M5-Schematic/blob/master/datasheet/MPU-6886-000193%2Bv1.1_GHIC.PDF.pdf | |
from machine import I2C | |
MPU6886_ADDRESS=0x68 | |
MPU6886_WHOAMI=0x75 | |
MPU6886_ACCEL_INTEL_CTRL= 0x69 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## M5StickV MaixPy | |
## Referred to the following | |
## http://docs.openmv.io/library/omv.image.html#functions | |
import sensor,image,lcd,gc,time,uos | |
from fpioa_manager import * | |
from Maix import GPIO | |
fm.register(board_info.BUTTON_A, fm.fpioa.GPIO1) | |
but_a=GPIO(GPIO.GPIO1, GPIO.IN, GPIO.PULL_UP) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time,cmath,math | |
from machine import Timer,PWM | |
from fpioa_manager import * | |
tim = Timer(Timer.TIMER0, Timer.CHANNEL0, mode=Timer.MODE_PWM) | |
ch = PWM(tim, freq=500000, duty=0, pin=board_info.LED_R) | |
cnt=0 | |
while(True): | |
duty=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "Usage: ./convert.sh modelxxx.tflite" | |
name=`echo $1 | cut -d '.' -f 1` | |
tflite_out=$name.tflite | |
kmodel_out=$name.kmodel | |
#nncase | |
# https://github.com/kendryte/nncase | |
# wget https://github.com/kendryte/nncase/releases/download/v0.2.0-alpha1/ncc-linux-x86_64.tar.xz | |
ncc_exe=~/nncase/ncc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sensor, image, lcd, time | |
from fpioa_manager import * | |
from Maix import I2S, GPIO | |
lcd.init() | |
lcd.rotation(2) | |
sensor.reset() | |
sensor.set_pixformat(sensor.RGB565) | |
sensor.set_framesize(sensor.QVGA) | |
sensor.run(1) | |
origin = (0,0,0, 0,1,0, 0,0,0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from keras.models import Sequential | |
from keras.layers import Activation, Dense, Dropout,Conv2D,MaxPooling2D,Flatten | |
from keras.utils.np_utils import to_categorical | |
from keras.optimizers import Adagrad | |
from keras.optimizers import Adam | |
import numpy as np | |
from PIL import Image | |
import os | |
from sklearn.model_selection import train_test_split |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from machine import I2C | |
i2c = I2C(I2C.I2C0, freq=100000, scl=28, sda=29) | |
devices = i2c.scan() | |
print(devices) | |
import sensor, image, time,lcd,machine | |
from machine import I2C | |
MPU6886_ADDRESS=0x68 | |
MPU6886_WHOAMI=0x75 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from machine import I2C | |
i2c = I2C(I2C.I2C0, freq=100000, scl=28, sda=29) | |
devices = i2c.scan() | |
print(devices) | |
import lcd #for test | |
AXP192_ADDR=0x34 | |
Backlight_ADDR=0x91 | |
level=50 | |
val = (level+7) << 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from keras.models import Sequential | |
from keras.layers import Activation, Dense, Dropout,Conv2D,MaxPooling2D,Flatten,ZeroPadding2D | |
from keras.utils.np_utils import to_categorical | |
from keras.optimizers import Adagrad | |
from keras.optimizers import Adam | |
import numpy as np | |
from PIL import Image | |
import os | |
from sklearn.model_selection import train_test_split | |
import tensorflow as tf |
OlderNewer