Skip to content

Instantly share code, notes, and snippets.

@sweemeng
sweemeng / README.md
Last active Nov 6, 2021
Edge Impulse example for Wio Terminal
View README.md
@sweemeng
sweemeng / main.ino
Created Oct 10, 2021
This is a demo with Arduino for Wio Terminal. This is the demo that assumes that you have the library and board set up on the Arduino IDE. I go look at ways to do it in platform.io later
View main.ino
#include "Keyboard.h"
#include"TFT_eSPI.h"
#define NOOP 0
#define PRESS 1
#define UP 2
#define DOWN 3
#define LEFT 4
#define RIGHT 5
#define MODE_NOOP 0
@sweemeng
sweemeng / README.md
Last active Aug 9, 2021
Error Log for my code
View README.md
@sweemeng
sweemeng / gesture_capture.ino
Last active May 30, 2021
This is the arduino part of the gesture classifier
View gesture_capture.ino
#include <Arduino.h>
#include <Arduino_LSM9DS1.h>
// I am copying from arduino gesture to emoji to try understand how data collection work.
const float accThreshold = 2.5;
const int numSamples = 119;
int sampleRead = numSamples;
void setup() {
View hn_tagger.py
from transformers import pipeline
import requests
import pprint
def load_hn():
hn_feed = requests.get("https://hacker-news.firebaseio.com/v0/topstories.json?print=pretty")
data = hn_feed.json()
return data
View extract_data.js
const puppeteer = require('puppeteer')
const fs = require('fs')
const extractor = async url => {
const browser = await puppeteer.launch({
headless: true,
slowMo: 1500
})
const scrapeTime = Date.now()
const page = await browser.newPage()
View button_record.py
from m5stack import *
from m5ui import *
import time
import struct
import network
import urequests
import ujson
def push_data(button_name):
lcd.clear()
@sweemeng
sweemeng / hazewaze_worker.py
Last active Mar 30, 2019
Generation CSV file from data for hazewatch KL
View hazewaze_worker.py
import requests
import csv
import dateparser
api_key="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InN3ZWVtZW5nIiwicmVhZF93cml0ZSI6ZmFsc2UsImlhdCI6MTU1MzIxMzkxMn0.PRofXuak0Do6hmn6rdulxmeIIZBV9P0GJbdTPe0IvZU"
dev_url="https://api.favoriot.com/v1/devices"
one_dev_url="https://api.favoriot.com/v1/devices/{dev_id}"
data_url_tmpl="https://api.favoriot.com/v1/devices/{dev_id}/streams"
View hazeconf.json
{"ssid":"eatme", "password":"blergh", "apikey":"WhatKey?Monkey!", "device_id":"SniffSniff"}