Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Wasin Wongkum kkmonster

🏠
Working from home
View GitHub Profile
View egg_corgidude.py
import sensor
import image
import lcd
import time
import math
lcd.init(freq=20000000)
lcd.rotation(2)
sensor.reset()
View corgidude_test_blink.py
View STM8S_programming_examples.md

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:

Run at 16MHz

View file_remove.py
# 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')
@kkmonster
kkmonster / twatch_k210_flower_prediction.py
Last active Nov 26, 2020
t watch : run classifier model
View twatch_k210_flower_prediction.py
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)
@kkmonster
kkmonster / twatch_k210_flower_collection.py
Last active Nov 23, 2020
t watch : take a picture into folder
View twatch_k210_flower_collection.py
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")
View twatch_k210_yolo2.py
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)
View demo_CorgiDude_corgi85_LINE_Notify.py
import sensor, image, time, lcd
from Corgi85 import corgi85
token = "sqdSuyH9oidoRBZG5T72UdpYiMFcgeUEifAYTmSfdo8"
#reset esp8285
corgi85.reset()
#print(dir(corgi85))
View corgi85_blynk.cpp
#include <Arduino.h>
#include "corgi85_blynk.h"
void CORGI85_BLINK::loop(void)
{
switch (mode)
{
case stop:
View demo_ep8_inverted_pendulum.ino
#define sgn(x) ((x) < 0 ? -1 : ((x) > 0 ? 1 : 0))
#define off 0
#define on 1
#include "Arduino.h"
#include <ESP32Encoder.h> //https://github.com/madhephaestus/ESP32Encoder
#include <math.h>