quixotic project blog

Archive for the ‘Arduino’ Category

Arduino/Meggy Jr Upload Error

without comments

If you are using Meggy Jr with the Serial-to-USB Cable provided in the Evil Mad Scientist shop you might encounter the following error:

avrdude: stk500_getsync(): not in sync: resp=0×00
avrdude: stk500_disable(): protocol error, expect=0×14, resp=0×51

The error manifest while uploading a new sketch to Meggy. If you pull out the USB cable and plug it in again you can upload a sketch successful. But on the next time you try you’ll get the error again. Luckily there is a pretty simple solution. I found it while digging through the Evil Mad Scientist Forums. It involves setting the “Set RTS on close” flag of the COM Port. You can do this in the Device Manager. Find the COM Port that was installed when you first plugged in the USB-to-Serial cable. For me it’s COM3. In the connection settings click on details and mark the flag selected. That’s it. I tried this on Windows XP with Service Pack 3, but it should work similiarily on other Windows versions.

RTS Flag

RTS Flag

Written by michi

April 7th, 2009 at 9:32 pm

Erstes Meggy Jr Programm

without comments

Today I finished my first Meggy Jr program. The programming with the Arduino IDE was easy as expected. I wrote a simple Color Chooser application that let’s the user explore the variety of colors available on Meggy Jr.  Meggy Jr’s <em>Simple Library</em> only knows 16 predefined colors. It is possible though to define more colors with the Method EditColor(byte color, byte r, byte g, byte b) in which you simply specify the amount of red, green and blue you want in your final color. Each component takes a byte as input and therefore Meggy can display 4096 different colors, theoretically. In practice you will find that even small values for the blue component will make the resulting color blue.

In my last blog entry I mentioned that it is possibly to write data to the pc via a serial connection. The Color Chooser makes use of this feature and writes back the current color and its components to the pc so you can use the values in another project.

I made a video of the running application. The quality sucks, but you’ll get the idea:

During the programming I used the Meggy Jr Programming Guide, a pretty helpful document. You can get it at the Evil Mad Scientist Laboratories.

The sourcecode of this application is available as download.

Written by michi

April 5th, 2009 at 6:34 pm

Posted in Arduino, Development

Tagged with , , ,

Meggy Jr RGB

with one comment

Ich weiss garnicht mehr genau wann und wo ich Meggy Jr RGB zum ersten mal gesehen habe, aber mir war sofort klar, dass ich so ein Ding brauche! Meggy ist eine do-it-yourself Spielekonsole. Das bedeutet, dass man es selbst zusammenbaut und optional auch selbst Programme dafür schreibt. Entwickelt wurde das ganze von Evil Mad Scientist Laboratories als open-source Hardwareprojekt. Open-source bedeutet in diesem Zusammenhang, dass sowohl das Layout der Platine sowie die für die Programmierung benötigten Librarys frei erhältlich sind. In Meggy werkelt ein Atmega 168 Microcontroller vor sich hin. Meggy baut, im Hinblick auf einfache Toolchains und Prototyping-Qualitäten, auf Arduino auf.

Neben dem Microcontroller ist das Display sicherlich mit das größte Feature: Es ist eine LED Matrix bestehen aus 8×8 Elementen, die jeweils eine große Anzahl verschiedener Farben anzeigen können. Eine Auflösung von 8 auf 8 Pixel hört sich zwar klein an, aber schon die mitgelieferten Spiele zeigen, dass durchaus einiges Potential für gute Spiele vorhanden ist. Bisher habe ich sehr spaßige Meggy-Versionen von Frogger und Space Invaders gespielt. Das vorinstallierte Spiel ist ein sidescrolling Shoot-em-up bei dem man laut Beschreibung die Welt vor ein paar Tomaten rettet :) Es gibt sogar ein Meggy Roguelike (hier), allerdings habe ich es noch nicht selbst gespielt.

Aber Meggy eignet sich nicht nur als Spielekonsole. Mittlerweile gibt es auch eine ganze Reihe von Anwendungen die mit Spielen an sich nichts zu tun haben. Begünstigt wird das durch eine Serial Port mit dem man Meggy mit dem Rest der Welt sprechen lassen kann. Durch die Wahl von Arduino als Entwicklungsumgebung genügt dafür eine einzige Zeile für die Initialisierung und anschließend ein Serial.println("..."); um Text den Serial Port runterzuschicken. Als Beispiel sei hier mal das Projekt genannt in dem Meggy zusammen mit einem Arduino WaveShield als Sequenzer benutzt wird: MeggySeq

Hier ein paar Bilder vom Zusammenbauen:

Meggys Platine

Meggys Platine


Heh, ohne Kommentar..

Heh, ohne Kommentar..


Halbfertig mit Microcontroller und LED Treiber

Halbfertig mit Microcontroller und LED Treiber


Meggy Jr RGB fertig zusammengebaut

Meggy Jr RGB fertig zusammengebaut

Written by michi

April 4th, 2009 at 4:58 pm

Mandelbrot in Matlab

with 2 comments

Neulich bin ich beim Stöbern auf den Seiten des Plus Magazins auf einen Artikel über Fraktale gestoßen. Sofort ist eine alte Faszination entflammt und ich dachte es kann nicht so schwer sein das Mandelbrot selbst mal herbeizuzaubern. Gesagt getan, nach ein paar Minuten mit Matlab haben sich schon einige interessante Ergebnisse zusammengefunden:

Das entsprechende M-File habe ich auch mal hochgeladen, allerdings ist die Berechnung damit hoffnungslos langsam, ich habe noch nichts optimiert: click!

Written by michi

December 4th, 2006 at 12:24 pm

Posted in Arduino, Development, Other