Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View boochow's full-sized avatar
🏠
Working from home

boochow

🏠
Working from home
View GitHub Profile
from fpioa_manager import *
from Maix import I2S, GPIO
import audio
# disable wifi
fm.register(8, fm.fpioa.GPIO0)
wifi_en=GPIO(GPIO.GPIO0,GPIO.OUT)
wifi_en.value(0)
# register i2s(i2s0) pin
from machine import I2C
i2c=I2C(1)
i2c.init(freq=1000000)
oled = SSD1306_I2C(128, 64, i2c)
console = FBConsole(oled)
os.dupterm(console)
/*
* File: smplefm.cpp
*
* Simple FM Synthesis
*
*/
#include "userosc.h"
typedef struct State {
#include "userosc.h"
typedef struct State {
float w0;
float phase;
uint8_t flags;
} State;
enum {
k_flags_none = 0,
#include "audio_provider.h"
#include "micro_features/micro_model_settings.h"
#include <Arduino.h>
#include <M5Stack.h>
#include <driver/i2s.h>
#define ADC_INPUT ADC1_CHANNEL_6 //pin 34, for M5Stack Fire
#define PIN_MICROPHONE 34
#define ADC_OFFSET (ADC_INPUT * 0x1000 + 0xFFF)
#define BACKLIGHT 32
#include "command_responder.h"
#include <M5Stack.h>
#include <Avatar.h>
using namespace m5avatar;
Avatar avatar;
void InitResponder() {
M5.begin();
M5.Lcd.fillScreen(BLACK);
[env:m5stack-fire]
platform = espressif32
board = m5stack-fire
framework = arduino
monitor_speed = 115200
build_flags = -DARDUINOSTL_M_H -Ilib/tfmicro/third_party/gemmlowp -Ilib/tfmicro/third_party/flatbuffers/include -Ilib/tfmicro/third_party/kissfft
[env:m5stack-fire]
platform = espressif32
board = m5stack-fire
framework = arduino
build_flags = -Ilib/tfmicro/third_party/gemmlowp -Ilib/tfmicro/third_party/flatbuffers/include
extern TfLiteStatus SetupAccelerometer(tflite::ErrorReporter* error_reporter);
extern bool ReadAccelerometer(tflite::ErrorReporter* error_reporter,
float* input, int length, bool reset_buffer);
#include "output_handler.h"
#include <Arduino.h>
#include <M5Stack.h>
void DrawWing() {
int x = 60;
int y = 20;
int w = 200;
int h = 200;
int t = 20;