I created a complete color table with the impression of all possible 4096 Meggy Jr RGB colors. The green LED is much brighter than the other two LEDs, the first tables used blue as base which does not make much sense. So I created a second set of tables which use the bright green as base.
If you like to create own tables or if you try to create something like a simulator or color lookup, here a ZIP file with all colors as individual PNG images: MeggyJrColorLEDs.zip
From time to time you have to debug time critical code. If you are using interrupts, you are interested in the actual performance on the code. This is especially true, if you are using timed interrupts.
In this cases, using the serial interface is impossible. If you write to the serial interface, the whole timing of your application changes and you will get no usable results.
If you own an oscilloscope, there is a really simple way to debug many applications. I used this technique many times, for example with projects featured on these pages: For the timing of the sound output of the cat protector, or the timing of the display interrupt of the Meggy Jr library.
This technique is obvious ans simple. Nevertheless I hope this article will give some inspiration to help solving timing problems.
I planed to create a game as a gift and use the really great Meggy Jr RGB platform for it. See the picture above, it’s a great game machine powered by the ATmega328P (buy it here). You can use the Arduino IDE to program it.
After assembling the device, I played a little bit around with the provided library — but was a bit disappointed by the library. This is a game device after all, but the library lack in my opinion some important things a game library need.
So I wrote a new library from scratch, using the provided schema and documentation (you can see the printed out schema in the background of the picture). Sometimes its better to start from scratch and learn from the mistakes of other libraries.
Today I release the first version of the library at GitHub here: https://github.com/LuckyResistor/LRMeggyJr. It has a proper API documentation and a few examples. I release this early, but hope to improve the documentation and add examples while I develop the actual game.
The LM386N-1 I used before worked well, but has some disadvantages. There was a hearable distortion in the sound and I needed more amplification to create the required loudness.
I found the TDA 7052 chip, which was formerly produced by Philips, but now by NXP semiconductors. It contains everything required for an amplifier. You just have to supply power, the input signal and there are two outputs to connect the 8Ω speaker.
The updated schema looks like this:
I also added a trimmer to adjust the volume of the output. The value of the trimmer is missing in the schema. I used a 47kΩ trimmer, but a 10kΩ trimmer will work fine as well.
If you own a cat, you know even if your cat is well brought-up, laws are only valid as long you are at home or even in the same room. The goal of this project was to create a small device, which detects movement in protected areas (e.g. tables) and speak your usual phrases in your voice to the cat.
I documented a working prototype of the project in the hope to share some knowledge and give some ideas how certain details can be solved. It contains schemes for all hardware parts and a detailed description of all software parts, including a minimal implementation of a SD card access.
Please feel free to ask, if you do not understand a part, or if you have any suggestions where to extend the documentation or clarify parts.