Hi, I’m Albert
This is where I post about projects and leanings from the past and present in the hope that someone else (my future self included) will find them useful. You can contact me on social media, or email at “mail” on this domain.
-
Autonomous RC Racing
Here is a project I have been working with on and off for about a year – Alvin the autonomous RC car. The robot is built to comply with the rules of two Swedish robot competitions, Robot SM and Stockholm Robot Championship, where the objective is to race three other robots around a track without any form of remote control. Rules vary somewhat, but each heat typically lasts until one robot reaches 7 laps, or for max 3 minutes. The robots are then given points according to the number of laps they have completed at this point. The participants can…
-
Periodic Python Scheduler
Since the days were getting shorter, I thought it was about time to set up the wakeup light in my new apartment. This got me looking at the code and wondering about improvements. One of the first things I wanted to fix was the ugly way it handled fading the light by setting a new intensity once per second: while(1): client.loop() # Do next fade step if needed if (rgb.fadeState != 0): if (time() – lastTime >= rgb.fadeTickSeconds): lastTime = time() rgb.fade() At work, I have spent some time programming with TI-RTOS lately. Like any RTOS, it has the ability…
-
Learning Proper Coding: For-loop optimization
“Whats wrong with this code?” for ( int i=0; i<10; i++ ) { //do stuff } As it turns out, I will soon start working as an embedded software developer. It seems then, now would be a good time to start learning how to program properly. I’ll be putting up some tidbits here for my own reference and hopefully others to learn something as well! Several months ago, during a (the) job interview, I was told about reverse loops. Supposedly, computer scientists will scoff at this, but since I never learnt about it until interviewing for my first job after…
-
Wake-up Light Part 3: Hardware
This is the third part (part 1, part 2) of my write-up on building a Raspberry Pi-based wake-up light. At this point, the Pi was capable of switching 433 MHz remote controlled outlets and can be scheduled to do this at certain times. I had a few ideas on how to roll my own light for the project. In the end, I went for 10 m of RGB-LED strip on Ebay and four pieces of quarter round rod from the department store. I think these pictures speak for themselves: To get off the ground quickly, I whipped out an Arduino…
-
Wake-up Light Part 2: Scheduling
Last time, we had managed to get a command for controlling the lights up and running on the Raspberry Pi. The obvious choice for scheduling such a command in Linux is Cron. To automatically turn on the lights using Cron, we need to edit the root-user’s crontab: $ sudo crontab -e This will launch a text editor inside the terminal. Lets scroll down to the end using the arrow keys and add the following lines: 45 6 * * 1,2,3,4,5 send 11111 3 1 50 6 * * 1,2,3,4,5 send 11111 4 1 The values, in turn, represent minute, hour,…
-
Wake-up Light Part 1: Flipping switches
I’ve had the idea to build my own wake-up light for quite some time. This winter i finally got around to it. This is the first part of my write-up of the project. In simple terms, the point of a wake-up light is to gently wake you up by slowly turning up the light before the alarm goes off in the morning. There are several commercial products available that do this already, all of which I think are either ugly, too small or simply not practical enough for my use case. Some of the things I wanted that are commonly…
-
Kör Control Center till TI eZ430-Chronos på Mac
I slutet av november kunde man köpa en eZ430-Chronos-klocka från Texas Instruments webshop för halva priset. Här kommer en snabb förklaring hur man får igång deras Control Center som används för att ta emot data och programmera om klockan, på macen. Vi börjar med en kort bakgrund: jag läste ett inlägg av en annan kille som hade köpt en likadan klocka. I förbifarten uppfattade jag att Control Center-programmet var skrivet i Tcl/Tk. Jag hade ingen aning om vad det var då, men lite efterforskningar visade att det borde gå bra att köra samma kod även under OS X. Det första…
-
Uppdaterad: Programmera MSP430 Lauchpad med en Mac
Här om dagen insåg jag att jag inte programmerat MSP430 Launchpad sedan jag installerade om datorn till Mountain Lion (OS X 10.8) tidigare i år. 2011 skrev jag ihop en guide om vad man behöver installera för att komma igång och eftersom det har ändrats lite tänkte jag att det vore på sin plats med en uppdatering. Ladda ner och installera MSP430LPCDC, det är en drivrutin som gör att datorn kan hitta launchpaden. Installationen kräver av någon anledning att du startar om datorn efteråt. Installera Macports (eller Fink om du föredrar det). Det är en pakethanterare som gör det enkelt…
-
Projekt: Autonom robot, nu med video!
Jag insåg precis att jag inte hade lagt upp någon video med slutresultatet på vårt robotprojekt från 2011 som jag skrivit om förut, så jag slängde ihop en lite snabbt i YouTubes egen videoredigerare!
-
Programmera MSP430 Lauchpad med en Mac
Jag har precis lyckats börja programmera min Launchpad i OSX och tänkte berätta hur jag gjorde. Till att börja med ska jag säga att det här utgår ifrån en annan blogpost, men jag har tänkt lägga till fler steg för den som inte är så van! För att jobba med launchpaden behöver vi två saker, dels en kompilator som kan kompilera vår kod så att den kan köras på en MSP och dels en drivrutin för att kommunicera med den och föra över kod. Idag (11-12-29) heter de senaste versionerna MSP430-Launchpad-toolchain-20111001.pkg.zip samt MSP430LPCDC 1.0.3b.zip. Båda finns att ladda ner…