View smplfm.cpp
/* | |
* File: smplefm.cpp | |
* | |
* Simple FM Synthesis | |
* | |
*/ | |
#include "userosc.h" | |
typedef struct State { |
View osctest.cpp
#include "userosc.h" | |
typedef struct State { | |
float w0; | |
float phase; | |
uint8_t flags; | |
} State; | |
enum { | |
k_flags_none = 0, |
View audio_provider.cc
#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 |
View command_responder.cc
#include "command_responder.h" | |
#include <M5Stack.h> | |
#include <Avatar.h> | |
using namespace m5avatar; | |
Avatar avatar; | |
void InitResponder() { | |
M5.begin(); | |
M5.Lcd.fillScreen(BLACK); |
View platformio.ini
[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 |
View output_handler.cc
#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; |
View main_loop.cc
void loop() { | |
// Attempt to read new data from the accelerometer | |
bool got_data = ReadAccelerometer(error_reporter, model_input->data.f, | |
input_length, should_clear_buffer); | |
// Don't try to clear the buffer again | |
should_clear_buffer = false; | |
// If there was no new data, wait until next time | |
if (!got_data) return; | |
// Run inference, and report any error | |
TfLiteStatus invoke_status = interpreter->Invoke(); |
View gesture.py
import tensorflow as tf | |
seq_length = 128 | |
model = tf.keras.Sequential([ | |
tf.keras.layers.Conv2D( | |
8, (4, 3), | |
padding="same", | |
activation="relu", | |
input_shape=(seq_length, 3, 1)), # output_shape=(batch, 128, 3, 8) |
View platformio.ini
[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 |
View accelerometer_handler.h
extern TfLiteStatus SetupAccelerometer(tflite::ErrorReporter* error_reporter); | |
extern bool ReadAccelerometer(tflite::ErrorReporter* error_reporter, | |
float* input, int length, bool reset_buffer); |
NewerOlder