Mostly just trial and error... Lots of searching the web, lots of reading... The Arduino Forums are an amazing resource so much brainpower available to be tapped
I had an advantage of already knowing how to code in C, but it's not that tough to pick up enough to do what you wanna do..
Bookmarks