Developmental Project 1.00 Vote

In this project, vote using the OLED and buttons.

The Vote program turns the 1st Maker Space Frog (Arduino UNO R4–based board) into a simple thumbs-up / thumbs-down voting machine. Students press one of two buttons to choose YES or NO. The Frog’s OLED screen shows a large thumbs-up or thumbs-down image, and the NeoPixel “eyes” change color to match the vote (green for YES, red for NO).

Project Code:

				
					/*
  Program: Vote.ino
  Copyright (C) 1st Maker Space, Inc. 2025

  Simple thumbs-up / thumbs-down voting UI using Frog buttons, OLED, and NeoPixel eyes.

  - Shows a "Vote" instruction screen on the OLED at startup.
  - SW1 selects YES (thumbs up, green eyes); SW2 selects NO (thumbs down, red eyes).
  - Uses 128x64 bitmap images stored in PROGMEM to save RAM.
*/

#include "1ST_Maker_Frog.h"   // Provides display, pixel, BUTTON_ONE/TWO, PRESSED, SCREEN_* etc.

// ---------------------------------------------------------------------------
//  Constants and configuration
// ---------------------------------------------------------------------------

// These bitmaps fill the entire 128x64 OLED screen.
#define BMP_WIDTH  128
#define BMP_HEIGHT 64

// 1-bit images are stored in PROGMEM (program memory) to conserve limited SRAM.
// The display draws white (1) pixels on a cleared (black) background.

// ----------------------- Thumbs Up Bitmap ---------------------------
const unsigned char thumbs_up_bmp[] PROGMEM = {
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x2f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0xa3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfa, 0xf1, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xbf, 0xdf, 0xec, 0xf8, 0xf7, 0xfb, 0xfd, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0xfc, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xfe, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0x7c, 0xfe, 0x7f, 0xdf, 0xef, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xf7, 0xfb, 0xfd, 0xf8, 0xfe, 0x3f, 0x7f, 0xbf, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0x7f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xfc, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xff, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xef, 0xf8, 0xff, 0x3d, 0xfd, 0xfe, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xdf, 0xff, 0xff, 0xec, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf9, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf1, 0xfe, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xfe, 0xe3, 0xff, 0x3f, 0xdf, 0xdf, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xfd, 0xfb, 0xff, 0xeb, 0xfe, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc7, 0xfe, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xcf, 0xfe, 0xbb, 0x76, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xdf, 0xf7, 0x8f, 0xfe, 0x00, 0x00, 0x3b, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x9f, 0xfe, 0x44, 0x09, 0x0f, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xdf, 0xff, 0xff, 0x1f, 0xfe, 0xbb, 0xf6, 0x87, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xe7, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x3f, 0xff, 0xff, 0xff, 0xe3, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x0c, 0xbf, 0xff, 0xff, 0xff, 0xf3, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0x84, 0x44, 0x44, 0x7f, 0xff, 0xff, 0xff, 0xf3, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xd1, 0x11, 0x12, 0xff, 0xff, 0xff, 0xff, 0xe7, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0x8a, 0xaa, 0xa0, 0xff, 0xff, 0xff, 0xff, 0xe3, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0x84, 0x44, 0x45, 0xff, 0xff, 0xff, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xaa, 0xaa, 0x93, 0xff, 0xff, 0xff, 0xff, 0x87, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0x84, 0x92, 0x47, 0xff, 0xff, 0xff, 0xff, 0xc3, 0x7f, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xd2, 0x49, 0x47, 0xff, 0xff, 0xff, 0xff, 0xf3, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0x8a, 0xaa, 0x57, 0xff, 0xff, 0xff, 0xff, 0xf3, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0x89, 0x25, 0x23, 0xff, 0xff, 0xff, 0xff, 0xf1, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xca, 0x92, 0x87, 0xff, 0xff, 0xff, 0xff, 0xf5, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0x88, 0xa8, 0xa7, 0xff, 0xff, 0xff, 0xff, 0xf3, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xa5, 0x25, 0x47, 0xff, 0xff, 0xff, 0xff, 0xe3, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0x8a, 0x94, 0x97, 0xff, 0xff, 0xff, 0xff, 0x97, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xa4, 0x52, 0x47, 0xff, 0xff, 0xff, 0xff, 0x07, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0x8a, 0x95, 0x47, 0xff, 0xff, 0xff, 0xff, 0xaf, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xc9, 0x49, 0x27, 0xff, 0xff, 0xff, 0xff, 0x8f, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0x84, 0xa4, 0x93, 0xff, 0xff, 0xff, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xaa, 0x52, 0xa7, 0xff, 0xff, 0xff, 0xff, 0x9f, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0x89, 0x15, 0x07, 0xff, 0xff, 0xff, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xc5, 0x52, 0xa7, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0x94, 0xa8, 0x97, 0xff, 0xff, 0xff, 0xfe, 0x9f, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0x8a, 0x45, 0x43, 0xff, 0xff, 0xff, 0xf8, 0x3d, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xa1, 0x2a, 0x47, 0xff, 0xff, 0xff, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0x8d, 0x51, 0x27, 0xff, 0xff, 0xff, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xc2, 0x4a, 0x97, 0xff, 0xff, 0xff, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0x95, 0x29, 0x43, 0xff, 0xff, 0xff, 0xfc, 0xef, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0x89, 0x44, 0xa5, 0xff, 0xff, 0xff, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xca, 0x55, 0x00, 0xff, 0xff, 0xff, 0xf2, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0x89, 0x29, 0x54, 0x09, 0x24, 0x88, 0x81, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xa4, 0x94, 0xa6, 0x00, 0x00, 0x00, 0x17, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0x82, 0x41, 0x07, 0xd5, 0x55, 0x55, 0x4f, 0xfd, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xd0, 0x04, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xea, 0xb2, 0xb7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xff, 0xbf, 0xff, 0xff, 0xff, 0xff
};

// --------------------- Thumbs Down Bitmap ---------------------------
const unsigned char thumbs_down_bmp[] PROGMEM = {
  0xff, 0xff, 0xff, 0xff, 0xfd, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xed, 0x4d, 0x57, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x20, 0x0b, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xbf, 0xf2, 0xaa, 0xaa, 0xab, 0xe0, 0x82, 0x41, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xe8, 0x00, 0x00, 0x00, 0x65, 0x29, 0x25, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0x81, 0x11, 0x24, 0x90, 0x2a, 0x94, 0x91, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0x4f, 0xff, 0xff, 0xff, 0x00, 0xaa, 0x53, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xff, 0xff, 0xff, 0xa5, 0x22, 0x91, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xf7, 0x3f, 0xff, 0xff, 0xff, 0xc2, 0x94, 0xa9, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xe9, 0x52, 0x43, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xe4, 0x8a, 0xb1, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xff, 0xff, 0xff, 0xe2, 0x54, 0x85, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xbc, 0x1f, 0xff, 0xff, 0xff, 0xc2, 0xa2, 0x51, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xf9, 0x7f, 0xff, 0xff, 0xff, 0xe9, 0x15, 0x29, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xe5, 0x4a, 0xa3, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xf3, 0xff, 0xff, 0xff, 0xff, 0xe0, 0xa8, 0x91, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xf9, 0xff, 0xff, 0xff, 0xff, 0xe5, 0x4a, 0x55, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xf3, 0xff, 0xff, 0xff, 0xff, 0xc9, 0x25, 0x21, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xf1, 0xff, 0xff, 0xff, 0xff, 0xe4, 0x92, 0x93, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xf5, 0xff, 0xff, 0xff, 0xff, 0xe2, 0xa9, 0x51, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xe2, 0x4a, 0x25, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xe9, 0xff, 0xff, 0xff, 0xff, 0xe9, 0x29, 0x51, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xc7, 0xff, 0xff, 0xff, 0xff, 0xe2, 0xa4, 0xa5, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0xe5, 0x15, 0x11, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xaf, 0xff, 0xff, 0xff, 0xff, 0xe1, 0x49, 0x53, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0x8f, 0xff, 0xff, 0xff, 0xff, 0xc4, 0xa4, 0x91, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0xea, 0x55, 0x51, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff, 0xe2, 0x92, 0x4b, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xfe, 0xc3, 0xff, 0xff, 0xff, 0xff, 0xe2, 0x49, 0x21, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xe1, 0xff, 0xff, 0xff, 0xff, 0xc9, 0x55, 0x55, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xf3, 0xff, 0xff, 0xff, 0xff, 0xa2, 0x22, 0x21, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xc7, 0xff, 0xff, 0xff, 0xff, 0x05, 0x55, 0x51, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xe7, 0xff, 0xff, 0xff, 0xff, 0x48, 0x88, 0x8b, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xfe, 0x22, 0x22, 0x21, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xfd, 0x30, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xc7, 0xff, 0xff, 0xff, 0xfc, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xe7, 0xff, 0xff, 0xff, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xe1, 0x6f, 0xdd, 0x7f, 0xf8, 0xff, 0xff, 0xfb, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xf0, 0x90, 0x22, 0x7f, 0xf9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xdc, 0x00, 0x00, 0x7f, 0xf1, 0xef, 0xfb, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0x6e, 0xdd, 0x7f, 0xf3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x7f, 0xe3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x7f, 0xd7, 0xff, 0xdf, 0xbf, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xfb, 0xfb, 0xfc, 0xff, 0xc7, 0x7f, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x7f, 0x8f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xff, 0x9f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xff, 0x37, 0xff, 0xff, 0xfb, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0x7f, 0xbf, 0xbc, 0xff, 0x1f, 0xf7, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xff, 0x3f, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xfe, 0xbf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xfd, 0xfe, 0xfc, 0x7f, 0x1f, 0xbf, 0xdf, 0xef, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xf7, 0xfb, 0xfe, 0x7f, 0x3e, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x7f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x3f, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xbf, 0xdf, 0xef, 0x1f, 0x37, 0xfb, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8f, 0x5f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc5, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf4, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
};

// ---------------------------------------------------------------------------
//  Data structures and globals
// ---------------------------------------------------------------------------

enum Which { NONE, UP, DOWN };
Which current = NONE;

// ---------------------------------------------------------------------------
//  Function prototypes
// ---------------------------------------------------------------------------
// (No explicit prototypes needed; the Arduino build process will generate them.)

// ---------------------------------------------------------------------------
//  Helper functions
// ---------------------------------------------------------------------------

/**************************************************
 * Function: showInstructionsOnce
 * Purpose:  Show a short, 3-line "Vote" instruction
 *           screen on the OLED at startup, then pause.
 *
 * Parameters:
 *    (none)
 *
 * Returns:
 *    void
 *
 * Notes:
 *    - Clears the display and uses 2x text size.
 *    - Leaves the screen visible for about 2.5 seconds.
 *    - Does not change any LEDs or NeoPixels.
 **************************************************/
void showInstructionsOnce() {
  display.clearDisplay();
  display.setTextSize(2);
  display.setTextColor(SSD1306_WHITE);
  display.setCursor(0, 0);
  display.println(F("   Vote:"));
  display.println(F(" SW1 = Yes"));
  display.println(F(" SW2 = No"));
  display.display();
  delay(2500); // show once at startup, then continue
}

/**************************************************
 * Function: showThumbs
 * Purpose:  Draw a thumbs-up or thumbs-down bitmap
 *           on the OLED and set both NeoPixel eyes
 *           to a matching color.
 *
 * Parameters:
 *    w  - Which image/color to show:
 *         * UP   -> thumbs_up_bmp + GREEN eyes
 *         * DOWN -> thumbs_down_bmp + RED eyes
 *
 * Returns:
 *    void
 *
 * Notes:
 *    - Clears the OLED and draws the selected bitmap
 *      full-screen before updating the display.
 *    - Sets both NeoPixels to a solid color and calls
 *      pixel.show() to make the change visible.
 *    - Does nothing if w is neither UP nor DOWN.
 **************************************************/
void showThumbs(Which w) {
  if (w == UP) {
    // ----- OLED: draw "thumbs up" -----
    display.clearDisplay();
    display.drawBitmap(0, 0, thumbs_up_bmp, BMP_WIDTH, BMP_HEIGHT, SSD1306_WHITE);
    display.display();

    // ----- NeoPixels: set both eyes to GREEN -----
    for (uint8_t i = 0; i < NUM_NEO; i++) {
      pixel.setPixelColor(i, pixel.Color(0, 255, 0)); // green eyes
    }
    pixel.show();
    
  } else if (w == DOWN) {
    // ----- OLED: draw "thumbs down" -----
    display.clearDisplay();
    display.drawBitmap(0, 0, thumbs_down_bmp, BMP_WIDTH, BMP_HEIGHT, SSD1306_WHITE);
    display.display();

    // ----- NeoPixels: set both eyes to RED -----
    for (uint8_t i = 0; i < NUM_NEO; i++) {
      pixel.setPixelColor(i, pixel.Color(255, 0, 0)); // red eyes
    }
    pixel.show();
  }
}

// ---------------------------------------------------------------------------
//  Setup and main loop
// ---------------------------------------------------------------------------

/**************************************************
 * Function: setup
 * Purpose:  Perform one-time hardware initialization
 *           for buttons, NeoPixels, and the OLED, then
 *           show the instruction screen once.
 *
 * Parameters:
 *    (none)
 *
 * Returns:
 *    void
 *
 * Notes:
 *    - Configures buttons with INPUT_PULLUP
 *      (pressed == LOW / PRESSED).
 *    - Starts NeoPixels, sets a modest brightness,
 *      and clears any previous color.
 *    - Initializes the OLED; if it fails, blinks red
 *      eyes forever as a visible error indicator.
 **************************************************/
void setup() {
  // ----- Buttons: internal pullups, PRESSED == LOW -----
  pinMode(BUTTON_ONE, INPUT_PULLUP);
  pinMode(BUTTON_TWO, INPUT_PULLUP);

  // ----- NeoPixels: begin and clear -----
  pixel.begin();
  pixel.setBrightness(64);  // keep friendly to eyes & power
  pixel.clear();
  pixel.show();

  // ----- OLED: initialize; fail-safe if not found -----
  if (!display.begin(SSD1306_SWITCHCAPVCC, SCREEN_ADDRESS)) {
    // If OLED doesn't init, blink eyes red forever (visible fault indication)
    while (true) {
      for (uint8_t i = 0; i < NUM_NEO; i++) {
        pixel.setPixelColor(i, pixel.Color(255, 0, 0));
      }
      pixel.show();
      delay(250);
      pixel.clear();
      pixel.show();
      delay(250);
    }
  }

  // ----- Show startup instructions once -----
  showInstructionsOnce();
}

/**************************************************
 * Function: loop
 * Purpose:  Continuously read the two buttons and
 *           update the displayed vote (thumbs up/down)
 *           when the selection changes.
 *
 * Parameters:
 *    (none)
 *
 * Returns:
 *    void
 *
 * Notes:
 *    - Uses a simple debounce strategy with a 10 ms
 *      delay between polls.
 *    - Only redraws the UI when the choice changes,
 *      reducing flicker and unnecessary updates.
 **************************************************/
void loop() {
  // Read buttons (active LOW)
  const bool b1 = (digitalRead(BUTTON_ONE) == PRESSED);
  const bool b2 = (digitalRead(BUTTON_TWO) == PRESSED);

  // Update only on state change to avoid redundant redraws
  if (b1 && current != UP) {
    current = UP;
    showThumbs(UP);
  } else if (b2 && current != DOWN) {
    current = DOWN;
    showThumbs(DOWN);
  }

  delay(10); // tiny debounce/poll delay
}
				
			

*If you’re copying and pasting the code, or typing from scratch, delete everything out of a new Arduino sketch and paste / type in the above text.

Learn More In Our Free Instructional Guidebook

This comprehensive guidebook for the 1st Maker Space Microcontroller Trainer provides a comprehensive introduction to the world of Arduino programming for beginners. It guides users through the foundational concepts of microcontrollers, detailing the unique features of the Arduino Leonardo-compatible MCU Trainer board. The manual offers a step-by-step journey from understanding the hardware components and the Arduino programming language to the vibrant global community of Arduino enthusiasts. It delves into the intricacies of each onboard circuit, explaining their functionalities and applications. With a focus on hands-on learning, the manual includes a series of coding exercises, tutorials in C/C++, and insights into the Arduino IDE.

More Projects

Project 1.00 Blink

In this project, you’ll learn how to blink an LED!

Project 1.01 Blink x2

In this project, you’ll learn how to blink more than one LED!