Skip to content

Instantly share code, notes, and snippets.

@davidbkemp
davidbkemp / gist:1602e1efd2ab7a6188c7
Created January 11, 2015 07:59
Modified Arduino USB Host Shield Keyboard Example
// Modified from https://github.com/felis/USB_Host_Shield_2.0/blob/master/examples/HID/USBHIDBootKbd/USBHIDBootKbd.ino
// Modified to print the ASCII hex codes of the keys pressed, and to handle some of the non-printable keys.
#include <hidboot.h>
#include <usbhub.h>
// Satisfy IDE, which only needs to see the include statment in the ino.
#ifdef dobogusinclude
#include <spi4teensy3.h>
#endif
@PonDad
PonDad / app.py
Created November 11, 2017 10:36
【Movidius™NCS&RaspberryPi】リアルタイム物体認識【TensorFlow】
#! /usr/bin/env python3
from mvnc import mvncapi as mvnc
import sys
import numpy
import cv2
path_to_networks = './'
path_to_images = '../../data/images/'
graph_filename = 'graph'
#image_filename = path_to_images + 'cat.jpg'
@aarmea
aarmea / animatronic_mouth.py
Last active July 20, 2023 23:46
Open and close an animatronic mouth on a Raspberry Pi GPIO pin
#!/usr/bin/env python
"""
animatronic_mouth.py
This script animates a motorized mouth on a Raspberry Pi GPIO pin so that it
appears to be speaking alongside the audio on the specified PulseAudio source
(which usually should be a sink's monitor).
Find PA_SOURCE with `pactl list` and look for a monitor device that corresponds
@nomolk
nomolk / M5Stack_FirebaseNihongoDisplay.ino
Last active February 10, 2020 21:03
Display Japanese text from firebase on M5Stack.
#include <IOXhop_FirebaseESP32.h>
// Set these to run example.
#define WIFI_SSID "xxxxxxxx"
#define WIFI_PASSWORD "xxxxxxxx"
#define FIREBASE_DB_URL "home-messenger-xxxxx.firebaseio.com"
#define FIREBASE_DB_DATA_PATH "/messages"
#define FIREBASE_DB_DATA_KEY "/mobile1ToHome"
#include <ESP32_SD_ShinonomeFNT.h>
#include <ESP32_SD_UTF8toSJIS.h>
@takeru
takeru / axp192.py
Last active September 12, 2019 12:38
M5StickVの電源管理
# M5StickVの電源管理方法
# https://github.com/sipeed/MaixPy/blob/master/components/boards/m5stick/src/m5stick.c
# https://github.com/sipeed/MaixPy/blob/master/projects/maixpy_m5stickv/builtin_py/pmu.py
# https://pdf1.alldatasheet.com/datasheet-pdf/view/757469/ETC2/AXP192.html
# 参考: M5StickC https://github.com/m5stack/M5StickC/blob/master/src/AXP192.cpp
import lcd
import pmu
@ksasao
ksasao / boot.py
Last active April 2, 2022 05:09
M5StickV で UART 文字列受信サンプル。uart.any() で受信バッファの状態を確認して readline() で読むのが簡単。https://twitter.com/ksasao/status/1239058196334923776
import lcd
import image
import time
import uos
lcd.init()
lcd.rotation(2) #Rotate the lcd 180deg
from Maix import I2S, GPIO
from Maix import GPIO
@ciniml
ciniml / grove_left_uart.ino
Last active August 16, 2022 18:55
Wio Terminal Grove UART
#include <wiring_private.h>
static Uart Serial3(&sercom3, PIN_WIRE_SCL, PIN_WIRE_SDA, SERCOM_RX_PAD_1, UART_TX_PAD_0);
void setup() {
Serial.begin(115200);
while(!Serial);
Serial3.begin(115200);
pinPeripheral(PIN_WIRE_SCL, PIO_SERCOM_ALT);
@3110
3110 / Core2_RTC_with_NTP.ino
Last active June 3, 2021 15:49
NTPを使ってM5Stack Core2のRTCを設定する
#include <M5Core2.h>
#include <WiFi.h>
const char* SSID = "SSID";
const char* PASSWORD = "SSID Password";
const char* NTP_SERVER = "ntp.jst.mfeed.ad.jp";
const char* TZ = "JST-9";
const uint8_t FONT_NUMBER = 2; // 16px ASCII Font
const uint8_t FONT_SIZE = 16;
@mongonta0716
mongonta0716 / main.cpp
Last active July 5, 2022 00:25
ESP-NOW Monitor ESP-NOWで受け取ったデータを表示し続けるアプリ
#include <Arduino.h>
#ifdef ARDUINO_M5STACK_Core2
#include <M5Core2.h>
#elif defined(ARDUINO_M5STACK_FIRE) || defined(ARDUINO_M5Stack_Core_ESP32)
#include <M5Stack.h>
#endif
#define LGFX_AUTODETECT
#include <LovyanGFX.hpp>
#include <esp_now.h>
#include <WiFi.h>
@imliubo
imliubo / M5Core2-display-image.py
Last active March 30, 2021 15:46
M5Core2 display images through HTTP request
import urequests
import time
import wifiCfg
from m5stack import lv, rtc
wifiCfg.auto_connect()
ticks_ms = 0
old_tick = 0