Sunday, October 31, 2010

Learning Electronics

Sparkle Labs is ministering online classes for basic electronics:
Discover Electronics Online

Tony R. Kuphaldt is sharing his knowledge of electronics with several books in
Lessons In Electric Circuits

Saturday, October 30, 2010

A game for my old Nokia 5100

My old cellphone was a Nokia 5100, S40 Series. It had an 128x128px screen and ran on Nokia's MIDP 2.0 framework to J2ME.


(Yes, the 6 years of life were hard on it...)

But, well there was a time when I created a small game so I could learn J2ME.
I was just on my freshman year at ISEP, so my programming skills where still on it's early stages.
And the creativity wasn't much also...

But, the main idea was to learn J2ME and to create something other than academic projects that could be used in my life.

In order to show some images of that game, I downloaded an emulator from Nokia, but the standards have changed a lot since then (8 years of technology), so I couldn't get full compatibility.
The standard screen has a higher resolution and the OS is very different.

This was the entry screen. The image was from Nokia's SDK resources.


This was the main menu. On my cell I would only see text.


The About screen.


The Difficulty selection screen.


The mid-game Options screen.




The Cheat screen. We could activate the ability to cross the screen borders or the added difficulty of reversing the controls.


The game screen. On my cell it would be full screen.
The weird square on the top left is an 128x128px image resource as the background of the game screen. As you can see I couldn't configure the emulator to use the same resolution as my cellphone.
Besides the background image, all the screen is designed on-the-run. The players are geometrical shapes and the grid is built according to the screen resolution.

Saturday, October 23, 2010

Less pins for More LEDs

I found some videos on multiplexing and charlieplexing by Kevin Darrah that i think to be very helpful for any novice on 'LED tingling'.

Multiplexing:



Charlieplexing:

Saturday, October 16, 2010

LED Matrix 101

As a dummy in electronics I still find somewhat difficult to understand most electrical schematics and what parts to use on my projects.

My first attempt to do something more elaborate than to burn LEDs directly on a battery was to understand how does a LED matrix work.

I've read about 'multiplexing' and 'persistence of vision' but how does it work and how can i build it?



Looking at the schematics it would seem that all the wires are connected, but you should connect all the positive ends (anodes) to form lines and the negative ends (cathodes) to form columns separately.
As it is something hard to breadboard, it's best to really solder it all (if you want to breadboard it anyway take a look at this).

My doubts were what resistances to use and how to calculate them for such a complex schematic. Well, after some thought, I realized it's not complicated.

What we do to light up a LED matrix is to light each LED individually at a time. We only do it so fast that our eyes won't notice.

So, we only need to take that single LED into account when doing the math. There's no serial this or parallel that to complicate as it would appear initially to the untrained eye. At any given point in time we are dealing with such a simple circuit as this:



I know that my blue LEDs consume about 4.5V on a 30mA current (as stated in here), so, to a 9V battery i should use a 150 Ohm resistance [V=R.I ==> R=(9-4.5)/0.03=150].
The closest value resistances I have are 220 Ohm, so I'll use those.

I didn't have a perforated board on me and couldn't buy one in time so i turned to a Pringles pack lid for a 'solid' base.

With a matrix designed in a piece of paper where to perforate and fit the LEDs, we get an interesting place to solder our LEDs.


This is the end result:



So what now? The next step shall be to connect it to the Arduino and make some letters appear on my home made LED matrix.

Monday, September 20, 2010

Android Virtual Keyboard on the Emulator

It happened to me that the emulator's keyboard started as something like Japanese or Chinese.



To change the Android keyboard you'll have to long press the lower left key of the virtual keyboard until you see a menu.



Select 'Input Method' and then 'Android Keyboard'.



And now you're ready to go!

Tuesday, September 14, 2010

Why oh why does a LED need a Resistor?

For the people that don't know why should a resistor be connected in series with your LEDs, here is the best explanation i've seen so far (dummy proof, as I understood it :P ).

Driving An Led With Or Without A Resistor/

Wednesday, September 8, 2010

Cellphone Network problems

Today I got scared while going to work in seeing that i had no network on the phone.
My girlfriend's phone had no problems (she has the same network) and after reboot (engineer solution) it remained the same.

So when testing for solutions is that I got me worried. I tried Automatic network search, and after 2 minutes of processing, the phone began a restart loop...

So I tried to change SIM card with my girlfriend. In her phone, all fine.
In mine all the same...

But I found that without a SIM card, my phone had no problems...

I went home to back up my contacts and because i left there my USB cable. Upon arrival, I noticed that my phone already had network and everything worked fine. :0

Upon returning to work, I lost network again. So that was the problem, since my girlfriend's phone always worked?

Well, here's the secret:
I only needed to change the Network Mode of 'GSM / WCDMA Automatic' to 'GSM only'.

I assume that my carrier has a problem with the 3G in the area of my job from now on, as at home it works well on 3G and GSM works fine at my job.

I hope to help someone with this ...