TUTO : Add a Button to your Tag

VR Tracker Tags come with a GPIO port. What for ? Mostly so you can plug in buttons, triggers, sensors and other devices, and directly use VR Tracker ecosystem to create a tracked controller, weapon for a lasertag, and many other applications that you must be already thinking about.

In this tutorial we will simply add a button to the Tag, and see how we can retrieve the information.

1. Get the components

To add a switch you only need 3 components :

  • A switch (that one seemed obvious right ?…)
    00097-03-L
  • A 10k‎Ω resistor
    resistor
  • Wire (jumper cables)
    FGFQB07HX7P7I3J.MEDIUM

2. Connect everything together

Here is how to wire everything up. The circuit is pretty simple, it’s just a switch with a pull down resistor.

Button_bb2               Button_schéma2

 

Tag Button 2               Tag Button 1

 

3. Get the Data

To retrieve the data, you can check the API : a User can receive “special commands”. Button press are part of those special command. In the current software revision (tag version 0.8, from the 05/01/2017), when the button is pressed, the Users connected to the Tag will receive a special command with the data “triggeron”, and when it is release “triggeroff”.

 

RECEIVE Tag X Special Command

“cmd=specialcmd&uid=TAG_ID&data=myspecialdata”
uid : String (Tag ID)
data : String
Those are special commands that can be defined by the user in the Tag software. This is used when the Tag has been modified into a controller (see below).

You will receive :

On press

cmd=specialcmd&uid=TAG_ID&data=triggeron

On release

cmd=specialcmd&uid=TAG_ID&data=triggeroff

 

Have fun !

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>