Too Cool for Internet Explorer

Arduino: String and Float   January 23rd, 2012

Arduino has a nice convenience Class: String.
Although it wraps nicely Chars in Arduino, it misses one really important aspect, it can’t handle Float. I really don’t get it why they didn’t add this, it is so essential in handling strings and it is really a pain in the ass to cover it for yourself since the AVR methods for converting Floats need buffer variables.

So i patched the class for myself, which was much more easy than I thought. Without any deep knowledge in C or C++ I added float and double functionality to the class and I do not understand why it wasn’t done until now. I can now do String to Float and Float to String conversions without any hassle.

If you want to use it, follow these steps:

  1. Download this Zip.
  2. Backup your “WString.h” and “WString.cpp” files from the folder \Arduino\hardware\arduino\cores\arduino\
  3. Unzip the downloaded file to your \Arduino\hardware\arduino\cores\arduino\ folder overwriting the old files
  4. Restart your Arduino IDE

Please note: Changing a core class is a BAD idea. Why? Because every time you update the IDE you WILL loose the patch you added. Also future changes in the Class could break the compatibility to your patch. So please consider not using my patch. I know it sounds silly. ;o)

Here are some examples for the new abilities of the String Class:

String example1 = String(1.852); // Equals: "1.852000"
String example1 = String(1.852, 2); // Equals: "1.85"
String example2 = String(example1.toFloat() * 1.784561, 4); // Equals: "3.3014"
String example1 = example2 + 1.58356; // Equals: "3.30141.583560", since the example2 variable is of type String the number gets converted into String and concatinated.

The default precision i chose is 6 decimal places, but you can specify any number of decimal places as a second parameter in String(num, decimalPlaces).

I hope the guys behind Arduino fix this soon.

At the moment i am working on my Geiger-counter which is based on this hardware, but has many more features added to it (GPS, SD-Card and Buttons). I will post more information as soon as i managed to fixate the last piece of hardware in the case.

While working on it i wanted to have a luminous LCD display and stumbled over a very nice piece of hardware: OLED displays from Electronic Assembly.

OLED displays have many advantages over classical LCD displays:
- Low power consumption
- Perfect contrast
- No viewing angle
- Bright
- Background is really Black

But after ordering a 2×16 OLED display for round about 30 euros from Reichelt i was not able to correctly use it with the Arduino LiquidCrystal library, it showed most the time pixel garbage.
At first i thought the display was broken, but as i was digging deeper into the matter i found that this display is only HD44780 controller “compatible”. What that means depends on the manufacturer.

Read the rest of this entry »

How to tame Google   November 21st, 2011

There are 3 issues i REALLY hate about the new Google search page:

  1. The search is way too fuzzy, often i get results for an keyword only related to the keyword i entered
  2. While i am typing the results page is refreshing, which results in an “optical flickering” of the whole page
  3. After reloading (and other events i didn’t identify till now) the script sets the cursor on a more or less random point of the search string (or even rearranges the keywords), which results in me typing on places in the search string i didn’t want to

All those points combined compelled me to eliminate those issues with the tools i had at hand: The Opera browser.

Read the rest of this entry »

TimeWaster’s Geiger Counter v1.1

This software is designed to work with the Arduino Uno and the Radiation Sensor Board for Arduino from Cooking Hacks, but should also work with your own hardware design if you adapt either your hardware or the software.
I suggest to take a look at the documentation of the Radiation Sensor Board, it gives a good summary on radiation detection and the hardware used (Especially the geiger-mueller-tube).

Read the rest of this entry »

Foreword: I write this article especially with two projects in mind: “Eventscripts” and “Truecrypt”. Come and get me.

The species called “Programmer” seem to be a bit thin-skinned when it comes to issues only “related” to their work.

Read the rest of this entry »

This is very much the first project i have done out of curiosity instead of boredom:

Viiideeeooo.de
An HTML 5 video player with a nice tile repeation effect.

It is mostly a performance test for HTML5′s new Video and Canvas tags allowing you to manipulate pictures and other picture related sources like videos in real time with nothing more than HTML and Javascript!

YES, NO FLASH IS INVOLVED!!!

Please don’t get me wrong: I really like Flash and imho it will never die because it can do much more application like things than HTML5 (for instance: A real time Sequencer and Synthesizer or a complete Picture Editing Suite).

But seeing done such monitor filling animations in HTML5 is really nice.

So check it out and enjoy a whole new video experience on Viiideeeooo.de!

Well, i was bored again, and here is the outcome: A snow effect for Flash AS 2, which uses very less CPU power.

It is extremely simple to use:
1. Create a new empty movieclip on the top layer of your (root) movie.
2. Move the new movieclip at the x and y position 0 Pixel.
3. Copy the following code to the first frame in your new movieclip: Flash Snow Script

Read the rest of this entry »

Are you looking for “Portal The Flash Game – Console Commands List”?

Once there was a bored little Webdesigner.
One day he thought: “Wouldn’t it be nice to make a Flash version of the Portal end credits?”
No sooner said than done, he extracted the commands and the music from the game files itself, and wrote an interpreter for them in Flash.

My luck the Portal end credits are text based commandos and not a video, so i could take the commandos to reproduce the credits 100% identical in flash. You can even copy and paste the text.

Have Fun:

portal-end-credits
Portal End Credits in Flash

This Code isn’t working any more since twitter changed their authentication method. i have no intend to adapt this code and hereby declare it obsolete.

You know the dilemma, you want to write a simple tweeting PHP script and have to mess around with the Twitter API.
With the following small script you can tweet with a simple function call. It IS that simple (And SSL secured!!!).

Here’s the function:

Read the rest of this entry »

The most AJAX frameworks are bloated with many functions you’ll never use or need. Who wants 60 KB of JavaScript if your only need is to send and load data? I Don’t.

I have found somewhere a short howto for AJAX, and derived (rewritten) the smallest AJAX framework ever out of it:

Read the rest of this entry »