PyRaspBeta

← All practice problems

Raspberry Pi practice problem · Displays

Drinks menu

HardBudget $13Python · gpiozero

A drinks machine: a 16×2 I²C LCD (0x27, SDA/SCL, 5 V), a Next button on GPIO17 and a Select button on GPIO27 (both to GND, pull-ups). The menu is Tea, Coffee, Cocoa, in that order.

  • menu screen: line 1 is > and the current item, line 2 is two spaces and the item after it (wrapping round): > Tea / Coffee. It starts on Tea.
  • Next moves to the following item (after Cocoa comes Tea).
  • Select shows Making {item}... on line 1 and Please wait on line 2 for 2 s, then returns to the menu on the same item. Presses during those 2 s are ignored.

The test presses Next at 1, 2, 3 and 4 s, Select at 5 s, and Next at 6 s (while busy).

More in Displays