-
Notifications
You must be signed in to change notification settings - Fork 2
Screen
The FED4 has three user buttons (GPIO BUTTON_1 = 40, BUTTON_2 = 39, BUTTON_3 = 14), arranged bottom / middle / top. They use internal pull-down and can wake the device from light sleep. There is no general-purpose “button pressed” API for sketches; the library assigns fixed behaviors.
Default behavior (on wake)
-
checkButton1()— Button 1 (bottom): Hold ~1 s → test pellet dispense (feed()),bopBeep(). -
checkButton2()— Button 2 (middle): Hold ~1 s → device reset (red wipe,resetJingle(),esp_restart()). -
checkButton3()— Button 3 (top): Hold 500 ms → audio toggle (silence/unsilence), plusclick(). Hold 1500 ms → menu (menu()),hapticDoubleBuzz().
These are run from wakeUp() after a button wake (not touch). Poll with digitalRead(BUTTON_1) etc. (HIGH = pressed) if you need raw state elsewhere (e.g. menu, dispense loop).
See FED4_Buttons.cpp, FED4_Pins.h.
The FED4 uses a Sharp Memory Display (SPI, DISPLAY_CS = 17), 144×168 pixels, 1-bit (black/white). The FED4 class extends Adafruit_GFX, so you can use standard GFX calls (drawPixel, fillRect, print, drawLine, etc.) plus FED4-specific helpers.
Initialization and refresh
-
initializeDisplay()— init display, allocate buffer, clear (called frombegin()). -
updateDisplay()— redraw status (task, mouse ID, env, battery, SD, counters, indicators, date/time). Called fromrun()and elsewhere. -
refresh()— push the backing buffer to the display. Call after drawing. -
clearDisplay()— clear buffer (white) and refresh.
Status helpers (used by updateDisplay)
-
displayTask(),displayMouseId(),displayEnvironmental(),displayBattery(),displaySDCardStatus(),displayCounters(),displayIndicators(),displayDateTime()— status layout. -
displayActivityMonitor()/displayActivityCounters()— when program is ActivityMonitor. -
displayInitStatus(msg)— show init message duringbegin(). -
displayLowBatteryWarning()— low-battery full-screen message.
Constants: DISPLAY_WIDTH = 144, DISPLAY_HEIGHT = 168; DISPLAY_BLACK, DISPLAY_WHITE, DISPLAY_INVERSE, DISPLAY_NORMAL.
See FED4_Display.cpp, FED4.h. Adafruit Sharp Memory Display, Adafruit_GFX.