First of all install update and upgrade your system:
$ sudo apt update
$ sudo apt upgrade
Then, install required libraries:
#include <Arduino.h> | |
#include <ESP32Encoder.h> | |
#define pulse2rev 824.5f | |
const int encoder_a = 26; | |
const int encoder_b = 25; | |
const int motor_control_a = 21; | |
const int motor_control_b = 22; | |
const int vr1_pin = 13, vr2_pin = 33, vr3_pin = 14, vr4_pin = 27; |
import sensor | |
import image | |
import lcd | |
import time | |
import math | |
lcd.init(freq=20000000) | |
lcd.rotation(2) | |
sensor.reset() |
import sensor, image, time, lcd | |
from Corgi85 import corgi85 | |
auth = "sqdSuyH9oidoRBZG5T72UdpYiMFcgeUEifAYTmSfdo8" | |
#reset esp8285 | |
corgi85.reset() | |
#print(dir(corgi85)) |
This is a collection of code snippets for various features on the STM8S family microcontrollers (specifically the STM8S003F3). These are written against the STM8S/A SPL headers and compiled using SDCC.
Some of this controller's functions aren't particularly intuitive to program, so I'm dumping samples for future reference here. These are based on the STM8S documentation:
# remove main.py boot.py - By: kkmon - Tue Nov 17 2020 | |
import sensor, image, time | |
import os, sys, time | |
sys.path.append('') | |
sys.path.append('.') | |
os.chdir("/flash") | |
sys.path.append('/flash') |
import sensor, image, lcd, time | |
import KPU as kpu | |
from fpioa_manager import * | |
from Maix import I2S, GPIO | |
from board import board_info | |
import audio | |
def play_wav(fname): | |
player = audio.Audio(path = fname) | |
player.volume(80) |
import sensor, image, time, lcd, os | |
import time, touchscreen as ts | |
from machine import I2C | |
import lcd, image | |
from board import board_info | |
from fpioa_manager import * | |
from Maix import FPIOA, GPIO | |
def create_folder(): | |
os.chdir("/sd/datasets") |
import sensor,image,lcd,time | |
import KPU as kpu | |
sensor.reset() | |
sensor.set_pixformat(sensor.RGB565) | |
sensor.set_framesize(sensor.QVGA) | |
sensor.set_vflip(1) | |
sensor.run(1) | |
lcd.init(freq=20000000, color=lcd.BLACK) |
import sensor, image, time, lcd | |
from Corgi85 import corgi85 | |
token = "sqdSuyH9oidoRBZG5T72UdpYiMFcgeUEifAYTmSfdo8" | |
#reset esp8285 | |
corgi85.reset() | |
#print(dir(corgi85)) |