Skip to content

Instantly share code, notes, and snippets.

View tonosaman's full-sized avatar

Optional Exit of T.Ono tonosaman

View GitHub Profile
@tonosaman
tonosaman / README.md
Created May 12, 2023 02:40 — forked from manuelbl/README.md
ESP32 as Bluetooth Keyboard

ESP32 as Bluetooth Keyboard

With its built-in Bluetooth capabilities, the ESP32 can act as a Bluetooth keyboard. The below code is a minimal example of how to achieve it. It will generate the key strokes for a message whenever a button attached to the ESP32 is pressed.

For the example setup, a momentary button should be connected to pin 2 and to ground. Pin 2 will be configured as an input with pull-up.

In order to receive the message, add the ESP32 as a Bluetooth keyboard of your computer or mobile phone:

  1. Go to your computers/phones settings
  2. Ensure Bluetooth is turned on
@tonosaman
tonosaman / Linuxifying Windows.md
Created March 30, 2020 23:51 — forked from slikts/Linuxifying Windows.md
Linuxifying Windows

nelabs.dev

Linuxifying Windows for development

This guide is for 'linuxing-up' Windows as a development environment; it focuses on setting up [WSL], an Ubuntu Hyper-V virtual machine, [wsltty] (a nice terminal emulator) and various tweaks.

Rationale

# BCM2837 Raspberry Pi 3 Target
tcl_port 5555
telnet_port 4444
gdb_port 3333
transport select jtag
adapter_khz 1000
@tonosaman
tonosaman / FoldUnion.scala
Created June 4, 2012 21:04 — forked from jorgeortiz85/FoldUnion.scala
Folding over Scala union types
type ¬[A] = A => Nothing
type ∨[T, U] = ¬[¬[T] with ¬[U]]
type ¬¬[A] = ¬[¬[A]]
type |∨|[T, U] = { type λ[X] = ¬¬[X] <:< (T ∨ U) }
class FoldUnion[T](t: T) {
def boxClass(x: java.lang.Class[_]): java.lang.Class[_] = x.toString match {
case "byte" => manifest[java.lang.Byte].erasure
case "char" => manifest[java.lang.Character].erasure
case "short" => manifest[java.lang.Short].erasure