Getting started with Arduino

My Arduino kit finally came today, and I’ve played with it a few hours so far. For someone not very comfortable with the hardware side of things, I found it remarkably easy getting basic functionality working on it.

With the help of some very useful tutorials, I was able to create a simple tool: a photocell+LED setup that lights up the LED whenever the room goes dark, and switches itself off when the room brightens.

Here’s what it looks like:

And here is the code to make it happen.

Making dotemacs consistent across platforms

My .emacs file has gotten pretty messy over the years. I try out new .el packages on a whim and forget about them. I use emacs extensively on my office laptop (running windows XP), but only for note taking. On my VPS and at home, I use it a bit less, but for different purposes (learning to code, editing html and config files, and so on).

I finally sat down and unified the .emacs files for all these boxes yesterday. I removed pretty much everything that was slowing startup down. The main fix was to have this conditional statement (I don’t know where on the net I got this from):

(cond
((string-match "GNU" (emacs-version))
(message "customizing GNU Emacs")
;; put all the GNU Emacs specific customization in here
;; But first do the things which depend on the OS:
;; setting the load-path and
;; loading packages available only for a certain OS
(cond
((string-match "linux" system-configuration)
(message "customizing GNU Emacs for Linux")
;; anything special about Linux begins here
;; and ends here
)
((string-match "nt" system-configuration)
(message "customizing GNU Emacs for Win NT")
;; anything special about Windows begins here
;; and ends here
)
;; anything special for the OS ends here
)
;; all the common things for different OS start here
)
)

Here is my full dotemacs now. The next step is to version control this and a few other common configuration files.