Skip to content
A series of tutorials and sketches pulled from various sources and modified for the Thotcon 0xA conference badge.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
AudioStreaming
LEDs
SoundBoard
bins binaries May 3, 2019
OxA-workshop.pdf Add files via upload May 3, 2019
README.md Update README.md May 3, 2019

README.md

Restoring your badge to stock firmware

esptool.py --chip esp32 --port "<YOUR_PORT>" --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 40m --flash_size detect 0x1000 bootloader_dio_40m.bin 0x8000 partitions.bin 0xe000 boot_app0.bin 0x10000 TC0xA.bin

Examples for Thotcon 0xA Badge

Introduction

The Thotcon 0xA badge runs off the Sparkfun ESP32 Thingdev board. Sparkfun has an excellent hookup guide over on their website.

Some quick notes about pins on the 0xA badge:

  • The touch pads for the device are on t4, 6, 3, 7, 2. These are, respectively, right, up, left, down, and select.
  • LEDS: 21, 19, 18, 17, 16, 5. These are, respectively, left ear, left eye, left mustache, right ear, right eye, right mustache.
  • Speaker: 26
  • Mic Pin: 25
  • Mic_clock: 23
  • Mic_ws: 22

Getting Started with the Badge

  1. Download/Install Arduino
  2. Install ESP32 board on Arduino platform (recommendation is to follow instructions under "Instructions for Boards Manager")

LEDs (Hello World)

There are six backlit LEDs on the Thotcon 0xA badge. An example of how to activate these LEDs and utilize them is located in the LEDs directory of this GitHub.

SoundBoard

The sound board maps sounds to three of the capacitive touch pads on the badge. The SoundBoard utilizes the audio library XT_DAC_AUDIO. Make sure this is included in any project that utilizes the speaker. Example code for this is located in in the SoundBoard directory.

Also note that all audio files must be converted before being uploaded to the badge. A brief explanation of how to convert audio for the badge follows.

Converting Audio for the Badge

  1. Download Audacity
  2. Download a hex editor (suggestions for Mac, Linux, and Windows)
  3. Open file in Audacity and convert to correct format by choosing the appropriate settings (instructions here)
  4. Open file in hex editor and copy/paste into a txt file. Save
  5. Open txt file (in vi or otherwise) and run regex command: %s/ /,0x/gi
  6. After running command, make sure to additionally add 0x to the beginning of the first hex value in the file.
  7. Get the size of array (one easy way to do this is by doing an "edit>find" on 0x). There is likely a smarter way to do these last three steps, but I don't have the time.
  8. Save, copy text, and paste into an array into Arduino in a header file (example uses SoundData.h). Array container works thusly: const unsigned char StarWarsWav[SIZE_OF_ARRAY] = { YOUR_ARRAY };

Audio Streaming

The Thotcon 0xA badge comes with a microphone that allows for streaming audio. An example of how to utilize this can be found in the AudioStreaming directory. Note that the 0xA badge has its own special driver for the microphone (located in the microphone_driver file). This must be included in any project that uses the mic.

On the server side, run this command in Terminal nc -nlvp 4444 | aplay -b 16000 -f S32LE

Recognition

We relied heavily on this website for speaker audio, including the library that its owner created:

Microphone Code:

Speaker Code:

Audio Streaming:

ESP32 Radio:

Documentation

"History repeats itself, first as tragedy, second as farce." - Karl Marx

You can’t perform that action at this time.