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 Chars and so on.
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.
If you want to use it, follow these steps:
- Download this Zip.
- Backup your “WString.h” and “WString.cpp” files from the folder \Arduino\hardware\arduino\cores\arduino\
- Unzip the downloaded file to your \Arduino\hardware\arduino\cores\arduino\ folder overwriting the old files
- 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 String the number gets converted into String and is 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 are fixing this soon.
Posted in Programming | No Comments »
TimeWasters LCD Framework for HD44780 and Arduino January 8th, 2012
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.
Posted in Plugins, Programming, Tools | No Comments »
How to tame Google November 21st, 2011
There are 3 issues i REALLY hate about the new Google search page:
- The search is way too fuzzy, often i get results for an keyword only related to the keyword i entered
- While i am typing the results page is refreshing, which results in an “optical flickering” of the whole page
- 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.
Posted in Plugins, Programming | No Comments »
TimeWaster’s Geiger Counter – A system software for microcontrollers to measure radiation November 7th, 2011
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).
Posted in Programming | 6 Comments »
Wie ich meinen Samstag verbringe March 12th, 2011
Posted in Various | No Comments »
Mein neuestes Projekt: Micro-Quadcopter Eigenbau January 9th, 2011
Ich wollte schon immer mal etwas mit Microcontrollern machen, aber erst jetzt, als bei uns in der Firma unter einigen Mitarbeitern das Modellbaufieber ausgebrochen ist habe ich wirklich damit angefangen.
Ich habe mich dazu entschlossen einen Micro-Quadcopter (Quadrocopter) zu bauen, da ich sowieso schon immer alles was fliegt geliebt habe.
Mein Zielvorgaben sind:
- Möglichst klein
- Möglichst leicht
- Ohne reflow Komponenten (soll einfach lötbar sein)
- Möglichst wenig eigene Beschaltung
Nach viel lesen und suchen habe ich mich nun für die folgenden Komponenten entschieden (warum steht immer unter den Bildern):
Sommernacht July 18th, 2010
Sommernacht. Der Schweiß rinnt. Mein Ventilator brummt monoton vor sich hin.
Mein Gehirn ist schon vor Tagen geschmolzen und wabert seitdem als rote Grütze durch meine Gehirnschale auf der suche nach der Form die es einmal hatte.
Meine Gedanken suchen verzweifelt nach halt, ohne Erfolg. Was wollte ich nochmal? Ach ja, etwas zu trinken!
Aber wie komme ich da heran ohne mich bewegen zu müssen? Alleine der Gedanke an Bewegung erzeugt auf meiner Haut einen Schweißausbruch. Ich stelle den Ventilator höher.
Von draußen dringt Gelächter durch die weit geöffneten Fenster herein, es klingt wie eine gute Party.
Ich überlege kurz ob eine Party jetzt nicht schön wäre, aber Sekunden später habe ich schon wieder vergessen woran ich gerade gedacht habe.
Diese verdammte Hitze.
Mein Computer spielt das Hörbuch “Per Anhalter durch die Galaxis” ab, ich lausche gebannt. Das Brummen und Schnarren meines Ventilators bemerke ich schon gar nicht mehr.
Mein Gehör hat sich so daran gewöhnt, es reagiert schon wie ein natürlicher Vuvuzela Filter. Fantastisch was das Gehirn so kann, selbst wenn es nur noch aus roter Grütze besteht.
Meine Augen folgen ununterbrochen der Fortschrittsanzeige von VLC. Fortschrittsanzeigen mochte ich schon immer.
Es gibt nichts entspannenderes als einem Download beim downloaden zuzuschauen und dabei an rein gar nichts zu denken.
Das ist perfektes Zen. wieder bin ich Nirvana einen schritt näher. Mein Gehirn ist leer. Total leer.
In diesem Sinne: Frohes schwitzen.
Open Source Programmers Are Whimps June 6th, 2010
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.
Posted in Programming, Various | 1 Comment »
The Browser War, or: Fanboys, Trolls and Flamewars June 5th, 2010
I admit it: I’m a fanboy. A big fanboy. I LOVE Opera since 8 years now. AND NO, i don’t mean an Opera, i mean the Opera Web Browser.
And to make it worse i do care about other browser companies insulting my beloved browser with statements about loading speed:
Der Kiefernholzstuhl, oder: Wie komme ich mit bestimmten Keywords auf die oberen Plätze June 5th, 2010
In meinem Clan, den CraZy Vikings gibt es einen insider Witz der mit einem Kiefernholzstuhl zu tun hat. Eines Abends als ich besoffen mit den anderen Clanmembern im TeamSpeak herumgewitzelt habe, bin ich auf die glorreiche Idee gekommen einen Artikel über Kiefernholzstühle zu schreiben, um uns in Google auf Platz 1 zu bringen mit diesem Keyword.
Und siehe da: Es hat geklappt!!!
Kiefernholzstuhl: Platz 1
Kiefernholzstühle: Platz 2
Kiefernholz Stuhl: Platz 7
Kiefernholz Stühle: Platz 17
Kiefer Holzstuhl: Platz 13
Kiefer Holzstühle: Platz 18
Dafür das die Seite sonst so garnichts mit Stühlen oder Kiefernholz zu tun hat ist das echt erstaunlich!
Anscheinend braucht man nur die richtige Keyword-Dichte zu ereichen um in den Rängen zu steigen.
Ausserdem habe ich absichtlich auch andere Keywords verwendet (wie onlineshop u.ä.) um den Artikel weniger verdächtig erscheinen zu lassen.
Nachtrag: Inzwischen ist dieser Artikel auf Platz 2. Ich weiß, es ist kein sonderlich starkes Keyword, aber trotzdem zeigt es das man den meisten Aufwand in den Text stecken sollte.
Posted in Various | No Comments »

