HackerBoxes 0020: Summer Camp

8,776

30

111

Posted

Introduction: 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

  • 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

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

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

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

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

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

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

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

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

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

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

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

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

Step 14: 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!

18 People Made This Project!

Recommendations

  • Remote Control Contest 2017

    Remote Control Contest 2017
  • Arduino Contest 2017

    Arduino Contest 2017
  • LED Contest 2017

    LED Contest 2017

We have a be nice policy.
Please be positive and constructive.

Tips

Questions & Answers

105 Comments

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

Check the sketches for "bithead".

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

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]

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

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!

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));
}
}
}
}
}

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.

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!

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.