The Vega Edge uses the super-small ATtiny85 microchip running Arduino code. That means that you can reprogram it with whatever behaviour or flashing pattern you want!
You will be making an adaptor cable to connect your Vega Edge to an Arduino board. (What's Arduino?)
This tutorial requires basic Arduino experience and a functioning standard Arduino board (such as the UNO or Duemilanove).
If you've never used an Arduino board, get started at the Arduino website; it's a great resource.
Then, go to Tools > Boards and select:
ATtiny85 @ 1 Mhz (internal oscillator; BOD disabled)
Now you’re ready to programme your Vega Edge!
The programming pinout for the Vega Edge was designed to make it easiest to program with a standard Arduino using an adaptor cable. If you would like to use an existing AVR programmer, we provide the pinouts at the bottom of this page. Here's a photo of our programming cable next to the Edge components and an Arduino (just ignore that it's an Arduino Leonardo which won't work with this tutorial!):
We used some ribbon cable with six wires in it, but you can also use six individual pieces of wire.
The Vega Edge is programmed using the row of six holes in the Edge’s circuit board.
First, insert the 10µF ceramic capacitor into the Arduino between the GND and RESET sockets, the negative side of the capacitor should go to GND.
Then plug the end of the cable with the row of 5 headers into the Arduino sockets GND, 13, 12, 11, 10, and the lone little male header pin goes into the 5V socket on the Arduino.
Place the other end of the cable with the strip of 6 male headers into the row of 6 holes on the Vega Edge board. You will not be soldering them in place—you will be making a temporary connection while uploading your code.
Pay close attention to the placement of Pin 1, which is identified by the square solder pad on the Vega Edge, and your other-coloured wire, and connects to 5V on the Arduino. Do not put this in the wrong way! Your battery will get hot and bad things will happen.
To make a good connection between the male headers and the holes on the Vega Edge you will need to tilt the headers within the holes so that they are all simultaneously and firmly touching the metal in the holes and hold them there with your fingers while programming.
Here's a diagram of what connects to what:
And here's a photo of how you should hold the cable into the Edge board:
Download our Vega Code, unzip it, and open Vega40.ino in the Arduino software.
While holding the adaptor cable firmly with your hand in the Edge circuit board, upload your code to the Vega Edge like any other Arduino sketch.
This can sometimes be finicky and may take several tries before you get an “upload successful” message. Hold the pins firmly in the holes. If you get uploading problems, wiggle the pins in the holes and try again. Sometimes this can be tricky, but you’ll get the hang of it!
You’ve successfully reprogrammed the Vega Edge! Yay! Take a look at our code to get an idea of how the Edge is set up—modify it or start from scratch. Take a look at our programming suggestions below.
In our code, every press or release of the button will cycle to a new program state. Because there’s one button controlling the whole thing, the Vega Edge never really turns “off”—its “off” state is actually putting the little guy to sleep. We’ve taken lots of precautions to save every little drop of power we can in sleep mode. If your code doesn’t ever put the Vega Edge to sleep by calling the goToSleep() function then you will run out of power sooner than you think. This isn't the end of the world, but be aware!
We use a double-click to turn the device on. In our user testing, a single click to turn on meant that the Vega Edge kept turning itself on accidentally while in a pocket or purse, secretly draining the battery. You can get rid of the double click, but do so at your power-wasting peril!
The two flashing patterns use different structures, showing the different ways that you can think about creating flashing patterns, seen in the fadePatterns sketch tab. flash_type 1 uses logic to modify variables, flash_type 2 walks through a 256-step sequence of LED brightness values.
When using something like flash_type 1 remember that the ATtiny is much slower than what you may be used to with an Arduino, and timing in your flashing patterns might not be what you expect. Experiment! When using something like flash_type 2 remember that the ATtiny has very little memory space. If you create enormous arrays, or many arrays, you may experience weird behaviour as you try to use more memory than the chip has.
As a bonus, the code you downloaded contains the flashing patterns available in the Kickstarter Sparkle pack as well as other patterns we never implemented!
Pin 2, also known as A3, is actually set up with a voltage divider to measure the voltage of the battery, and potentially warn the user when it's time to recharge. We weren't able to implement this function in time for the launch of the Edge, but the functionality is there in the hardware. Between day jobs and diaper changes we're working on implementing this for the next round of Edges, but if you implement this in your Edge please let us know!
The Gemma looks like a great little device. Unfortunately it was released after the production of the Edge, and so we weren't able to investigate if it could be a basis for the Edge. And last we checked, it only had two dimmable (PWM) outputs, and our Edge design needs three dimmable outputs. But USB programming for the Edge is still on our wish list.
Why did we create our own weird pinout and programming solution rather than the standard 6-pin AVR male headers?
The Vega Edge is a wearable object and those concerns came first. Male headers would have been bulky, the flat headers used in products like the Lilypad Arduino would have take up too much real estate on the board, and the 2x3 AVR layout would have made the pin-insertion unreliable.
We also wanted to allow for as many people to play with it as possible, and many more people have Arduino boards than AVR programmers, so we chose a layout that would make it easiest for those with an Arduino.
Do you have a better solution? We’d love to hear about it!
For those of you with AVR programmers, we figured that if you’re smart enough to have an AVR programmer, you already have the skills to make an adaptor cable to your programmer, and it might look something like this.
If you're thinking things like....“I can show you a better way to save more battery power!”
Then please write to us! We want everyone’s Vega Edge to be the best it can possibly be. Send us all your suggestions!