User Avatar
Uncategorized

Badge WX: Transmit and Receive

Lifetime
All levels
0 lessons
0 quizzes
1 student

Electronic badges are designed to bring people together, fostering interaction over common interests or a contest. The Badge WX has infrared emitters and detectors specifically for this purpose. The infrared communication library used in this application evolved at DEFCON 22 and DEFCON 24 to become a reliable, buffered, fast (38 KHz), bi-directional protocol. The Communicate Badge IR Comms blocks can be used to send all kinds of data between badges: interests, numbers, and names. The transmission distance is from an inch to three feet, limited by resistor size on the infrared LED to avoid communicating with people beyond your immediate sphere.

Data sent or received using the Badge IR Comm blocks must be formatted as character strings. Decimal numbers can be converted to strings as shown:

IR Transmit and Received code for the Badge WX.

The Infrared Transmit and Receive example code is a simple demonstration requiring two Badge WXs. Load the same code in both badges. Initially, the badges are stopped. Press the touchpad A to make one badge send numbers. Touchpad B configures a badge to receive and display the data. Any button press stops the send or receive loop.

The C library for infrared communication is also buffered; you can retrieve it when you are ready to (and needn’t be waiting at the exact millisecond it comes across).

BlocklyProp Program (opens in new window): http://blockly.parallax.com/blockly/editor/blocklyc.jsp?project=52624

To save space, only the main loop of this program is shown below. Access the entire program from the link above or create the program from the image below.

 

BlocklyProp Program

Full program for IR/Transmit functions on the Badge WX.