RLX COMPONENTS s.r.o. , Electronic Components Distributor.
SparkFun Roshamglo Badge Kit (SF-KIT-14130) ATtiny84
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.
For details about what each pin is able to do, refer to the table below.
Pin | Analog or Digital | Additional Uses | Roshamglo 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 |
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.
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.
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.
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.
Once plugged in, the status LED should begin to quickly flash red in short bursts. This means the badge is 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.
In the pop-up window, click Browse my computer for driver software.
Click Browse... and open the folder that contains the drivers you just unzipped. It will likely be the sparkfun_attiny_usb_driver folder.
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.
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.
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
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 root: sudo ./arduino
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.
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.
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
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.
Once the installation is complete, go to Tools > Board and select Roshamglo (ATtiny84, 3.3V, 8MHz) under the SparkFun ATtiny Boards section.
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.
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.
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.
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.
After a moment, you should see Done uploading appear in Arduino.
Remove the Roshamglo board from your computer. Slide the power switch to ON.
And that's it! Your Arduino should begin flashing the green LED on and off every second.
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:
14.90 € bez DPH
check_circle
check_circle