Skip to content

Instantly share code, notes, and snippets.

@anoken
anoken / imu_acc_read
Last active November 30, 2021 02:04
wio_terminal_test_code
#include"LIS3DHTR.h"
LIS3DHTR<TwoWire> lis(I2C_MODE);
void setup() {
Serial.begin(115200);
lis.begin(Wire1, LIS3DHTR_DEFAULT_ADDRESS); //I2C Address
if (!lis) {
Serial.println("ERROR");
while (1);
@anoken
anoken / Test Code
Last active November 30, 2021 02:04
UI Flow http post dump
Test Code
------
import wifiCfg
import urequests
import gc
import micropython
micropython.mem_info()
print('Initial free: {} allocated: {}'.format(gc.mem_free(), gc.mem_alloc()))
wifiCfg.autoConnect()
@anoken
anoken / Speech_Recognize.py
Created April 28, 2020 23:30
Speech_Recognize_maixpy.py
# https://github.com/sipeed/MaixPy_scripts/blob/master/multimedia/speech_recognizer/speech_recognizer.py
from Maix import I2S, GPIO
from fpioa_manager import fm
from modules import SpeechRecognizer
import utime, time
# register i2s(i2s0) pin
fm.register(20, fm.fpioa.I2S0_IN_D0, force=True)
fm.register(18, fm.fpioa.I2S0_SCLK, force=True)
from Maix import GPIO, I2S, FFT
import image, lcd, math,array
from board import board_info
from fpioa_manager import fm
import audio
sample_rate = 44100
SAMPLES_PER_SECOND = 1024
BITS_PER_SAMPLE=16
@anoken
anoken / conda list
Last active January 19, 2020 05:32
YOLO_Test
# Name Version Build Channel
_libgcc_mutex 0.1 main
_tflow_select 2.3.0 mkl
absl-py 0.8.0 py36_0
astor 0.8.0 py36_0
blas 1.0 mkl
c-ares 1.15.0 h7b6447c_1001
ca-certificates 2019.8.28 0
cairo 1.14.12 h8948797_3
certifi 2019.9.11 py36_0
@anoken
anoken / m5stickc_arduino.ino
Last active February 11, 2022 13:51
M5StickCViewer_for_UnitV
// Copyright (c) 2019 aNoken
#include <M5StickC.h>
HardwareSerial serial_ext(2);
typedef struct {
uint32_t length;
uint8_t *buf;
} jpeg_data_t;
jpeg_data_t jpeg_data;
@anoken
anoken / 200128.py
Last active January 27, 2020 22:49
YOLO_keras_train
#! /usr/bin/env python
#from __future__ import print_function
#
#https://mlblr.com/includes/mlai/index.html#yolov2
#https://github.com/snakers4/yolov2-fish
from keras.models import Sequential, Model
from keras.layers import Reshape, Activation, Conv2D, Input, MaxPooling2D, BatchNormalization, Flatten, Dense, Lambda
from keras.layers.advanced_activations import LeakyReLU
from keras.callbacks import EarlyStopping, ModelCheckpoint, TensorBoard
@anoken
anoken / ESP32_SPI_receieve.ino
Last active January 13, 2020 03:00
MaixPy_SPI_test
#include "driver/spi_master.h"
#include "driver/spi_slave.h"
#include <Arduino.h>
#include <SPI.h>
// 通信サイズ
static const uint32_t TRANS_SIZE = 128;
// 通信バッファ
uint8_t* spi_slave_tx_buf;
@anoken
anoken / ESP32_Arduino_recieve
Last active January 12, 2020 08:27
Maixduino_K210toESP32_UART
#include <Arduino.h>
#include <Wire.h>
#include <SPI.h>
HardwareSerial serial_ext(2);
void setup() {
Serial.begin(115200);
serial_ext.begin(115200, SERIAL_8N1, 1, 3);
}
@anoken
anoken / MaixPy_KPU_MobileNet_V1_compare.py
Last active January 8, 2020 09:41
MaixPy_KPU_MobileNet_V1_a=0.75 vs a=0.5
## Copyright (c) 2019 aNoken
import image, lcd, sensor,gc
import KPU as kpu
lcd.init()
lcd.rotation(2)
sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.QVGA)