You are previewing Getting Started with Adafruit Trinket.
O'Reilly logo
Getting Started with Adafruit Trinket

Book Description

Arduino's ubiquity and simplicity has led to a gigantic surge in the use of microcontrollers to build programmable electronics project. Despite the low cost of Arduino, you're still committing about $30 worth of hardware every time you build a project that has an Arduino inside. This is where Adafruit's Trinket comes in. Arduino-compatible, one-third the price, and low-power, the Trinket lets you make inexpensive and powerful programmable electronic projects. Written by one of the authors of Adafruit's Trinket documentation, Getting Started with Trinket gets you up and running quickly with this board, and gives you some great projects to inspire your own creations.

Table of Contents

  1. Foreword
  2. Preface
    1. Who This Book Is For
    2. Recommended Reading
    3. What You Will Want to Have on Hand
    4. Conventions Used in This Book
    5. Using Code Examples
    6. Safari® Books Online
    7. How to Contact Us
    8. Acknowledgments
  3. 1. Introducing Trinket
    1. Trinket Versus Arduino Uno
    2. Using Trinket
    3. The ATtiny85 Microcontroller
    4. Memory
    5. Connectivity
    6. Three Volts or Five Volts?
    7. The Adafruit Gemma
  4. 2. Software Installation
    1. Supported Operating Systems
    2. The Preconfigured Arduino IDE from Adafruit
    3. Modifying the Standard Arduino IDE
    4. The USBtinyISP Driver for Windows
    5. Seeing the Trinket in Windows
    6. Windows Driver Troubleshooting
    7. Linux
    8. Conclusion
  5. 3. Connection and Programming
    1. Preparing the Trinket
    2. Connecting Trinket to Your Computer
    3. Loading a Program
    4. The Trinket Data Pins
      1. Digital Pins
      2. Analog Pins
    5. Exploring Data Pins
      1. Parts List
      2. Connections
    6. Not All Pins Are the Same
    7. Different Ways to Power Trinket
    8. Analog and Digital Sensors
    9. Trinket Theremin
      1. Parts List
      2. Wiring
      3. Code
      4. Use
    10. Sound and Music
    11. Conclusion
  6. 4. Libraries and Optimization
    1. Arduino Libraries
    2. ATtiny-Optimized Libraries
    3. Installing Libraries
      1. Where to Install Libraries
      2. Installing a Library in Windows
      3. Installing a Library in OS X
      4. Using Libraries
    4. Library Issues and Limitations
    5. Memory Optimizations
      1. Program Space Optimization
      2. Variable Optimization
    6. Conclusion
  7. 5. Intermediate Projects
    1. Controlling Smart LEDs: NeoPixels
      1. Important Things to Know About NeoPixels
      2. NeoPixel Packaging
    2. NeoPixel Ornaments
      1. Parts List
      2. Build
    3. LED Color Organ
      1. How It Works
      2. Parts List
      3. Build
      4. Adjustments
      5. Mounting
    4. Kaleidoscope Goggles
      1. Parts List
      2. Tools
      3. Battery Selection
      4. Wiring
      5. Software
      6. Final Assembly and Use
      7. Safety and Common Sense
    5. Servos
      1. Inside a Servo
    6. Trinket Servo Control
      1. Parts List
      2. Wiring
      3. Code
      4. Use
      5. Going Further
    7. Using I<sup xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops">2</sup>C&#8212;The Two-Wire InterfaceC—The Two-Wire Interface
      1. I<sup xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops">2</sup>C SoftwareC Software
      2. Using I<sup xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops">2</sup>C DisplaysC Displays
    8. Temperature and Humidity Sensing
      1. Parts List
      2. Libraries
      3. The LCD Display
      4. Testing the Display
      5. Adjustment
      6. Sensing
      7. Code
      8. How It Works
      9. Troubleshooting
      10. Going Further
    9. Ultrasonic Rangefinding
      1. Parts List
      2. Build
      3. Libraries
      4. Code
      5. How It Works
      6. Troubleshooting
    10. Communicating via Serial
      1. Talking Serial
      2. Exploring Serial Use
      3. Parts List
      4. Code
      5. Use
      6. Going Further
      7. Pulse Width Modulation
    11. The Analog Meter Clock
      1. Circuit Design
      2. Parts List
      3. Build
      4. Meters
      5. Libraries
      6. Code
      7. How It Works
      8. Preparing Your Meters
      9. Meter Mounting
    12. Conclusion
  8. 6. Advanced Projects
    1. Trinket Jewelry
      1. Parts List
      2. Choices
      3. Tools
      4. Wiring
      5. Libraries
      6. Code
      7. Animation
      8. Compile
      9. Changing the Animation
      10. Finishing the Jewelry
    2. Program Memory for Data
    3. Trinket Occupancy Display
      1. Parts List
      2. Tools
      3. Wiring
      4. Libraries
      5. Code
      6. Enclosure and Board
      7. Box Connections
      8. Adjustment
      9. Room Placement
      10. Going Further
    4. Trinket Alarm System
      1. Parts List
      2. Tools
      3. Theory
      4. Multiple Sensors, One Pin
      5. Project Design
      6. Annunciation Selections
      7. Build
      8. Populating the Board
      9. Code
      10. Final Assembly
      11. Test
      12. Troubleshooting
      13. Going Further
    5. Bluetooth Communication
    6. Trinket Toy Animal
      1. Choosing Your Animal
      2. Parts List
      3. Tools
      4. Circuit
      5. Circuit Variations
      6. Code
      7. Preparing the Toy
      8. Use
    7. Trinket Rover Robot
      1. Parts List
      2. Tools
      3. 3D Printing
      4. Build
      5. Wiring
      6. Code
      7. Going Further
    8. SPI Communications
    9. Trinket Audio Player
      1. Parts List
      2. Tools
      3. Software
      4. Loading Sounds
      5. Chip Loading Circuit
      6. Transferring Audio
      7. Sound Playback
      8. Use
    10. Conclusion
  9. 7. Going Further with Trinket
    1. Microcontrollers: Smaller Versus Larger
    2. The Trinket Bootloader
      1. The Bootloader Design
      2. Bootloader Code
    3. Programming Your Own ATtiny85
      1. Programming Bare ATtiny85 Chips
      2. Other AVR Programming Methods
    4. Community Resources
      1. Learning Arduino
      2. Commercial Resources
      3. Technical Resources
      4. Third-Party Sites
      5. Social Media Resources
  10. 8. Troubleshooting
    1. Your USB Cable
    2. Connectivity Issues
    3. Arduino IDE Issues
      1. Mac
    4. Common Library Problems
    5. Error Messages
      1. Compilation Issues
      2. Upload Errors
      3. The Serial Monitor
    6. Usage Issues
    7. Manufacturer Support
  11. A. Making Electronic Sounds
  12. B. Parts Sourcing
    1. Trinket
    2. Displays
    3. Sensors
    4. Resistors
    5. Nuts and Bolts
    6. Kits
  13. C. Publications
    1. ATtiny85
    2. Books
    3. Additional Resources
  14. Index