Microchip Technology DM183037 Data Sheet

Page of 10
 2013 Microchip Technology Inc.
DS90003094A-page 3
TB3094
POWER
Power is supplied by a single 1.5V AA battery. An
MCP1640 boosts the voltage to the 3.3V operating
level for the PIC18F67J94. Resistor values used on the
development board differ slightly from those listed
below. Reference the schematic in 
actual resistor values used.
FIGURE 3:
1.5V BATTERY AND 
MCP1640 BOOST CIRCUIT
DANCE GAME
This is intended to be a dynamic game that includes
physical activity. If this type of activity has any risk of
injury or damage to property, it can be operated as
“sorcerer’s apprentice” where all participants remain
safely seated and attempt to mirror the movements of
a leader.
In order to demonstrate the features of the board, a
game has been created wherein one baton
(development board) establishes itself as a dance
leader, and other boards are dance followers. Dance
leader is selected by pressing the capacitive touch
button. If a dance follower is able to closely mirror the
movements of the dance leader, then their score will
increase. 
The wireless module has a range of approximately
30 feet with a fully charged battery.
DANCE LEADER
After the capacitive touch button is pressed to become
dance leader, an “L” will appear on the left-hand side of
the display. The right-most digit will have segments
move in a circular fashion. The circular motion of the
right-most digit indicates that motion data is being
broadcast to all followers within radio range.
DANCE FOLLOWER
After one member of the group has been chosen to be
dance leader, all other devices within radio range will
become dance followers, and presses of the capacitive
touch button will have no effect. Each time LED D1
changes, it indicates that motion data is being received
from a dance leader. Activity on this LED indicates that
the device is in Follower mode.
Full source code for the game has been provided.
Developers that wish to modify the game (and
reprogram through the HID bootloader) are free to do
so.
BATON OPERATION
The baton contains a 3-axis accelerometer with the
axes oriented as shown below (
). The ‘Z’ axis
comes out of the page.
FIGURE 4:
FRONT VIEW BATON WITH 
X, Y, Z AXES INDICATED
ORIENTATION OF X, Y, Z AXES
The game should be started with the dance leader
facing the group of dancers. Each player should have
the baton in their right-hand, slightly in front of them, so
that the LCD display is visible. The dance leader will be
holding the baton so that he/she can see the “back” of
the baton of the followers and vice versa. This scenario
means that dance followers can mirror the movements
of the dance leader, and the data from each axis can be
compared directly, with the exception of the Y-axis,
which will require a sign change. For the dance leader,
the Y-axis comes out of the page, while for the Dance
Followers, the Y-axis goes into the page. In order to
compensate for this, the dance leader will switch the
sign on its Y-axis data prior to transmission.
For instances where the follower is moving in unison
with the group (not mirrored), this can be changed by
commenting the sign change in main.c.
MiApp_WriteData(-DeltaAccel[1]); 
// y (sign change on y-axis data) for 
mirroring "dance leader"