Posts Tagged ‘ mac

First steps with the Adafruit Trinket

I recently picked up a Adafruit Trinket (3.3v), simply because they’re so cheap (about $8).  I like the idea of a tiny small Arduino-ish board.  Since I’m forgetful, below documents the overall process I got to get it working.

End result:  Franken-servo!

End result: Franken-servo!

Resource Links:

First Steps:

For all the documentation on the web, I really wasn’t sure where to start.  There’s all this talk of installing AVRDUDE, etc, but as it turns out it’s really not needed (if using the Arduino IDE). Here’s the streamline approach I finally took:

  • Setup my pre-existing Arduino IDE for use with the Trinket, following these Adafruit docs.
  • Since I’m on a Mac, I didn’t have to worry about installing any drivers, but the “Mac Arduino IDE” app download they provided didn’t work.  Mac said it was “corrupted”.  So instead I had to use the “Slow Way” example they gave.  And other than a few path differences it worked just fine.

Programming:

  • I was able to successfully run all their examples from the page “Programming with Arduino IDE“.
  • Earlier in the day I had done some servo programming on an Arduino, and I wanted to emulate it on the Trinket.  Thanks to the “Trinket Servo Control” tutorial, and their “Adafruit SoftServo” library, I was able to make it happen.  However, I was unable to create two separate servo objects:  I think I don’t quite grasp the Trinket pinouts.  The above image has two servo’s hooked up to the same pin, so they move the exact same way.

So a successfully first attempt.  Next up, I really need some batteries to make a standalone project with it…

Android Adventures, part 8: On a Mac?

Back to part 7.5…

I started using Apple’s back in the early 80’s:  Staying up late at my friends house playing Wizardry (1) on his Apple ][+ in ’81 was a great time.  My family picked up an Apple ][c in the mid 80’s which lasted for many years.  But by the late 80’s we jumped on the PC bandwagon, and it was a steady stream of 286’s, 386’s, 486’s, Pentium’s, etc,… up until today where I’ve had a Dell laptop for the past six years.  It treated me well, but has been showing it’s age.

Time to get a new laptop.  Doing my research, I learned the majority of the tech-friends I respect all vote for Mac.  Mac?

Long story short:  Now have a nice new shiny Macbook Air.  Easily portable, solid state drives, and feels nice in your hand.  Time to get software!

Below is the process I went through getting the Android SDK on the machine, getting ‘Processing for Android’ on it, and all the confusion that went on in-between considering I’m a complete mac noob.  This is actually very similar to “Android Adventures, part 2” where I configured everything on my PC, but with some twists.

A.  Install Software to get ‘Processing for Android’ working:

  • Per the instructions on the ‘Processing for Android’ page, I installed:
  • The Java Development Kit.  Wait, no I didn’t.  The mac comes pre-loaded with that.  Of course I didn’t know that and took me an hour or so to grasp it.  It also comes pre-loaded with Python, Ruby, and many other things.  My PC didn’t come with any of that….
  • Downloaded Android SDK for mac, and installed it.  Since this wasn’t a .dmg, but a zipped dir, I had to do research on where to put it.  Ultimately I renamed the folder it came in and:
    • Stuck it here  /Users/ak_eric/Documents/android-sdk
    • Had to edit my ~/.bash_profile adding these two lines: (there was already an export line for the PATH)
      • PATH=${PATH}:/Users/ak_eric/Documents/android-sdk/tools:/Users/ak_eric/Documents/android-sdk/platform_tools
      • export ANDROID_SDK=/Users/ak_eric/Documents/android-sdk
  • Download ‘Android for Processing’ for the mac.  This is where everything really went wrong:
    • My Android phone is still on os 2.1, which runs the SDK 7 tools.  Reading the download notes, it looked like to me I needed to download ‘Processing for Android’ revision 0191, since that seemed to mesh with SDK 7.  As it turns out, no, I was wrong, I needed to download the latest version.  After that everything started working.  But it took me several days of trial and error to figure this out.  You can see the forum thread on the subject here.

B.  Try out some code:

  • I’d already brought over all my old processing sketches.  During my ‘trial and error’ period mentioned above trying to get Processing for Android working, I downloaded the adbWireless app (which I blogged about previously).  I now use that exclusively to send my Processing for Android apps over to the phone, works great.  No more zany USB configuring for me!

So while it did take me quite a few days to get the whole thing working, it was mainly due to my lack of knowledge of the mac, and failing to install the latest software.  So far the Macbook Air has been a great reintroduction to the world of Apple, I just hope it lasts as long as my Dell 😛

Back to part 7.5…