ATtiny Hacks: ATtiny45/85 servo library

ATtiny Hacks Theme Banner

Servo8bit is a library for AVR microcontrollers that allows you to drive servo motors without the need for a 16-bit timer. Obviously, this is quite useful for smaller chips that only have 8-bit timers and it is specifically targeted at the ATtiny45 and ATtiny85 microcontrollers. The library offers 256 steps of resolution, and can drive up to five servos at one time. Servo control pulses can be generated between 512 and 2560 microseconds and if you don’t mind increasing the time between these pulses [Liya] says it would be possible to increase the 5-servo limit.

The library is quite easy to use, but in its current state it would take just a bit of work to port to another device. It’s been written for an 8 Mhz clock signal with PortB used to drive the motors. Using find-and-replace to change the PORTB keywords to use a DEFINE variable should be easy enough, but we don’t know how hard it would be to change the clock frequency.

We wonder if it’s possible to make this a slave device, perhaps implementing a 1-wire protocol?

Demystifying PID Control with a look at the new Arduino PID library

We’ve been hiding away in air-conditioned comfort to wait out the hot weather afflicting most of the US right now. Luckily we’re keeping busy with the great links coming into our tips box.

[Brett] sent us a note about his work on the new Arduino PID library. He is the author of the original library and recently decided it was time for a ground-up rewrite. But along the way he took the time to explain PID control and the choices he made during development.

We see a lot of PID controllers around here, like this router based espresso machine add-on. Proportional-Integral-Derivative Controllers are a way to make sure the control you intended to get from your devices is actually achieved in practice. They monitor a process and accumulate results over time in order to account for future events. From what we’ve just described you can see why the subject needs to be demystified.

Get yourself elbow-deep into [Brett's] article. He does a great job of discussing each issue, and uses a multitude of easily understandable graphs to show the hurdles each portion of code is meant to overcome.

Library makes Arduino to Arduino serial communications dead simple

easytransfer_serial_arduino_communications_library

When [Bill Porter] works on a project, he says that he typically writes his own NMEA standard communications protocols to fit the job at hand. While it makes things easy to troubleshoot, he admits that his custom protocols are wasteful of both processor time and bandwidth. Binary communications on the other hand are more efficient, but a bit trickier to manage.

To make things easy for the common user, he wrote a library called EasyTransfer which abstracts packetized serial communications between two Arduino boards. The process is pretty simple – all one has to do is define a data structure on both Arduino boards so that they know what sort of data is coming over the wire, and EasyTransfer handles the rest. This allows users to worry less about communications protocols or transmission errors, and focus on their projects instead.

If you’re working on a project and searching for an easy way to get a pair of Arduinos talking, swing by his site and grab the library. It doesn’t get much easier.

ROS turns three

Turtles!

Since its first debut three years ago, ROS has been gaining some popularity with the robotics folks.  It’s behind the scenes of those impressive quadcopters you may remember from a while back.  ROS helps abstract the lower level functions of a robot by supplying lots of code for commonly used components (wiimote for example). Being an “operating system”  it comes with lots of nice features you would expect, like a package manager.  It’s open source and many of their projects are well documented making it easy get started.

Check out the video after the break to see it in action [Read more...]

Python library for Emotiv EEG

Want to control things with your mind? The Emotiv EPOCH EEG is one of the best pieces of hardware you can get that is ready to be hacked into your project. Too bad the entry-level SDK will set you back $500. Or you can take advantage of [Cody Brocious'] work by using his Emotiv Python Library. He sniffed around the data coming in over the USB connection and discovered that it’s encrypted. With a bit of trickery he extracted the key and built the 128-aes decryption routine into his package. So far this just pulls raw data from the unit so it’s up to you to figure out how to properly filter the signals and differentiate which sensor corresponds to each data stream. But it’s a start, and hopefully it’ll lead to more mind controlled doo-dads.

Update: Adafruit Eagle library, now with Arduino

Adafruit Industries has just added an Arduino shield footprint to their EagleCAD library. If you don’t know, the Arduino headers use non-standard pin spacing. Learn to deal with it, there’s too many Arduino shields in production to have any hope for a change in the future. This footprint should make it a lot easier to design your own boards. If you use this package make sure you’re getting the library from their github, they’ve been adding parts regularly. Setting up version control will make sure you always have the latest libraries.

[Thanks pt]

Adafruit Eagle library

We love it when a PCB comes out right the first time. We’re careful enough with our designs that if something is wrong it’s usually a footprint problem, like we picked the wrong package for the components. Adafruit is helping to make the design process easier by sharing their Eagle library. Like the Eagle library version control we saw earlier in the month, this library is housed on github making it easy to stay up-to-date. The library includes many components (switches, crystals, IC’s, etc.), and fixes some prolbem-footprints, like 0805 surface mount pads.

Follow

Get every new post delivered to your Inbox.

Join 92,158 other followers