SparkFun Roshamglo Badge Kit (SF-KIT-14130) ATtiny84
      SparkFun Roshamglo Badge Kit (SF-KIT-14130) ATtiny84
      SparkFun Roshamglo Badge Kit (SF-KIT-14130) ATtiny84
      SparkFun Roshamglo Badge Kit (SF-KIT-14130) ATtiny84
      SparkFun Roshamglo Badge Kit (SF-KIT-14130) ATtiny84
      SparkFun Roshamglo Badge Kit (SF-KIT-14130) ATtiny84

      SparkFun Roshamglo Badge Kit (SF-KIT-14130) ATtiny84

      SF-KIT-14130
      €17.88

      14.90 € tax excl.

      SparkFun Roshamglo Badge Kit (SF-KIT-14130) ATtiny84

      Quantity :
      OUT OF STOCK

      SparkFun Roshamglo Badge Kit (SF-KIT-14130) ATtiny84

      Description

      The SparkFun Roshamglo is the new and fun way to play Rock-Paper-Scissors with your friends! The board uses the ATtiny84, and has an IR LED and receiver to communicate between badges. To play, simply point the USB connector at your opponents Roshamglo up to 5 feet away and press the 5-way switch to the left for rock, up for paper, and right for scissors. The red/green LED will display a solid red for lose, green for win, or alternate red and green for a tie. Your Roshamglo can also be worn with a lanyard clip to provide you easier access when a battle is about to ensue!

      The Roshamglo Badge comes as an easy to assemble kit that only requires you to solder on six battery clips to the underside of the board and insert three AAA sized alkaline batteries. No other soldering or programming is required! Once you install the clips and batteries you can start playing Rock Paper Scissors with a friend or start hacking your Roshamglo.

      The Roshamglo uses the Micronucleaus bootloader, which allows for programming from the Arduino IDE via the USB connector at the front of the board. We have included two tutorials below to help teach you how to hack your new Roshamglo as well as turn it into a remote to control to turn on and off most styles of televisions!

      Note: If you don't have a scoreboard available to reset the play counter, you can download the firmware here

      Features

      • 8kB of flash memory for our program (~6kB after the bootloader is installed)
      • 512B of SRAM, which stores our variables used in our program
      • 512B of EEPROM
      • 12 IO pins MAX (the Roshamglo breaks out 9 of these pins)
      • 10-bit analog to digital converter which can be used on 8 pins
      • IR LED
      • IR receiver with built in 38kHz demodulator
      • USB programming
      • Programmable red and green LED
      • Power switch
      • 5-way switch for input
      • Reset switch

      Documents

      Hardware Overview

      Note: This is a repeat section from the Roshamglo Hookup Guide, but it could be useful if this is the first place you've visited.

      Roshamglo labels

      The Roshamglo uses the following:

      • ATtiny84
      • IR LED
      • IR receiver with built-in 38kHz demodulator
      • USB programming
      • Programmable red and green LED
      • Power switch
      • 5-way switch for input
      • Reset switch
      • 6 AAA PTH battery clips
      • 3 AAA batteries for power
      The brains behind the Roshamglo is an ATtiny84, a lightweight Arduino-compatible microcontroller. The ATtiny84 comes with the following:
      • 8kB of flash memory for our program (~6kB after the bootloader is installed)
      • 512B of SRAM, which stores our variables used in our program
      • 512B of EEPROM
      • 12 I/O pins MAX (the Roshamglo breaks out 9 of these pins)
      • 10-bit analog-to-digital converter, which can be used on 8 pins

      For details about what each pin is able to do, refer to the table below.

      PinAnalog or DigitalAdditional UsesRoshamglo Uses
      0 Both Analog Reference 5-way switch down
      1 Both -- 5-way switch right
      2 Both -- 5-way switch up
      3 Both -- IR Receiver
      4 Both SCK, SCL 5-way switch left
      5 Both MISO, PWM IR LED
      6 Both MOSI, SDA, PWM 5-way switch center
      7 Both PWM Green LED
      8 Digital PWM Red LED
      Missing from the list are digital pins 9 and 10. The bootloader uses these two pins for USB programming.

      Jumpers and Pins Highlighted

      Each of these pins has been broken out to the edge of the board to make customization easy! If you would like to use any of these pins for something other than what it's currently connected to, we provided jumpers that can easily be cut with a hobby knife. The only pins that do not have a jumper on them are the pins used for the five-way switch. The pins for the switch use the ATtiny's internal pull-up resistors, so as long as the switch is not closed, the pin can be configured in any way you'd like without having to cut traces.

      One Important Feature Missing

      If you hadn't noticed in the pin description, there was no mention of RX or TX pins. This is because, unfortunately, the ATtiny84 doesn't have a hardware UART. The UART is used for serial communication, whether it's for programming or printing messages to the serial window. You might be thinking, "But doesn't the USB connector provide communication between the ATtiny and the computer?" You're right; it does. To keep the bootloader size as small as possible, the bootloader only allows for USB programming. For serial debugging, you'll need a USB cable and a USB-to-Serial adapter, and the SoftwareSerial library to send messages to a computer. You can learn more about serial communication here.

      Install USB Driver

      Roshamglo is emulating USB 1.1 using two of its pins. However, there are no common operating system drivers available that work with this custom USB class. As a result, we will need to install custom drivers in order to communicate with (and send our Arduino programs to) the Roshamglo board. Choose your operating system below and follow the directions to install the driver.

      Note: We did not write the USB firmware nor the driver. We simply modified them to work with Roshamglo. The true geniuses are the fine folks who wrote micronucleus and libusb.

      Windows

      Make sure the Roshamglo board is OFF, hold the Down button (pull the five-way switch toward the SparkFun logo) and insert it into an available USB slot.

      Plug Roshamglo into a USB slot

      Once plugged in, the status LED should begin to quickly flash red in short bursts. This means the badge is in "Bootloader Mode."

      Flashing LED means it's in bootloader mode

      Download the SparkFun ATtiny USB drivers by clicking on the link below.

      Unzip the file. Open the Windows Device Manager, and you should see an Unknown device. Right-click on Unknown device and select Update Driver Software.

      Updating driver for Roshamglo

      In the pop-up window, click Browse my computer for driver software.

      Search for SparkFun USB drivers

      Click Browse... and open the folder that contains the drivers you just unzipped. It will likely be the sparkfun_attiny_usb_driver folder.

      Installing the USB drivers

      Click Next. You may get a warning pop-up that says "Windows can't verify the publisher of this driver software." That's OK. Just click Install the driver software anyway.

      Tell Windows we want to install the driver software anyway

      You should see a notification that the SparkFun ATtiny driver was installed successfully. Close that window, and verify that your Unknown device now shows up as SparkFun ATtiny in the Device Manager.

      Successful installation of the SparkFun ATtiny USB driver

      MacOS

      You'll need to install Homebrew and use it to install libusb. Enter the following commands into a Terminal:

      /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
      brew doctor
      brew install libusb-compat
      

      Linux

      Good news! Linux doesn't require special drivers. However, you will need to do one of the following to be able to program Roshamglo from Arduino:

      1) When you download the Arduino IDE (next section), make sure you run it as rootsudo ./arduino

      Running Arduino as root

      2) Or, you can add some udev rules so that Linux enumerates your device with write permissions. Create a file in rules.d:

      sudo edit /etc/udev/rules.d/49-micronucleus.rules
      

      Copy the following contents into that file:

      # UDEV Rules for Micronucleus boards including the Digispark.
      # This file must be placed at:
      #
      # /etc/udev/rules.d/49-micronucleus.rules    (preferred location)
      #   or
      # /lib/udev/rules.d/49-micronucleus.rules    (req'd on some broken systems)
      #
      # After this file is copied, physically unplug and reconnect the board.
      #
      SUBSYSTEMS=="usb", ATTRS{idVendor}=="16d0", ATTRS{idProduct}=="0753", MODE:="0666"
      KERNEL=="ttyACM*", ATTRS{idVendor}=="16d0", ATTRS{idProduct}=="0753", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1"
      #
      # If you share your linux system with other users, or just don't like the
      # idea of write permission for everybody, you can replace MODE:="0666" with
      # OWNER:="yourusername" to create the device owned by you, or with
      # GROUP:="somegroupname" and mange access using standard unix groups.
      

      Save and exit.

      Adding Arduino Compatibility

      Arduino is not a full-featured development environment, but it does allow us to prototype embedded programs quickly and easily. To begin, navigate to Arduino's software page and download the Arduino IDE for your operating system.

      If you need help installing Arduino for your operating system, you can follow this guide.

      Important! Your Roshamglo board will only work with Arduino versions 1.6.10 and above.

      Download and Install the Board Package

      Because the Roshamglo board is not supported by the Arduino IDE by default, we need to add it manually. Open the Arduino program and go to File > Preferences. Then copy and paste the URL below into the Additional Board Manager URLs text box.

      https://raw.githubusercontent.com/sparkfun/Arduino_Boards/tiny/IDE_Board_Manager/package_sparkfun_index.json
      

      Modifying the additional boards URL in Arduino

      Then hit OK, and navigate to the Tools > Board > Boards Manager… tool. A search for “tiny” should turn up a SparkFun ATtiny Boards result. Select that and click Install.

      Installing the Sparkfun ATtiny Boards definitions

      Once the installation is complete, go to Tools > Board and select Roshamglo (ATtiny84, 3.3V, 8MHz) under the SparkFun ATtiny Boards section.

      Selecting the ATtiny84 under the boards section in Arduino

      The Roshamglo board comes with two LEDs (a red LED and green LED built into one package), as well as a five-way switch (left, right, up, down and center). We can test that our Roshamglo board can be reprogrammed by writing and uploading a simple program.

      Open the Arduino IDE and enter the following code:

      void setup() {
        pinMode(7, OUTPUT);
      }
      
      void loop() {
        digitalWrite(7, HIGH);
        delay(500);
        digitalWrite(7, LOW);
        delay(500);
      }
      

      Click on the Upload button.

      alt text

      If you are asked to save your work, click Cancel (save it if you want, but you don't need to save to compile and upload your code).

      Wait until you see Uploading appear in the Arduino IDE.

      alt text

      Make sure the Roshamglo board is OFF, hold the Down button (pull the five-way switch toward the SparkFun logo) and insert it into an available USB port while continuing to hold the Down button.

      Plug Roshamglo into a USB slot

      Let go of the Down button, and the status LED should begin to quickly flash red in short bursts. This means the badge is in "Bootloader Mode." You will need to do this every time you upload a new program to it.

      Flashing LED means it's in bootloader mode

      After a moment, you should see Done uploading appear in Arduino.

      alt text

      Remove the Roshamglo board from your computer. Slide the power switch to ON.

      Turn on Roshamglo

      And that's it! Your Arduino should begin flashing the green LED on and off every second.

      Roshamglo blinking

      Note: If you get an error message while uploading, it could be caused by a variety of reasons. The way we're uploading programs to Roshamglo is actually hacked together, as we're emulating USB on the badge, which many computers do not like. Here are some things to try if you do get an error:
      • Try a different USB port
      • Unplug other USB devices
      • Close other programs that might be running
      • Reinstall the Roshamglo USB driver
      • Try a different computer

      Resources and Going Further

      Being able to make something blink is an important first step. You can now reprogram your Roshamglo to perform a wide variety of tasks, like blinking in different patterns, controlling the blink with the control stick, etc.

      But wait, there's more! The board comes equipped with an infrared (IR) transmitter and IR receiver. That means you could control TVs (with the right IR codes) or set up a simple "laser tag" game to play with your friends.

      For more information, such as the Roshamglo source code, check out these resources:

      SparkFun
      SF-KIT-14130

      Specific References

      SparkFun Roshamglo Badge Kit (SF-KIT-14130) ATtiny84

      SparkFun Roshamglo Badge Kit (SF-KIT-14130) ATtiny84

      €17.88

      14.90 € tax excl.