Digistump Forums

The Digispark => Digispark (Original) Support => Topic started by: msheldon on December 30, 2012, 01:31:54 pm

Title: digital vs. analog pins?
Post by: msheldon on December 30, 2012, 01:31:54 pm
Using the RGB board, I am writing analog values using analogWrite() to pins 0,1,2 in order to do gradual color shifts.

Pins 0 and 1 behave as expected, I get proportional output of the LED on red and green for values between 0 and 255

Pin 2 behaves in a binary way. Values 128 and over turn it on, less than 128, it's off.

Can pin 2 only do digital output?
Title: digital vs. analog pins?
Post by: digistump on December 30, 2012, 01:49:14 pm
Yes - pin 2 is a digital pin - if you flip over the Digispark the pins are labeled with their capabilities - we wanted to allow the RGB shield to be used in conjunction with USB communication so we couldn\'t use pin 4 for the 3rd PWM (analogWrite) - on the bottom of the RGB shiled there are two solder jumpers, if you cut the one with a small trace across it and bridge the other with solder then the Blue will be routed to pin 4 instead and you can use Hardware PWM for all pins. Otherwise see the DigiRGB example for how to do soft PWM for the blue pin.
Title: digital vs. analog pins?
Post by: Bluebie on December 31, 2012, 07:49:53 am
I\'m going to order some Flora Pixels from adafruit soon to play with my digisparks https://www.adafruit.com/products/1060 and some side-glow optic fibres. Adafruit\'s flora pixel library already supports attiny85 and looks like it\'ll work fine. They only require one digital line, and chain with 24 bit colour on each pixel! Seems like a pretty nice little gadget, perfectly suited for the digispark :)
Title: digital vs. analog pins?
Post by: msheldon on December 31, 2012, 11:33:07 pm
Ah, excellent.