Introduction: HackerBoxes 0020: Summer Camp

Picture of HackerBoxes 0020: Summer Camp

Hacker Summer Camp: This month, HackerBox Hackers are working with Electronic Conference Badges while exploring embedded wireless communications and user interface functionality with the ESP32 platform.

This Instructable contains information for working with HackerBoxes #0020, which can be purchased here. If you would like to receive a box like this right in your mailbox each month, now is the time to subscribe at HackerBoxes.com and join the revolution!

Topics and Learning Objectives for HackerBox 0020:

  • Explore the social history of hacker conferences and badges
  • Assemble a custom "conference badge" platform
  • Configure the Arduino IDE for use with the ESP32 processor
  • Use interrupt handlers for capacitive touch sensor inputs
  • Bit-bang melodies on a simple buzzer
  • Demonstrate color-cycling on single-wire LED pixel chains
  • Display text and graphics on a color TFT LCD Display
  • Integrate embedded functions for a wireless game of tag demo

HackerBoxes is the monthly subscription box service for DIY electronics and computer technology. We are hobbyists, makers, and experimenters. And we are the dreamers of dreams.

Step 1: HackerBoxes 0020: Box Contents

Picture of HackerBoxes 0020: Box Contents
  • HackerBoxes #0020 Collectable Reference Card
  • HackerBoxes "Conference Badge" PCB
  • Components and Connector Kit for PCB
  • ESP32 DevKitC Processor Module
  • QVGA Color TFT LCD Display
  • Two-in-One LiPo Battery Manager
  • WS2812 RGB LEDs
  • Piezo Buzzer
  • MicroUSB Cable
  • Female DuPont Jumper Wires
  • Opening Tool for Mobile Devices
  • Exclusive "Hack The Planet" Silicon Wristband
  • Exclusive HackerBoxes Badge Lanyard
  • Exclusive "reverse engineer" Decal

Some other things that will be helpful:

  • Soldering iron, solder, and basic soldering tools
  • LiPo battery pack or USB power supply
  • Double-sided tape or velcro for battery pack
  • Computer with Arduino IDE

Most importantly, you will need a sense of adventure, DIY spirit, and hacker curiosity. Hardcore DIY electronics is not a trivial pursuit. It's a real challenge and when you persist and enjoy the adventure, a great deal of satisfaction can be derived from learning new technology and hopefully getting some projects working. Just take each step slowly, mind the details, and don't hesitate to ask for help.

Step 2: Hacker Summer Camp 2017

Picture of Hacker Summer Camp 2017

Hacker Summer Camp is a term of endearment for the collective activities of one week each summer when tens of thousands of us descend upon Las Vegas, Nevada. These activities center around three conventions: DEF CON, Black Hat, and BSides Las Vegas. For a flavor of the awesomeness, check out the feature length DEF CON Documentary Film. All around Summer Camp 2017, keep an eye out for the BitHead logo on the back of our shirts and say hello. Here are the details for 2017:

JULY 25-26:BSIDES LAS VEGAS
Tuscany Suites
Free Admission
Approximately 3,000 Attendees Expected
Keep an eye out for HackerBoxes in the big Chill-Out Room. We are an auction/raffle sponsor, so Lady Luck may come bearing Elite DIY Electronics. Always split Aces and Eights.

JULY 26-27:BLACK HAT
Mandalay Bay
Over 15,000 Attendees Expected
We will be out surfing "The Bay" so hit us up for some free commemorative Summer Camp swag.

JULY 27-30:DEF CON 25
Caesars Palace
Over 20,000 Attendees Expected
Here are some events to put on your list:

  • Thursday 8pm: HackerBoxes Meetup - Starbucks inside Caesar’s Palace
  • Friday - Sunday: Visit us at the HackerBoxes table in the Vendor area
  • Saturday 1pm: Attend the "Hardware Hacking: Old Sk00l and New Sk00l" talk by hwbxr (founder of HackerBoxes) in the Village Talks Room just outside the contests area

SEE YOU THERE!

Step 3: DEF CON Badges

Picture of DEF CON Badges

Over its 25 year history, DEF CON has become known for awesome badges.

There are the official badges that are purchased (or earned) and are worn to access the con itself. There is also an entire world of custom unofficial badges.

Step 4: HackerBoxes Badge Platform

Picture of HackerBoxes Badge Platform

Even if you are not going to DEF CON, your summer will be complete with this cool wearable platform of hackable electronics. Build it, customize it, wear it, display it... endless summer fun.

The HackerBoxes Badge PCB has been designed to support a variety of components and modules. It can be worn on a lanyard, used as a handheld, mounted on the wall, or deployed pretty much anywhere in countless wireless and colorful applications.

Features:

  • ESP32 Dual Core 160MHz Processor
  • 2.2 inch QVGA Color TFT LCD Display
  • WiFi 802.11 b/g/n/d/e/i/k/r
  • Bluetooth v4.2 BR/EDR and BLE
  • Five Touch Pad Inputs
  • Five RGB WS2812 LEDs
  • Piezo Buzzer
  • LiPo Battery Charger and Manager

Step 5: Assembling the Platform

Picture of Assembling the Platform

The PCB and components can be assembled with a few options depending upon how you would like to use them. Read through this step and also the information about the power supply before deciding on the details of your build and beginning assembly.

Assembly Order:

  • The WS2812 RGB LEDs should be soldered first since they are surface mount devices and the leads are easier to reach without other components in the way.
  • The battery leads should be soldered in from the read of the PCB (solder on the front of the PCB) prior to attaching the battery management module, which may block the battery leads a bit.
  • The electrolytic capacitor should be mounted before the LCD module.
  • The buzzer should be mounted after the LCD module.
  • All other components may be assembled in pretty much any order.

Component Polarities:

  • The WS2812 RGB LEDs have a diagonal notch on one corner to match up with the same marking on the PCB silkscreen.
  • The electrolytic capacitor has a negative (-) stripe above the negative lead. The PCB has a positive (+) marking for the other lead.
  • The ceramic capacitors are not polarized.
  • The buzzer has a positive (+) marking to match up with the same marking on the PCB.
  • The LiPo battery holes have a positive (+) marking on one side - this is for the red wire.

WITHOUT Female Header Sockets:

  • The female headers can be used to make sockets for the ESP32 and the LCD so that the modules can be removed for debugging or reuse. However, the sockets make the assembled PCB much thicker, so they are definitely not the best option for wearable or handheld applications.
  • Mount the battery manager module first.
  • The ESP32 board can be spaced a couple of millimeters up off of the PCB to ensure that the antenna portion clears over the battery manager module. Put something to hold it into place (or just use fingers) while starting the soldering. After that, the solder will hold it in its (very slightly) elevated position.
  • Also, to create more space, the Battery Manager module can be mounted flush against the PCB using only header pins (without the black plastic spacer). Put the pins in from behind (with the black spacer on the rear of the PCB), solder the pins to the PCB (from the top), stack on the module, solder the pins to the module, snip off the plastic spacer and any portions of the pins on both side. Now it should be very low profile.

WITH Female Header Sockets:

  • To cut the female headers to length, just use small wire cutters to snip through the hole ONE PAST where you want the socket strip to end. The pin/hole that you cut through is sacrificed.

Minimal Build Considerations:

  • You may wish to focus on making a lighter and thinner build (to wear it).
  • As mentioned above, the female sockets should be avoided.
  • All five of the capacitors can probably be left off. There is reasonable decoupling on the modules.

Access to SD Slot on LCD Module:

  • We do not use the SD slot in any examples here, but you need to make some accommodations if you plan to use it.
  • The ceramic capacitors need to be left off, or mounted on the rear of the PCB, or replaced with chip capacitors of the same value (100nF).
  • The LCD module should be spaced a couple of millimeters up off of the PCB to clear SD card slot access over the WS2812 LEDs.
  • A shorty MicroSD to SD adapter can be used to prevent a flash card from extending out from behind the LCD module and obstructing the RGB LEDs.

Stabbies and LiPo Battery Mounting:

  • After soldering is complete, there will be a lot of "stabbies" or pin leads protruding from the bottom side of the PCB. These should be trimmed down with small wire cutters (while wearing safety glasses, of course).
  • The LiPo pack can be attached to the back of the board using thick double sided tape or velcro strips. The tape or strips should be thick enough to protect the battery pack (and your shirt) from the remaining stabbie stumps. If not, a bit of card stock or thin plastic can provide a nice mechanical barrier between the back of the PCB and the battery or anything else that the PCB might rub against.

Step 6: Power Supply

Picture of Power Supply

The Badge can be powered by either a LiPo (lithium polymer) Battery Pack or by USB. The power supply mode is selected by the jumper block.

POWER OFF

  • Switch jumper block to USB side
  • Unplug USB cable so no power is applied

USB POWERED

  • Switch jumper block to USB side
  • Plug MicroUSB cable into ESP32 module
  • Power other end of USB cable with a computer, hub, USB wall supply, or mobile power pack
  • The battery manager will automatically charge the LiPo Battery (if one is connected)

LiPo BATTERY POWERED

  • Remove MicroUSB cable so no power is applied
  • Switch jumper block to BAT side
  • Battery manager discharges battery and boosts it up to 5V

It is suggested not to use a socket for the battery manager. Solder it (using header pins) directly to the PCB. This LiPo battery is a good example of the type to use. They are a little large, but very thin. They fit perfectly on the back of the PCB and they provide many hours of operation between charges.

BATTERY WARNING: Always be aware when charging or discharging LiPo batteries. In rare instances, they can get warm, swell up, or even burst. Do not leave them unattended. These are the type of batteries in mobile phones, tablet computers, and laptops, so they are generally safe and trustworthy for a long time, but it is always better to be safe than sorry.

Step 7: ESP32 and Arduino IDE

Picture of ESP32 and Arduino IDE

The ESP32 is a single chip 2.4 GHz Wi-Fi and Bluetooth combo solution. It is highly integrated, requiring less than ten external components. The ESP32 integrates the antenna switch, RF balun, power amplifier, low noise receive amplifier, filters, and power management modules. As such, the entire solution occupies minimal Printed Circuit Board (PCB) area.

The ESP32DevKitC is a small ESP32-based development board produced by Espressif. Most of the I/O pins are led out to the pin headers on both sides for easy interfacing. A USB interface chip and voltage regulator are integrated into the module.

While the ESP IDF (link below) can be used to directly program and flash the ESP32, support for the ESP32 within the Arduino ecosystem and IDE has been continuously evolving. This Arduino route is a very quick and easy way to work with the ESP32.

The Arduino ESP32 github repository includes installation instructions for LInux, OSX, and Windows. Click to that link and follow the instructions that correspond with the operating system on your computer.

More Resources:
ESP32 Datasheet
ESP32DevKitC Schematic
ESP32 Technical Reference Manual
ESP IDF (IoT Development Framework) Programming Guide

Step 8: Touch Sensor Inputs

Picture of Touch Sensor Inputs

The Badge PCB includes five metal pads to serve as user input buttons. These pads are attached to the ESP32 I/O pins numbered 12, 13, 14, 15, and 27. These I/O pins each support touch sensor input.

The attached touch_demo sketch shows how to set up interrupt handling functions to be called whenever one of the touch sensors is triggered. Use the Arduino IDE to compile and flash the demo onto the ESP32DevKitC module. Once flashed, open the Arduino IDE serial monitor, and touch the sensor pads.

Step 9: Buzzer Output

Picture of Buzzer Output

The Badge PCB has the Piezo Buzzer pads wired to ESP32 I/O pin number 18.

The attached buzzer_demo sketch shows how to bit-bang some very retro sounding tones on the simple buzzer.

Step 10: NeoPixel RGB LEDs

Picture of NeoPixel RGB LEDs

The Badge PCB has landing pads for five NeoPixel RGB LEDs (WS2812). They are wired in a chain off of ESP32 I/O pin number 5.
The attached rgbled_demo sketch shows how set and cycle the colors of the five RGB LEDs. The demo uses the popular Adafruit NeoPixel Library, so be sure to have that installed and updated within your Arduino IDE beforehand.

Step 11: Color TFT LCD Display

Picture of Color TFT LCD Display

The Badge Graphical Display is provided by a 2.2 inch TFT LCD Module. The display has 320x240 full color pixels (QVGA). The module is 3.3V compatible and has a 4-Wire SPI Serial Interface to the ILI9340C controller chip.

This MartyMacGyver demo using the Adafruit ILI9341 driver can be loaded to show some really nice graphics features. Just be sure to change the pin numbers to match those on the Badge PCB by pasting this block over the stock pin assignments:

// TFT Display Pins<br>#define TFT_CS    19
#define TFT_DC    22
#define TFT_MOSI  23
#define TFT_CLK   26
#define TFT_RST   21
#define TFT_MISO  25

Step 12: Badge Demonstration Firmware - Wireless Tag

Picture of Badge Demonstration Firmware - Wireless Tag

Combining all of these functions together, along with some of the wireless communication features of the ESP32, can make for a very cool, interactive badge including a "wireless tag" mode.

HB020_Badge_A
Using this sketch, put your handle into the following line after the underscore:
char ssid[]="HackerBoxer_L33tHaX0r";

Your handle text is transmitted via 802.11 as SSID broadcast packets for all to see. Any detected wireless network SSIDs are listed on the display. Detected SSIDs starting with the text "HackerBoxer_" are assumed to be from other such badges and are displayed as IDs that have been tagged.

If two or more such badges encounter each other (for example, at DEF CON), they will display lists of handles from all of the other badges they have tagged. Of course, the badges play sounds and cycle the LED colors along the way. The single touch pad on the right is used to toggle the mute setting on the audio.

HB020_Badge_B (added July 16, 2017)

Rev. B has some UI and aesthetic improvements. Inter-badge comms still compatible with Rev. A. Here is a change log:

  • replaced beep() with post from sconklin
  • added BitHead graphic to LCD functionality
  • clean up display text a little
  • default to muted state
  • display mute indicator on upper left of screen
  • tighten timing loops for more "entertainment"

This is the version we will be demoing at Summer Camp, so please feel free to edit in your handle into the code and load this version onto your badge. Come by the DC25 Vendor table, say hello, and tag our badges!

Non-Badge Applications for Platform
This ESP32 + QVGA platform can support packet sniffing, games, and various other challenges. An interesting application for an office (or other environment where the same people are around day after day) would be to gather packets and then associate the MAC addresses (such as from mobile phones) with the names of their owners. Then, the system could greet your friends and coworkers by displaying their name whenever their MAC address is detected. Unique sound effects and LED modes could even be associated with different identified MAC addresses.

Step 13: Opening Mobile Phones and Tablet Computers

Picture of Opening Mobile Phones and Tablet Computers

This might be the perfect tool for getting inside mobile devices... "THE OPENING TOOL" from Unlimited Innovation.

Step 14: Hack the Planet

Picture of Hack the Planet

Thank you for joining our adventures into the world of Electronic Conference Badges while exploring embedded wireless communications and user interface functionality. If you have enjoyed this Instrucable and would like to have a box of electronics and computer tech projects like this delivered right to your mailbox each month, please join us by SUBSCRIBING HERE.

Reach out and share your success in the comments below and/or on the HackerBoxes Facebook page. Certainly let us know if you have any questions or need some help with anything. Thank you for being part of HackerBoxes. Please keep your suggestions and feedback coming. HackerBoxes are YOUR boxes. Let's make something great!

Comments

EvanDallas (author)2017-09-06

How do we make our own ascii image for this instead of the hackerbox logo?

kaigoth (author)EvanDallas2017-09-10

Check the sketches for "bithead".

kaigoth made it! (author)2017-09-10

Finally got time to do this one! Thanks again HB!

d4e5 (author)2017-08-22

HB020_Badge_B.ino same for this one...

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino: In function 'void setup()':

HB020_Badge_B:68: error: 'touchAttachInterrupt' was not declared in this scope

touchAttachInterrupt(15, mutebutton, 40); //threshold 40

^

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino: In function 'void loop()':

HB020_Badge_B:80: error: 'class WiFiClass' has no member named 'softAP'

WiFi.softAP(ssid, NULL, 1, 0, 1);

^

HB020_Badge_B:98: error: 'class WiFiClass' has no member named 'softAPdisconnect'

WiFi.softAPdisconnect(1);

^

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino: In function 'void wifiScan2LCD()':

HB020_Badge_B:125: error: request for member 'startsWith' in 'WiFi.WiFiClass::SSID(((uint8_t)i))', which is of non-class type 'char*'

if (WiFi.SSID(i).startsWith("HackerBoxer"))

^

HB020_Badge_B:127: error: request for member 'toCharArray' in 'WiFi.WiFiClass::SSID(((uint8_t)i))', which is of non-class type 'char*'

WiFi.SSID(i).toCharArray(hackers_found[next_hacker_found],70);

^

HB020_Badge_B:139: error: request for member 'substring' in 'WiFi.WiFiClass::SSID(((uint8_t)i))', which is of non-class type 'char*'

tft.print(WiFi.SSID(i).substring(0,17));

^

HB020_Badge_B:140: error: 'WIFI_AUTH_OPEN' was not declared in this scope

tft.println((WiFi.encryptionType(i) == WIFI_AUTH_OPEN)?" ":"*");

^

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino: In function 'void BitHead2LCD()':

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

"00000000000000000000000000000000000000000000000000000000111110011111111100000000000000000000000000000000000000000000000000000000000"};

^

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

/Users/dimi/Documents/Arduino/HB020_Badge_B/HB020_Badge_B.ino:446:134: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

d4e5 (author)2017-08-22

HB020_Badge_A.ino does not compile:

/Users/dimi/Documents/Arduino/HB020_Badge_A/HB020_Badge_A.ino: In function 'void setup()':

HB020_Badge_A:60: error: 'touchAttachInterrupt' was not declared in this scope

touchAttachInterrupt(15, mutebutton, 40); //threshold 40

^

/Users/dimi/Documents/Arduino/HB020_Badge_A/HB020_Badge_A.ino: In function 'void loop()':

HB020_Badge_A:70: error: 'class WiFiClass' has no member named 'softAP'

WiFi.softAP(ssid, NULL, 1, 0, 1);

^

HB020_Badge_A:88: error: 'class WiFiClass' has no member named 'softAPdisconnect'

WiFi.softAPdisconnect(1);

^

/Users/dimi/Documents/Arduino/HB020_Badge_A/HB020_Badge_A.ino: In function 'void wifiScan2LCD()':

HB020_Badge_A:114: error: request for member 'startsWith' in 'WiFi.WiFiClass::SSID(((uint8_t)i))', which is of non-class type 'char*'

if (WiFi.SSID(i).startsWith("HackerBoxer"))

^

HB020_Badge_A:116: error: request for member 'toCharArray' in 'WiFi.WiFiClass::SSID(((uint8_t)i))', which is of non-class type 'char*'

WiFi.SSID(i).toCharArray(hackers_found[next_hacker_found],70);

^

HB020_Badge_A:128: error: request for member 'substring' in 'WiFi.WiFiClass::SSID(((uint8_t)i))', which is of non-class type 'char*'

tft.print(WiFi.SSID(i).substring(0,17));

^

HB020_Badge_A:129: error: 'WIFI_AUTH_OPEN' was not declared in this scope

tft.println((WiFi.encryptionType(i) == WIFI_AUTH_OPEN)?" ":"*");

^

exit status 1

'touchAttachInterrupt' was not declared in this scope

d4e5 (author)2017-08-22

I would be really useful if someone post a comprehensive guide to setup the IDE so that the libraries are there for the examples. I followed instructions and I still have missing Adafruit_GFX.h, and other duplicate Libraries.

This is the first time I am trying Arduino.cc and ESP32 and I have no clue where to find the Libraries.

Thanks!

JeffB300 (author)2017-08-19

I have both Badge A and B code working. Though I found it works better using the battery instead of the USB. I am guessing has to do with the amount of amp my unpowered USB hub is able to produce.

I decided I wanted a menu system which is what I coded below. It sort of works though the fire button is my select and used to return to menu screen with the up and down used to change the menu item. Right now I can select an option but the up and down arrow return to the menu screen "not suppose to do this" and the second press of select does not return to menu or sometimes does and the up down stop working. Also if you select WiFi_Scan it will scan the network but not be able to return to the menu screen "It crashes the program and screen goes white" and needs a reset to work again. Picture and music function are not yet added. I was hoping to get the button issue resolved first.

Here is my code

#include "SPI.h"
#include "WiFi.h"
#include "Adafruit_GFX.h"
#include "Adafruit_ILI9341.h"
#include <Adafruit_NeoPixel.h>



// TFT Display Pins
#define TFT_CS 19
#define TFT_DC 22
#define TFT_MOSI 23
#define TFT_CLK 26
#define TFT_RST 21
#define TFT_MISO 25

// Button pins
#define RIGHT 12
#define DOWN 13
#define UP 14
#define ENTER 15
#define LEFT 27

#define MENU_SZ 5

// setup the display object
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_MOSI, TFT_CLK, TFT_RST, TFT_MISO);
char ssid[]="HackerBoxer_HoneyBadgeR"; //put your handle after the underscore

char hackers_found[13][70];
int next_hacker_found = 0;


void BitHead2LCD();

// this will reduce button press debounce
unsigned long debounce;
int muted = true;

// show the menu at startup one time
int menuOnStart = true;

// default threshold set by the example code not sure what or why
int threshold = 40;
int menuActive = true;
//track which menu item is selected
int menuSelect = 0;
//menu labels
char menuLabels[MENU_SZ][15] = {"Music","WiFi_Scan","Logo","Picture", "Display_Name"};
int updateMenu = true;
int blankScreen = true;
int runOnce = true;


// method type defining
void mutebutton();
void paint_mute_indicator();

//setup the menu
//draw the menu to screen
void drawMenu();


//manages the menu select and redraws the menu
void menuUpdate();

// scrolls up or down for the menu
void moveDownPressed();
void moveUpPressed();
void menuUp();
void menuDown();


// uses the enter key to do something either menu or application
void menuEnter();
// update the menu depending on the state of the menu being active
void menuEnterPressed();

// wifi scan
void wifiScan2LCD();

// draws the user name
void displayName(char *name);

void setup() {
// put your setup code here, to run once:
tft.begin();
tft.setRotation(3); // rotate 3*(pi/2)
debounce = millis();
for (int i; i<13; i++)
{
hackers_found[i][0] = 0; //empty array of strings
}
touchAttachInterrupt(UP, menuUp, threshold); //threshold 40
touchAttachInterrupt(DOWN, menuDown, threshold); //threshold 40
touchAttachInterrupt(ENTER, menuEnter, threshold); //threshold 40
Serial.begin(115200);
menuSelect = 1;

}

void loop() {
// put your main code here, to run repeatedly:

if(menuActive == false)
{
//{"Music","WiFi_Scan","Logo","Picture", "Display_Name"};
switch(menuSelect)
{
case 0 :
break;
case 1 :
wifiScan2LCD();
break;
case 2 :
BitHead2LCD();
break;
case 3 :
break;
case 4 :
displayName("Jeff");
break;
default:
break;
}
}
else
{
if(updateMenu)
{
if(blankScreen)
{
blankScreen = false;
tft.fillScreen(ILI9341_BLACK);
}
updateMenu = false;
drawMenu();
}
}

delay(50);
}

void menuEnter()
{
if ((millis() - debounce) > 100)
{
menuEnterPressed();
}
}

void menuEnterPressed()
{
if(menuActive == true)
{
menuActive = false;
runOnce = true;
}
else
{
blankScreen = true;
menuActive = true;
updateMenu = true;
}
delay(300);
}
void menuUp()
{
moveUpPressed();
}



void moveUpPressed()
{
if(menuActive == false)
{
return;
}
if ((millis() - debounce) > 300)
{
debounce = millis();
menuSelect--;
menuUpdate();

}
}

void menuDown()
{
moveDownPressed();
}

void moveDownPressed()
{
if(menuActive == false)
{
return;
}

if ((millis() - debounce) > 300)
{
debounce = millis();
menuSelect++;
menuUpdate();
}
}

void menuUpdate()
{
if(menuSelect >= MENU_SZ)
{
menuSelect = 0;
}
if(menuSelect < 0)
{
menuSelect = MENU_SZ - 1;
}
updateMenu = true;
runOnce = true;
}

void drawMenu()
{
tft.setCursor(0, 0);
tft.setTextColor(ILI9341_YELLOW);
tft.setTextSize(4);
for(int i = 0; i < MENU_SZ; i++)
{
if(menuSelect == i)
{
tft.setTextColor(ILI9341_RED);
}
else
{
tft.setTextColor(ILI9341_YELLOW);
}
tft.print(" ");
tft.println(menuLabels[i]);
}
}

// draws the user name
void displayName(char *name)
{
if(runOnce)
{
tft.fillScreen(ILI9341_BLACK);
tft.setTextSize(8);
tft.setCursor((tft.width()/2)-60, (tft.height()/2)-80);
tft.setTextColor(ILI9341_GREEN);
tft.print(name);
runOnce = false;
}

}

void wifiScan2LCD()
{
int netsfound;
int displaylines=13;

tft.fillScreen(ILI9341_BLACK);

tft.setCursor(0, 0);
tft.setTextColor(ILI9341_YELLOW);
tft.setTextSize(4);
tft.println(" Nets Scanned");
tft.setTextColor(ILI9341_GREEN);
tft.setTextSize(2);
// return;
while (displaylines > 0)
{
netsfound = WiFi.scanNetworks();
if (netsfound==0)
{
tft.println(". . .");
displaylines--;
}
for (int i = 0; i < netsfound; ++i)
{
if (WiFi.SSID(i).startsWith("HackerBoxer"))
{
WiFi.SSID(i).toCharArray(hackers_found[next_hacker_found],70);
hackers_found[next_hacker_found][25] = 0; //truncate for display
next_hacker_found++;
if (next_hacker_found == 13)
next_hacker_found = 0;
}
else
{
// Print SSID and RSSI for each network found
tft.print(" [");
tft.print(WiFi.RSSI(i));
tft.print("] ");
tft.print(WiFi.SSID(i).substring(0,17));
tft.println((WiFi.encryptionType(i) == WIFI_AUTH_OPEN)?" ":"*");
delay(50);
displaylines--;
}
}
delay(700); // Wait before scanning again
}
}

void BitHead2LCD() //Brute-force TFT bit blit of the HackerBoxes mascot BitHead
{
if(runOnce)
{
char *bithead[] = {
"00000000000000000000000000000000000000000000000000001111111111111111111110000000000000000000000000000000000000000000000000000000000",
"00000000000000000000000000000000000000000000000111111111111111111111111111111110000000000000000000000000000000000000000000000000000",
"00000000000000000000000000000000000000000001111111111111111111111111111111111111111000000000000000000000000000000000000000000000000",
"00000000000000000000000000000000000000001111111111111111111111111111111111111111111111100000000000000000000000000000000000000000000",
"00000000000000000000000000000000000001111111111111111111111111111111111111111111111111111100000000000000000000000000000000000000000",
"00000000000000000000000000000000000111111111111111111111111111111111111111111111111111111111100000000000000000000000000000000000000",
"00000000000000000000000000000000011111111111111111111100000000000000000000000111111111111111111000000000000000000000000000000000000",
"00000000000000000000000000000001111111111111111110000000000000000000000000000000011111111111111110000000000000000000000000000000000",
"00000000000000000000000000000111111111111111100011110000011100000001110000001110000011111111111111100000000000000000000000000000000",
"00000000000000000000000000001111111111111111000111111000011110000011111000011110000011111111111111111000000000000000000000000000000",
"00000000000000000000000000111111111111110011000110011100001110000111001100000110000011001111111111111110000000000000000000000000000",
"00000000000000000000000001111111111111100011101110001100000110000110001100000110000111001110111111111111000000000000000000000000000",
"00000000000000000000000011111111111101100011101100001100001110000110001100000110000110000110011111111111110000000000000000000000000",
"00000000000000000000000111111111110001100011101100001100001110000110001100000110000110000110000111111111111000000000000000000000000",
"00000000000000000000001111111111100001100011101110001100000110000110001100000110000111001110000111111111111100000000000000000000000",
"00000000000000000000011111111111100001110011000110011100000110000110001100000110000011001100000111111111111110000000000000000000000",
"00000000000000000000111111111111111000111111000111111000111111100011111000011111100011111100011111111111111111000000000000000000000",
"00000000000000000001111111111111111000011110000011110000111111100001111000011111100001111000011111100111111111100000000000000000000",
"00000000000000000011111111110000000000000000000000000000000000000000000000000000000000000000000000000011111111110000000000000000000",
"00000000000000000111111111100000000000000000000000000000000000000000000000000000000000000000000000000001111111111000000000000000000",
"00000000000000001111111111100001111000001111100001111000000111000000111110000111110000111100000011110000111111111100000000000000000",
"00000000000000001111111111100001111000011101110001111000001111000001110110001110111000111100000111111000011111111110000000000000000",
"00000000000000011111111101110000011000011000110000011000000011000001100011001100011000001100001110011100001111111110000000000000000",
"00000000000000111111111000110000011000011000110000011000000011000001100011001100011000001100001110001100001111111111000000000000000",
"00000000000000111111111000110000011000011000111000011000000011000001100011001100011000001100001100001100001111111111100000000000000",
"00000000000001111111111000110000011000011000110000011000000011000001100011001100011000001100001100001100001111111111100000000000000",
"00000000000001111111111000110000011000011000110000011000000011000001100011001100011000001100001110011100000101111111110000000000000",
"00000000000011111111011001100000111000011101110000011000000011100001110111001110111000001100000110011000001110111111110000000000000",
"00000000000011111110011111100011111110001111100001111110001111111000111110000111110000111111000111111000111111111111111000000000000",
"00000000000111111110000111000001111100000111000000111100000111110000011100000011100000111110000001100000011111011111111000000000000",
"00000000000111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001111111100000000000",
"00000000001111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001111111100000000000",
"00000000001111111000111110000111110000011100000011100000011111000011111000011110000001111000001111000001111000001111111110000000000",
"00000000001111110001111111000111111000111100000011100000111111100011111100011110000011111100001111000001111000001111111110000000000",
"00000000011111110001100011001110011000001100000001100000110001100110001100000110000011001110000011000000011000000011111110000000000",
"00000000011111100001100011001100011000001100000001100000110001100110001100000110000111000110000011000000011000000011111111000000000",
"00000000011111100001100011001100011100001100000001100000110001100110001110000110000111000110000011000000011000000011111111000000000",
"00000000111111100001100011001100011100001100000001100000110001100110001100000110000111000110000011000000011000000011111111000000000",
"00000000111111100001100011001100011000001100000001100000110001100110001100000110000111000110000011000000011000000011111111100000000",
"00000000111111100001110111001110011000001100000001110000111011100111011100000110000011001100000111000000011000000011111111100000000",
"00000000111111111000111110000111110000111111000111111100011111000011111000011111100011111100011111110001111110001111111111100000000",
"00000001111111110000011100000011100000111111000011111000001110000001110000011111100000111000001111100001111100001111111111100000000",
"00000001111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011111100000000",
"00000001111110000011000000001000000001000000001000000000100000000100000001100000000100000000110000000010000000010000011111110000000",
"00000001111100001111100001111000000111110000111100000111100000111100000011111000011111000011111000011110000001110000001111110000000",
"00000001111100001101110000111000001110111000111100000111100000011100000111011000111011100011011100011110000001110000011111110000000",
"00000011111100011100110000011000001100011000001100000001100000001100000110001100110001100110001100000110000000110000011111110000000",
"00000011111100011000111000011000001100011000001100000001100000001100001110001100110001100110001110000110000000110000011111110000000",
"00000011111100011000111000011000011100011000001100000001100000001100001110001100110001100110001110000110000000110000011111110000000",
"00000011111000011000111000011000001100011000001100000001100000001100001110001100110001100110001110000110000000110000011111111000000",
"00000011111000011100110000011000001100011000001100000001100000001100000110001100110001100110001100000110000000110000011111111000000",
"00000011111100001101110000011100001110111000011100000001110000001110000111011100111011100111011100000111000000111000011111111000000",
"00000011111110001111100001111110000111110001111111000111111000111111000011111000011111000011111000011111100011111110001111111000000",
"00000011111000000011000000000000000011000000000000000000000000000000000001100000001100000000110000000000000000000000000111111000000",
"00000011111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111111000000",
"00000011111001110000001110000001111000001111000000110000000111000000111000000011000000011100000011100000011100000001100111111000000",
"00000111110011111000011110000011111100011111100001111000001111000001111110001111000001111110000111100000111111000111100011111000000",
"00000111110110011100000110000111001100011001100000111000000011000011100110000011000001100111000001100001110011000001100011111000000",
"00000111111110001100000110000110001110111000110000011000000011000011000110000011000001100011000001100001100011000001100011111000000",
"00000111111110001100000110000110001110110000110000011000000011000011000111000011000011100011000001100001100011100001100011111000000",
"00000111111110001100000110000110001110110000110000011000000011000011000111000011000011100011000001100001100011100001100011111000000",
"00000111111110001100000110000110001110111000110000011000000011000011000111000011000001100011000001100001100011000001100011111000000",
"00000111110110001100000110000111001100011001110000011000000011000011100110000011000001100111000001100001110011000001100011111000000",
"00000111110111111000011111100011111100011111100011111100001111110001111110001111110001111110000111111000111111000111111111111000000",
"00000111110011111000011111100001111000001111000011111110001111110000111100001111110000111100001111111000011110000111111111111000000",
"00000111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011111000000",
"00000111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111111000000",
"00000111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111111000000",
"00000111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111111000000",
"00000111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111111000000",
"00000111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111111000000",
"00000111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111111000000",
"00000111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111111000000",
"00000111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111111000000",
"00000111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001111110000000",
"00000111111000000010000000000000000111111100000000000000000000000000000000000000000000000000000000000000000000000000001111110000000",
"00000011111100000110000000000001111111111111110000000000000000000000000000000000011111111111111000000000000000100000001111110000000",
"00000011111100001110000000000111111111111111111100000000000000000000000000000001111111111111111111000000000001100000001111110000000",
"00000011111100001110000000011111111111111111111111000000000000000000000000000111111111111111111111110000000001100000011111110000000",
"00000011111100001100000000111111111111111111111111100000000000000000000000001111111111111111111111111100000001110000011111110000000",
"00000011111100011100000001111111111111111111111111110000000000000000000000011111111111111111111111111110000001110000011111100000000",
"00000011111110011100000011111111111111111111111111111000000000000000000000111111111111111111111111111111000001110000011111100000000",
"00000011111110011000000111111111111111111111111111111100000000000000000001111111111111111111111111111111100001110000111111100000000",
"00000011111110011000001111111111111111111111111111111110000000000000000001111111111111111111111111111111110001111000111111100000000",
"00000011111111011000011111111111111111111111111111111110000000000000000001111111111111111111111111111111110001111000111111100000000",
"00000011111111111000011111111111111111111111111111111111000000000000000001111111111111111111111111111111111001111001111111000000000",
"00000001111111111000111111111111111111111111111111111111000000000000000011111111111111111111111111111111111001111001111111000000000",
"00000001111111110000111111111111111111111111111111111111000000000000000011111111111111111111111111111111111101111011111111000000000",
"00000001111111110000111111111111111111111111111111111111000000000000000011111111111111111111111111111111111101111011111110000000000",
"00000001111111110001111111111111111111111111111111111110000000000000000001111111111111111111111111111111111100111111111110000000000",
"00000001111111110001111111111111111111111111111111111110000000000000000001111111111111111111111111111111111100111111111110000000000",
"00000001111111110000111111111111111111111111111111111100000000000000000001111111111111111111111111111111111100111111111100000000000",
"00000000111111100000111111111111111111111111111111111000000000000000000001111111111111111111111111111111111100111111111100000000000",
"00000000111111100000111111111111111111111111111111110000000000000000000001111111111111111111111111111111111100011111111100000000000",
"00000000111111100000111111111111111111111111111111100000000000000000000000111111111111111111111111111111111100011111111000000000000",
"00000000111111100000011111111111111111111111111111100000000000000000000000111111111111111111111111111111111000011111111000000000000",
"00000000111111100000011111111111111111111111111110000000000000000000000000011111111111111111111111111111111000001111110000000000000",
"00000000111111100000001111111111111111111111111100000000000000000000000000001111111111111111111111111111111000001111110000000000000",
"00000000111111100000000111111111111111111111111000000000000000000000000000000111111111111111111111111111110000001111111000000000000",
"00000000111111100000000111111111111111111111110000000000000000000000000000000011111111111111111111111111100000000111111000000000000",
"00000000111111100000000011111111111111111111000000000000000000100000000000000001111111111111111111111111100000000111111100000000000",
"00000000111111100000000001111111111111111100000000000000000100110000000000000000011111111111111111111111000000000011111100000000000",
"00000000111111100000000000111111111111110000000000000000000110110000000000000000000111111111111111111100000000000011111110000000000",
"00000000111111100000000000011111111110000000000000000000001110111000000000000000000001111111111111110000000000000001111110000000000",
"00000000111111100000000000001110000000000000000000000000001110111100000000000000000000000111111110000000000000000001111110000000000",
"00000000111111100000000000000000000000000000000000000000011110111100000000000000000000000000000000000000000000000000111110000000000",
"00000000111111110000000000000000000000000000000000000000011110111110000000000000000000000000000000000000000000000000111110000000000",
"00000000011111110000000000000000000000000000000000000000111110111110000000000000000000000000000000000000000000000001111110000000000",
"00000000011111110000000000000000000000000000000000000000111110111110000000000000000000000000000000000000000000000001111110000000000",
"00000000001111111000000000000000000000000000000000000001111110111111000000000000000000000000000000000000000000000011111110000000000",
"00000000001111111000000000000000000000000000000000000001111111111111000000000000000000000000000000000000000000000011111100000000000",
"00000000000111111100000000000000000000000000000000000011111110111111000000000000000000000000000000000000000000000111111100000000000",
"00000000000111111110000000000000000000000000000000000011111110111111000000000000000000000000000000000000000000001111111000000000000",
"00000000000011111111000000000000000000000000000000000011111110111111000000000000000000000000000000000000000000011111111000000000000",
"00000000000001111111110000000000001100000000000000000011111100111111000000000000000000000000000110000000000000111111110000000000000",
"00000000000000111111111111111111111110000000000000000011111100111111000000000000000000000000011111000000000001111111110000000000000",
"00000000000000011111111111111111111110000000000000000011111100111111000000000000000000000001111111100000000011111111100000000000000",
"00000000000000001111111111111111111111000000000000000011111000111111000000000000000000000011111111111100011111111111000000000000000",
"00000000000000000111111111111111111111000000000000000011110000011111000000000000000000000111111111111111111111111110000000000000000",
"00000000000000000001111111111111111111000000000000000001100000001111000000000000000000000111111111111111111111111100000000000000000",
"00000000000000000000111111111111111111000000000000000000000000000110000000000000000000001111111111111111111111111000000000000000000",
"00000000000000000000001111111111111111000000000000000000000000000000000000000000000000011111110111111111111111110000000000000000000",
"00000000000000000000000011111100011111000000000000000000000000000000000000000000000000011111100000111111111111000000000000000000000",
"00000000000000000000000000000000011111000110000000000000000000000000000000000000000000011111100000000001110000000000000000000000000",
"00000000000000000000000000000000011111101111000000000000000000000000000000000000000000111111100000000000000000000000000000000000000",
"00000000000000000000000000000000011111101111011100000000000000000000000000000011000000111111000000000000000000000000000000000000000",
"00000000000000000000000000000000011111101111111100001000000000100000001000000111000000111111000000000000000000000000000000000000000",
"00000000000000000000000000000000011111101111111100011100000001100000011100000111000000111111000000000000000000000000000000000000000",
"00000000000000000000000000000000011111111111111100011110000001100000011110000111000000111111000000000000000000000000000000000000000",
"00000000000000000000000000000000011111111110111100011110000011100000011110000111000000111111000000000000000000000000000000000000000",
"00000000000000000000000000000000011111111110111100011110000011100000011110000111000000111110000000000000000000000000000000000000000",
"00000000000000000000000000000000011111111100111100011110000011100000011110000111000000111110000000000000000000000000000000000000000",
"00000000000000000000000000000000011111111100111100011110000011100000011110000111000011111110000000000000000000000000000000000000000",
"00000000000000000000000000000000011111111100111000011110000011100000011110000111100111111110000000000000000000000000000000000000000",
"00000000000000000000000000000000001111111100111000011110000011100000011110000111100111111110000000000000000000000000000000000000000",
"00000000000000000000000000000000001111111100111000011110000011100000001110000111101111111110000000000000000000000000000000000000000",
"00000000000000000000000000000000000111111110111000011110000011100000001110000111111111111110000000000000000000000000000000000000000",
"00000000000000000000000000000000000111111111111000001110000011100000001110000011111111111100000000000000000000000000000000000000000",
"00000000000000000000000000000000000011111111111000001110000011100000001110000011111111111100000000000000000000000000000000000000000",
"00000000000000000000000000000000000001111111111110011110000011110000001111000111111111111000000000000000000000000000000000000000000",
"00000000000000000000000000000000000000111111111111111110000011110000011111111111111111111000000000000000000000000000000000000000000",
"00000000000000000000000000000000000000011111111111111110000111111111111111111111111111110000000000000000000000000000000000000000000",
"00000000000000000000000000000000000000000111111111111111111111111111111111111111111111000000000000000000000000000000000000000000000",
"00000000000000000000000000000000000000000011111111111111111111111111111111111111111110000000000000000000000000000000000000000000000",
"00000000000000000000000000000000000000000000011111111111111111111111111111111111111000000000000000000000000000000000000000000000000",
"00000000000000000000000000000000000000000000000001111111111111111111111111111111000000000000000000000000000000000000000000000000000",
"00000000000000000000000000000000000000000000000000000000111110011111111100000000000000000000000000000000000000000000000000000000000"};

const int bithead_width = 131;
const int bithead_height = 147;

runOnce = false;
tft.fillScreen(ILI9341_BLACK);

tft.setCursor(0, 0);
tft.setTextColor(ILI9341_CYAN);
tft.setTextSize(4);
tft.println(" HackerBoxes");

for (int y=0; y < bithead_height; y++)
{
int r = rand() % 256;
int g = rand() % 256;
int b = rand() % 256;
for (int x=0; x < bithead_width; x++)
{

if (bithead[y][x] == '1')
{
tft.drawPixel(x+100, y+55, tft.color565(r,g,b));
}
}
}
}
}

seaprimate made it! (author)2017-08-14
So the one on the left was my first build. I'm not good at SMD soldering, and kind of learned along the way. Broke the tracer so I had to run a wire from IO5 to the 2nd LED.
As you can see, the second one came out much nicer. Practice makes perfect. I'm plan on keeping the second, better, badge as is for a momento and see what other kinds of fun things I can do on the broken badge.
miguelmota made it! (author)2017-08-13

Great hacker box. I have never soldered in my life and was able to assemble it. This youtube video helped me figure out the order of the parts when soldering https://www.youtube.com/watch?v=zBEdKFnZRmw At first the LEDs didn't work but it was just due to incomplete soldering, so just make sure that there's complete contact with the board via the solder. Also, make sure to have the most update to date Arduino IDE and libraries. I was able to run the sample programs without any problems. It was a lot of fun!

deakin (author)2017-08-04

Arduino: 1.8.3 (Windows 8.1), Board: "ESP32 Dev Module, QIO, 80MHz, 921600, None"

Build options changed, rebuilding all

C:\Users\deakin\Downloads\HB020_Badge_B\HB020_Badge_B.ino:15:26: fatal error: Adafruit_GFX.h: No such file or directory

compilation terminated.

Multiple libraries were found for "WiFi.h"

Used: C:\Users\deakin\Documents\Arduino\hardware\espressif\esp32\libraries\WiFi

Not used: C:\Program Files (x86)\Arduino\libraries\WiFi

exit status 1

Error compiling for board ESP32 Dev Module.

This report would have more information with

"Show verbose output during compilation"

option enabled in File -> Preferences.


hit this wall with badge b attempt. rgb sketch was fine. seems i should rename one or the other but unsure how. please advise.

uscjones (author)deakin2017-08-06

Same problem. Any help?

MetalnatH (author)uscjones2017-08-09

I've just found that the usb cable shipped with box was no good. I found a good one I was using for another board, brought in the libraries with the libraries with the library manager, then i pulled the esp32 dev bourd off of the badge for first program and flashed after selecting the right com port. Once it starts uploading you might see errors for char / string casting but they won't kill the upload, I let it sit for a minute after text stops changing and it stalls on "hard reset" then unplug board place into badge and power back on. then it worked. I hope this helps.

uscjones (author)deakin2017-08-07

Figured it out. The code libraries for the TFT display aren't part of the standard package. Just find the libraries that the compiler says it can't find on Github, load them into your Arduino libraries directory, then compile it again, then go find the next one it can't find, load that one. After 3 or 4 library additions, it'll compile. The Wifi-related messages don't prevent successful compilation, it's just the first part that causes the failure. I am still trying to figure out how to get the sketch to download to the ESP32, though...it doesn't seem to be communicating properly.....but at least I got the code to compile. Good luck!

Wyvn (author)2017-07-25

I forked the esp32-nesemu and made some changes to automagically handle the touchpad buttons as an input and display PIN reassignments when the badge is selected from "make menuconfig". See the README for more details.

Touchpad fire occasionally gets "stuck"... haven't looked closely other than it isn't the touch pad being pushed.

https://github.com/WyvnWolf/esp32-nesemu/tree/hack...

I remember G-a-l-a-g-a being a good one button game.

rob_hunt (author)Wyvn2017-07-26

Wyvn - thank you so much for figuring out how to flip the screen and get the buttons working(!)

I've been playing with your branch a little this evening. Yeah, I've noticed it auto-firing in the game you mentioned. Not firing at full speed though - you can still fire faster by hitting the button. Also noticed that in a couple games (SMB, DK), it seems to start the game with the player trying to continuously move left. Eventually it snaps out of it. I don't of that's something weird in the nesemu code or what - doesn't appear that touch pad interrupt is continuously firing, so I suspect it's something in nesemu.

Wyvn (author)rob_hunt2017-08-02

Before I moved on from this project I wanted to see if I could get any sound working. I was able to get something working last night and I'll clean up the code and put it in the repo.

Basically I used an ISR timer to drive the buzzer. While my independent test code worked well, the sound ended up being a bit warbly when integrated into the emulator. My guess is the two cores are a busy doing the emulator+video and stealing the cycles for driving the buzzer isn't the best.

The NES has 2 square wave channels. I changed the code to sample the first channel and if there was no volume use the second channel frequency. The triangle, sample etc channels are disabled.

Wyvn (author)Wyvn2017-08-06

I pushed the changes to enable to sound to the hackerbox branch. I ended up removing the ISR code and switched to the ledc pmw. Have some first pass code to try and do volume as well.

AmyH12 made it! (author)2017-08-04

This was my first HackerBox project, and it was super fun! I can't wait to work on more of them.

TylerE33 (author)AmyH122017-08-04

You picked a good one to start on, this was my favorite box so far.

TylerE33 (author)2017-07-27

Correction, I had put the wrong link to my crappy space game. I quite literally did not sleep the night before I posted. Here is the real link if you want it:

https://github.com/HailTheBDFL/esp32-spaceShooter

AmyH12 (author)TylerE332017-08-04

Nice work! I had fun playing with this one.

TylerE33 (author)AmyH122017-08-04

Thank you!

TylerE33 made it! (author)2017-07-20

I made a game of snake to run on the badge. The code isn't pretty, but it works!

There are a couple bugs, but nothing game-breaky.

If you want the code, I put it on github: https://github.com/HailTheBDFL/esp32-snake

AmyH12 (author)TylerE332017-08-04

Awesome! Thanks for including this, nice work!

MoahM (author)TylerE332017-07-21

Way cool man! Nice work!

IbrahimS8 made it! (author)2017-07-26

Just finished got badge A and B to load! This was a super fun to build.

Dragonmaster53 (author)2017-07-23

Hi guys I was wondering if there were any videos for these boxes showing how to do all this stuff. I love messing around with electronics but have never soldered a board together or anything. I would really like to be good at this stuff. If anyone could help me out that would be great. I have boxes 19 and 20 plus the starter kit. Thank you!! If u would like to contact through email my email is dragonmaster0531@gmail.com

MartinW114 (author)2017-07-23

how do i get it to scan all ssid? I am terrible with code

r0mbas1c (author)2017-07-17

any ideas on how to capture wifi probe packets with this thing? been attempting to find libraries, etc to help capture a probe packet, strip the SSID, and compare that SSID against a list. Everything is working, except the most important part - grabbing the probe. Any ideas?

r0mbas1c (author)MoahM2017-07-18

Thanks @MoahM -- not enough brain power to digest that page & code quickly, but that page led me to https://github.com/espressif/esp-idf/blob/master/c... .... seems to have a full suite of utilities for this chip.

My add-on project for this is to receive client probe packets and check the SSID being probed against a list of SSIDs I built from wigle.net. Basically (proof of concept) - I used wigle.net API to scrape the closest 500 SSIDs to a few geolocations of federal law enforcement headquarters (the nearby coffee shops, etc) and put those SSIDs into a list. In the spirit of the "Find a Fed" game at DEFCON, the theory is that if my code matches an SSID probe to one of the unique SSIDs on my list, I will have "found a fed" and the NeoPixels will flash blue & red and the offending SSID and agency will be displayed.

Works great as long as I am just scanning active SSIDs, but haven't been able to figure out how to capture the probes from clients.

MoahM (author)r0mbas1c2017-07-19

This is awesome!!!!! Light up a branch on my github and push your code up! I'd love to include it in my iteration of the game firmware.

r0mbas1c (author)MoahM2017-07-19

Will do --- but the code isn't done quite yet! Right now it will only pick up SSID beacons, so the "Found a Fed" will only fire off if the same SSID name from wigle.net is found by the board.... meaning it would be most likely one of the mobile access points that was picked up in the vicinity of one of those headquarters, and that person is at the con with the SSID running. That is why I wanted to include SSID probes...so it would fire off from client devices that had connected to those SSIDs -- a MUCH bigger pool of people. I unfortunately won't have time between now and BSidesLV to get that code figured out.... but I will push to github tonight and you can give it a crack

MoahM (author)r0mbas1c2017-07-20

If we can't figure out how to get the client probes via promiscuous mode, we might be able to ID a fed by broadcasting the SSIDs(with the same encryption type,etc) from those places ourselves, then triggering on when a station tries to join. The thought being that only handsets that have those SSIDs saved in their connection list will try to join. Since they'd be protected networks, you wouldn't get all the folks set to auto-join opens. A little more effort, but might work. Does that make sense?

r0mbas1c (author)MoahM2017-07-20

Makes sense, but how do you get the little ESP32 to replicate 500+ access points simultaneously, and only for a short duration? I mucked up the code somehow last night while pulling in the rest of the agencies' data, so I still need to clean that up a bit....then I will release it. It is nothing fancy and is version 0.1 .... so it is likely pretty inefficient, but I will tweak it a bit over time.

MoahM (author)r0mbas1c2017-07-20

Maybe something like this? Completely untested, but the logic should be straight.

root = SD.open("/ourlistofAPs.txt")

if (root) {

while (root.available()) {

//* read the file and set the AP name to SSID from list

WiFi.softAP(root.read(), NULL, 1, 0, 1);

delay(10000); // or longer

WiFi.softAPdisconnect(1);

}

root.(close);

}

SlackerX made it! (author)2017-07-19

Thank you guys for an awesome project! First HackerBox project and I'm stoked! Great kit and easy to follow directions. Will be subscribing, can't wait to see what's instore for the next box. Thank you for your hard work in creating such a cool and fun project!

JeffG187 (author)2017-07-09

Has anyone gotten the sd card reader / writer to work? I've been trying since the box arrived and can't seem to figure it out.

MoahM (author)JeffG1872017-07-17

I got it!!!

Github is here https://github.com/lmarty/Hackerboxes20

Checkout the repo, the Defcon25Game project has working code to access the SD. Cruise the readme and install the lib called out.

@Hackerboxes : I've framed a little game for defcon and started work on it. Added some details and TODO's to my repo above. I'd love some support in getting the word out and having others join in on coding this up. I'd love your thoughts. If you can bless the intention, and add your feedback/support, it would be awesome. Maybe even do a little communication to the world. I know if we band together, we can have something cool built by Defcon.

JeffG187 (author)MoahM2017-07-17

HAHAHAHA oh give me a break. SD.Begin with custom pin definitions!!! HOW did I not notice that?! Ughhhh.

Thank you so much, that's awesome! I'll try to hop in and contribute something to your report this week! I'm excited to give it a try!

MoahM (author)JeffG1872017-07-17

Pretty sure theres some other secret sauce in that alternate lib too, but haven't checked yet.

JeffG187 (author)MoahM2017-07-17

I'm noticing that I have to have the flash button pressed on my badge to make the sd card stuff work. Have you found a way around that?! ( does the same with your code and the mysd examples. )

MoahM (author)JeffG1872017-07-18

There are two tiny pads on the back of the TFT labeled "j1", drop a blob of solder across them.

JeffG187 (author)MoahM2017-07-18

Really?! How did you figure that out?
Nice work, and thank you so much!!!

MoahM (author)JeffG1872017-07-19

Ah ha! Here's where I got my inspiration from. https://forum.pjrc.com/threads/28106-Display_ili9341?p=73018&viewfull=1#post73018 Folks are replacing resistors, being all proper and gentle. Then this guy comes in with the solderblob job. Anyhoo, your milage may vary, but it works for me.

MoahM (author)JeffG1872017-07-19

I found the jumper tip on one of the pages I came across researching the TFT for SD support. And held out on actually jumping it till I was frustrated enough to not care if I broke it. But once I did, it worked. Hackerboxes knows better than me though. It's their kit/design. I'm just a hack trying to bend it to my will. Implement at your own risk.

HackerBoxes (author)MoahM2017-07-18

From what I understand, shorting J1 on the LCD module bypasses the voltage regulator that converts the incoming 5V to the 3.3V needed by the LCD. J1 is intended to be shorted if you are providing 3.3V to the module to begin with. Shorting J1 is probably not a great idea if the supply to the module is 5V.

JeffG187 (author)JeffG1872017-07-11

HackerBoxes?

( I think ) I see that there is a way to change VSPI pins, but I don't see a way to do it from within Arduino code. This must be the intended usage as the pins you chose for the SD card do not seem to correlate to any particular set of SPI pins, including the port the TFT display is on. So what did you have in mind for the usage given this choice of pins? If it's setting up custom pins for one of the SPI ports, is this even possible without going lower level then the typical Arduino language?

ewagnerjr2000 (author)JeffG1872017-07-18

Jeff, it looks like the pins are hard set based on the schematics. It would have been faster to use the hardware spi.

JeffG187 (author)ewagnerjr20002017-07-18

Yeah, unfortunately it kinda "is what it is" as it's baked into the board. I may try just soldering on what I need to permanently do what the 'flash' button is doing when you press it. I hate that idea, but if it doesn't cause more problems I'll take it.

About This Instructable

8,289views

29favorites

License:

More by HackerBoxes:HackerBox 0024: Vision QuestHackerBox 0023: Digital AirwavesHackerBox 0022: BBC Micro:Bit
Add instructable to: