Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

How to Use SparkFun_Roshamglo: Examples, Pinouts, and Specs

Image of SparkFun_RoshamgloDesign with SparkFun_Roshamglo in Cirkit Designer

Introduction

The SparkFun Roshamglo is an interactive badge that lets you play rock-paper-scissors, the classic hand game, with a modern twist. It is equipped with an ATtiny84 microcontroller, an LED matrix for displaying game symbols, and push buttons for player input. This badge is not only a fun gadget but also serves as a development platform compatible with the Arduino programming environment, making it a versatile tool for learning and prototyping.

Explore Projects Built with SparkFun_Roshamglo

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of Arduino Uno Wi-Fi Controlled Rover with Ultrasonic and PIR Sensors: A project utilizing SparkFun_Roshamglo in a practical application
Arduino Uno Wi-Fi Controlled Rover with Ultrasonic and PIR Sensors

This circuit is a Wi-Fi controlled rover with obstacle detection and motion sensing capabilities. It uses an Arduino Uno to interface with an HC-SR04 ultrasonic sensor for distance measurement, a PIR sensor for motion detection, a micro servo for camera panning, and an L298N motor driver for controlling the rover's motors. The ESP8266 Wi-Fi module allows remote control via a web interface.

Open Project in Cirkit Designer

Common Applications and Use Cases

Technical Specifications

Key Technical Details

Pin Configuration and Descriptions

Pin Number Function Description
1 VCC Power supply (3V)
2 GND Ground
3-10 PB0-PB7 Digital I/O, multiplexed with LED matrix
11 Reset/UPDI Reset pin or UPDI for programming
12 PA0 Analog input or digital I/O
13 PA1 Analog input or digital I/O, button input
14 PA2 Analog input or digital I/O, button input

Usage Instructions

How to Use the Component in a Circuit

  1. Powering the Device: Insert a CR2032 coin cell battery into the battery holder.
  2. Programming: Connect a UPDI programmer to the Reset/UPDI pin to upload your code.
  3. Playing the Game: Use the push buttons to select rock, paper, or scissors.

Important Considerations and Best Practices

Troubleshooting and FAQs

Common Issues

Solutions and Tips for Troubleshooting

FAQs

Q: How do I program the Roshamglo? A: Use a UPDI programmer and the Arduino IDE with the appropriate board package installed.

Q: Can I modify the game code? A: Yes, the Roshamglo is open for code customization. You can write your own game logic or other applications.

Q: Is the Roshamglo reprogrammable? A: Absolutely, you can reprogram it as many times as you like using the UPDI interface.

Example Code for Arduino UNO

Below is an example code snippet for initializing the LED matrix on the SparkFun Roshamglo. This code is intended for illustrative purposes and assumes you have set up the appropriate board definitions for the ATtiny84 in the Arduino IDE.

#include <avr/power.h>
#include <avr/sleep.h>

// Define the LED matrix and button pins
const int ledPins[] = {3, 4, 5, 6, 7, 8, 9, 10};
const int buttonPins[] = {13, 14};

void setup() {
  // Initialize the LED pins as outputs
  for (int i = 0; i < 8; i++) {
    pinMode(ledPins[i], OUTPUT);
  }

  // Initialize the button pins as inputs with pull-up resistors
  for (int i = 0; i < 2; i++) {
    pinMode(buttonPins[i], INPUT_PULLUP);
  }
}

void loop() {
  // Example code to light up the LED matrix in some pattern
  for (int i = 0; i < 8; i++) {
    digitalWrite(ledPins[i], HIGH); // Turn on each LED
    delay(100);                     // Wait for 100 milliseconds
    digitalWrite(ledPins[i], LOW);  // Turn off each LED
  }
}

Remember to keep the code comments concise and within the 80 character line length limit. This example demonstrates basic initialization and control of the LED matrix and buttons on the Roshamglo badge.