Jennifer got a groupon for us to go try K1 Speed Indoor Go Kart Racing in Santa Clara. Turns out it's a stone's throw from where Speedring used to be before it closed.
What's special about this place is that all the karts are electric.
So, what I thought about the place:
unfortunately, they use lead acid batteries, so they don't have the power to weight ratio I was hoping for. They were fast enough, but not as fast as other indoors gas karts I've driven.
the lack of noise is actually not bad, and the lack of fumes is good :)
they have 3 rows of cars and 2 charge while the 3rd one is used. That's not so bad.
the track layout is a bit basic (easy-ish), but eh, it's still fun enough to drive.
the kart max speed is remotely controlled. This is used to force you to do a slow lap and come back in slowly or stop everyone to walking pace if there was an accident. It's a bit spooky but I guess that makes sense.
karts have a reverse gear, that's cool since they help you get out of a tight spot without external help.
All in all it was different but still fun :)
Jennifer is still lacking a bit of the aggressive spirit necessary to push people around who are blocking you, and making a spot where there isn't one, but her fastest clean lap wasn't that much slower than mine. She did well :)
TL;DR: Get code here: https://github.com/marcmerlin/aiko_pebble_v2
Note, you will need the LiquidCrystal_SR_LCD3 driver from the NewLiquidCrytal Library.
You will also need the Aiko Library: https://github.com/geekscape/aiko_arduino .
Pebble v2 requires at least the IDE 0.23 (untested) but 1.0 or better is recommended. The code is of course arduino 1.0 compatible.
At the LCA 2012 Arduino Miniconf, we got to build a new toy, a Freetronics Pebble v2 (schematics here). This was a refresh of the Pebble V1 (schematics here) which was the target of the very first arduino miniconf I missed in 2010.
This new Pebble had even more hardware to program against and was a much more compact design due to the use of a bunch of SMT parts (actually there are 2 arduinos on the board, one is dedicated to usb/serial communications, removing the need for an ftdi chip).
Like good hacking projects and conferences, the design and software were improved until the last minute, and Andy worked all night before the conf to get us his demo code (along with bits from Luke and others).
Andy wrote the very cool aiko event handler for arduino. You give it a list of callback functions and it'll do its best to call them on the interval you gave it (interval in milliseconds). For arduino folks, with Aiko, code looks like this:
void setup(void) {
Serial.begin(DEFAULT_BAUD_RATE);
// Call LCD init early so that others can write to it.
lcdInitialize();
Events.addHandler(clockHandler, 1000);
Events.addHandler(lightHandler, 1000); // Aim for 250 ms
Events.addHandler(rotaryEncoderHandler, 100);
Events.addHandler(serialHandler, 30); // Sufficient for 38,400 baud
Events.addHandler(temperatureHandler, 1000); // Aim for 250 ms
Events.addHandler(touchPanelHandler, 250); // Aim for 50 ms
Events.addHandler(rgbLedFadeHandler, 10); // Can run slower.
// Call LCD last so that it can display variables that just changed.
Events.addHandler(lcdHandler, 1000); // Aim for 100 ms
}
void loop(void) {
Events.loop();
}
So Andy got us working code to test our hardware, but of course it wasn't fully optimized (hell, code never is). So, that gave me a chance to do some arduino programming to see what could be improved. It was a good learning experience.
After a bunch of work, here is what I was able to do:
I happened to have RGB LED demo code I had taken a while to write over Xmas (nice transitions that I went through the trouble of writing so they would work with an Aiko event handler), so I did a bit more hacking to refine the code and plugged it in.
The rotary button was being polled every millisecond to catch which was it was turning. First I figured that every 5ms was probably enough, but thanks to sample code from Brett Downing, I was able to write a handler using hardware interrupts on input pin state changes (something I knew nothing about, so it was a good learning experience).
Then this brings us to the LCD handler. I had some grand view of writing a popup menu that would let you configure the code at runtime, but that meant a lot of LCD code. I knew arduino had a nice LiquidCrystal library, but it did not work with the shift register setup in the Pebbles. Long story short, I wrote a plugin for the Pebble/LCD3Wires shift register setup in the Pebble. This demo requires this new library (LiquidCrystal_SR_LCD3) to do its work.
The 4th line shows the color that the RGB LED is changing towards
LED 6 means that the color change delay factor is 6 (lower means faster color changing)
3 in LED 6/3 is by how much the color brightness is reduced (clips the color values so that they arne't too bright, mostly useful in dark rooms or when taking pictures).
LCD 80 is the analog PWM value for the LCD backlight (higher is brighter).
A few custom characters are displayed to show use of the custom character support brought by LiquidCrystal_SR_LCD3
TL;DR: Get code here.
All the code is arduino 1.0 compatible
After coming back from the Arduino Miniconf at Linux.conf.au, I ended up with a freshly soldered freetronics pebble v2.
Like the Pebble V1 (schematics here), it uses MC14094 8 bit shift register to drive the LCD using only 3 wires instead of 6 or more.
The Pebble designers thankfully used the same shift register wiring than shown on the LCD3wire page on arduino playground. However, the code that came with it only had limited functionality for talking to the LCD, and the code on the LCD3wires page is also limited in functionality (on top of being incompatible with arduino 1.0).
So, I ended up finding Francisco Malpartida's cool work on virtualizing the stock arduino LiquidCrystal library (very featureful and optimized timings). In turn, Ragnar used that codebase to design his own shift register library for 2 or 3 wires.
Ragnar's wiring and code is somewhat complex because it exploits some interesting hacks:
it is designed to work with cheaper non latching shift registers.
it can be made to work with just 2 wires instead of 3 for non latching shift registers.
because of the design, the code is less obvious and exploits some tricks, but it sure works :)
his code can work for latching shift registers, but I do not recommend using the more complicated wiring and code if you can afford 3 wires and a shift register. Just use the LCD3Wires wiring and the code from this page.
In other words, if you have a non latching shift register, use his code and wiring. If you have a latching shift register, you should use the code from this page and the more widespread LCD3Wires wiring.
So, where does this bring us?
I used Malpartida and Ragnar's work to make an LCD3Wire hardware driver for the NewLiquidCrystal Library. This brings full library support to the pebbles as well as other folks who use the reference wiring from LCD3wires.
I called the new library NewLiquidCrystal in the hopes that it will become the new de facto library in standard arduino one day. My code is here: https://github.com/marcmerlin/NewLiquidCrystal and includes the new LiquidCrystal_SR_LCD3 driver I wrote. To be clear, all the code came from Francisco Malpartida's work, I built on top of it to write my LiquidCrystal_SR_LCD3.cpp driver for LCD3Wires compatible hardware.
I also wrote an extended LiquidCrystal Demo which should work on all liquidcrystal supported devices (baring the character count).
Here is a demo of my popup menu code that works with a rotary button (cursor showing what is currently selected if you click on it)
I'm now working with Francisco to get my code included in his tree, and if we're lucky that code may eventually get included in the standard arduino libraries as a faster and more flexible LiquidCrystal replacement.
On my flight back from Paris, we had an interesting flight path that was just at the edge of the sun coverage of the earth. As a result we skirted the line of sunrise for about 30mn over very northern canada, and it yielded some great pictures, even if they were a bit hard to catch through a plane window:
We happened to be around when they had a Video Games expo. We only had 45mn to go through it before it closed, but it was quite cool to see so many vintage games I used to play with way back in the day. Great trip in nostalgia land :)
ok, doesn't get older than that :)
I remember playing this
Looks like Jennifer may have played this one before :)
Arkanoid, I was good at this!
Out Run, that used to be the game I thought was so cool and pretty back then