display information described in my previous article (June
‘ 10 issue) with one additional component: an external 4 x 4
numeric keypad. I will detail how you can create your own
custom keypad using standard pushbutton switches or even
bumper switches and limit switches. I will also describe how
I developed a practical user interface written in PIC18 C
that demonstrates how you can enter the speed for a
motor and special robot commands. It may be used as a
terminal or menu-driven user interface for the VEX
controller that you can use to enter numeric data necessary
to run your applications in a portable manner, while being
unplugged from the PC or laptop, using only the VEX
microcontroller, a VEX motor, an LCD, and a keypad.
You will be pleasantly surprised that you will not need
any other external components other than the keypad, LCD,
and pin headers since the VEX controller already has pull-ups and resistors in series to protect the digital input ports
even though the schematic shows them. The keypad works
together with an LCD display by assigning the I/O pins in
such a manner that it works as few pins as possible.
With the information presented here, you should be
able to write C applications to make menu selections using
a simple user interface so that you can select various robot
behaviors without the need for a laptop or PC. Imagine all
the VEX applications that could use a keypad as an input
device when a laptop or PC is not available. It also opens
up the VEX field to rapid prototyping machines such as
calculators, vending machines, appliances, etc.
Pushbutton and toggle switches can be used as a
convenient way to select various autonomous modes that
run with the microcontroller mounted on a robot or prop
(without having to use a PC). Pushbutton switches can also
be used for menu selections for an embedded user
interface. They can be wired to emulate a 4 x 4 keypad,
providing up to 16 independent inputs using the same
firmware provided with this article.
The pushbutton switches can be replaced with bumper
switches or limits switches which is handy to sense objects
and to check that mechanical stops or limits are not
exceeded when running in autonomous modes.
There are many kinds of switches and pushbuttons.
The normally open pushbutton (NO), normally closed
pushbutton (NC), the single pole single throw toggle switch
(SPST), the single pole double throw switch (SPDT), and
others handle low voltages and currents to high voltage
home appliance switches (120 volts AC). These switches
include momentary switches.
You should also be able to connect up to 16
pushbutton switches and scan their states using only eight
VEX I/O pins. If you think of each key as a pushbutton
switch and wire it in a similar manner to the keypad matrix,
you will be able to connect up to 16 individual pushbutton
switches and use our firmware to scan and read their states
using only eight I/O pins. Think of all the bumper switches
and limit switches that you could sense for your next robot
FIGURE 1. Here the keypad is
connected to the VEX controller
via an eight-bit parallel bus, so that
only eight of the I/O pins are
required for the keypad (in addition
to those used for the LCD).
SERVO 08.2010 49