SCHEMATIC 3. This is so obvious. It took me the better part of an afternoon to discover the
PIC18 Explorer's pushbutton logic level inversion.
}
#endif
}
else if(PUSH_BUTTON_2 == 0)
{
#ifdef ENABLE_SLEEP
while(PUSH_BUTTON_2
== 1);
return 2;
#else
//if the button was
//previously not pressed
if(PUSH_BUTTON_pressed
== FALSE)
{
PUSH_BUTTON_pressed
= TRUE;
PUSH_BUTTON_press_
me = TickGet();
return 2;
}
#endif
}
SCHEMATIC 4. This was one of
those lightbulb moments. The
Cerebot 32MX7's pushbuttons
are at rest logically low while the
PIC18 Explorer's pushbutton are
held inactive by a pullup resistor.
The pushbutton code was
snatched from the Node 2
framework. The code works for the PIC18 Explorer as the
depressed state of the pushbuttons is logically low. We
need only make this simple logic inversion for the 32MX7
pushbuttons to be recognized:
if(PUSH_BUTTON_1 == 1)
else if(PUSH_BUTTON_2 == 1)
Naturally, a similar code change must be made on the
Node 1 side.
A couple of compiles and reloads later, LED2 toggled
on the receiving 32MX7 with the depression of each
32MX7 transmitter pushbutton. According to the
comments in the code, Node 1 should transmit a character
map with each pushbutton 1 depression. Here’s the
character map:
{
{0x20,0xB2,0x20,0x20,0x20,0xB2,0x20,0x20,0xB2,0x2
0,0xB2,0x20,0x20,0x20,0x20,0x20,0xB2,0x20,0xB2,0x
0D,0x0A},
{0xB2,0x20,0xB2,0x20,0xB2,0x20,0xB2,0x20,0x20,0x2
0,0xB2,0x20,0x20,0xB2,0x20,0x20,0xB2,0x20,0x20,0x
0D,0x0A},
{0xB2,0x20,0x20,0xB2,0x20,0x20,0xB2,0x20,0xB2,0x2
0,0xB2,0x20,0x20,0xB2,0x20,0x20,0xB2,0x20,0xB2,0x
0D,0x0A},
{0xB2,0x20,0x20,0xB2,0x20,0x20,0xB2,0x20,0xB2,0x2
0,0x20,0xB2,0x20,0xB2,0x20,0xB2,0x20,0x20,0xB2,0x
0D,0x0A},
{0xB2,0x20,0x20,0xB2,0x20,0x20,0xB2,0x20,0xB2,0x2
0,0x20,0x20,0xB2,0x20,0xB2,0x20,0x20,0x20,0xB2,0x
0D,0x0A}
};
ROM const BYTE MiWi[5][21] =
If you associate 0x20 as a space character and 0xB2 as
a darkened block, you can render the message on a sheet
of graph paper. However, it’s a bit easier to just press the
button and capture the Mi Wi graphic at Node 2 as I did in
Screenshot 2. The RSSI (Received Signal Strength Indicator)
SERVO 10.2011 53