At the heart of the TinySaber is an 8-bit ATtiny841 microcontroller. Motion detection is acquired via the BMA250 accelerometer, the same sensor chip found on our Accelerometer TinyShield. The rectangles on the back of the TinySaber are simple copper fills that are used as capacitive touch sensors, allowing the TinySaber to sense where the user places their finger on the back of the board. Power is provided by the Li-ion battery, which can be charged through the micro-USB port.
Thanks to a special bootloader, the microcontroller on the TinySaber only needs a micro-USB cable to communicate with your computer. This bootloader comes pre-installed with the default version of the TinySaber code.
Configuring the Arduino Software IDE
- Download and install the latest Arduino Software (IDE) from the Arduino website. (On Windows, click Yes/Install when it asks ‘Do you want to install this device driver/software.' You can also select the check box ‘Always trust Arduino.’)
- Open the Arduino IDE and go to File > Preferences (Windows) or Arduino > Preferences (Mac OSX).
- Copy and paste this URL into the box that says “Additional Boards Manager URLs” and click OK: http://files.tinycircuits.com/ArduinoBoards/package_tinycircuits_index.json
- Go to Tools > Board > Boards Manager.
- Search TinyCircuits AVR Boards. Click Install. This will likely take a few minutes. There may be an error stating "Warning - Non-trusted Contribution." You can safely ignore this warning.
Download the Driver (Windows)
If you're using a Windows system, the next step will be to download the Zadig Driver here: http://zadig.akeo.ie/ and install it. If you're using an iOS system, you can skip this step.
Once downloaded, install and open the Application. Once the application opens, select libusb-win32 (v22.214.171.124) by using the arrows to the right of the driver name. (You can find more information about libusb here: http://libusb.info/)
Plug the TinySaber into your computer via a micro-USB cable. Be sure to use a quality USB cable for this. Some low cost cables only transmit power, and we need to transmit signal data as well for our purposes. If you've already assembled your TinySaber, you'll need to remove the top acrylic piece to complete the following step. Before clicking on the "Install WCID Driver" button, you'll need to reset the microcontroller on the TinySaber. Do this by pressing the small pushbutton (located just below the 'S' in TinySaber on the Reviion 3, or R3, circuit board).
Rev1/Rev2 TinySaber Reset
If you have a R2 board, you can reset the microcontroller by shorting together the Reset pin and the Ground pin, as circled on the image below. This can be accomplished with any conductive metal tool such as a pair of tweezers or a small flat head screwdriver. To create the short, press both pins at the same time with your chosen tool.
Once the microcontroller has been reset, you'll see an "Unknown Device" selected in the device drop down menu. You have only six seconds to click on "Install WCID Driver" before the bootloader becomes inactive. (This may take a few attempts.) After the driver installs, you'll get a message stating that the driver has been installed successfully.
To ensure that the driver has actually been installed successfully, you'll need to open your computer's Device Manager, then, reset the TinySaber device again. You should see an Unknown Device #1 listed under libusb32. This will confirm that the driver has installed successfully. You will have six seconds to view the device before it is no longer visible in the device manager.
If the device appears as Unknown Device under a different category, then the driver may not have been installed correctly.
If the device is not shown, try resetting the device again or waiting a few seconds for the computer to find the device. Once the driver is installed and working, new code can be uploaded through the Arduino IDE. You will not need to repeat the driver install or configuration steps again.
The Arduino IDE
To avoid compatibility problems, ensure that you have the most recent version of the Arduino IDE installed. (At the publishing of this article, it is version 1.8.3.) Open the IDE and go to Tools > Board. For both revision 2 and revision 3 TinySaber boards, select "TinySaber Rev2" under "TinyCircuits AVR Boards." LTO should be "Disabled" and nothing should be selected under Port. The Programmer option may be set to "Arduino as ISP," but is not used in the upload process.
With yout Tools selections configured, you can now write your own code for the TinySaber in the Arduino IDE! To get started, we recommend using our example code linked at the bottom of this page. You can change the displayed text, lighting effects, color mixes, and sensor sensitivity for the accelerometer or capacitive touch pads.
Now that your code is written, you can reprogram the TinySaber. Once you click the Upload button, the code will compile,and the Arduino IDE will prompt you to connect your device. Additionally, TinySaber must also be reset by pressing the reset button. When uploading more than once, TinySaber can be left plugged in and only the reset button pressed to initiate an upload.
Extract the TinySaber sketch folder to a location of your choice. Open the folder and open TinySaber.ino in the Arduino IDE. To ensure everything is operating correctly before editing code, use the process detailed above to upload the example code to your TinySaber. This upload should complete successfully.