[Nottingham] [Talks] *TODAY* Thurs 21-02-2008: Arduino; And What GPL?!

Martin martin at ml1.co.uk
Mon Feb 25 18:00:54 GMT 2008


>> Folks,
>> I have the hardware and I will be bringing the Arduinos for people to
>> pick up tonight. Thanks to Tinker.it! for very prompt service!
> 
> So how went the meeting? Did my message to the Navigation about Martin being 
> delayed get to the group? How's the arduinos?

...And a good talk and a good turnout it was too, even if I claim so myself!

The Arduino demo proved to be far too easy and the blinking LED blinked
exactly as programmed. Serial comms via the USB2 link was demonstrated also.

The GPLv3 talk stirred some good comment and discussion.



Arduino-ing onwards:

For those yet to pick up their boards, I'll be at a Last Post Beeston
Beers tomorrow Tuesday 21:30 onwards. I'll also be at the following NLUG
socials and talks.


So, to get going with your board...

(For Mandriva2008 at least)


To use the Arduino IDE, you need to at least have installed:

    * sun's java runtime (jre)
    * avr-gcc (aka "gcc-avr")
    * avr-libc

The jre in the standard repositories appears to work fine and is called:

java-1.5.0-sun

along with various java-1.5.0-sun-XXXX bits 'n' pieces.

There's also java-1.6.0-sun available that you might want to try
instead. If you've got the java plugin for your browser already
installed, you'll find that you've already got the java stuff.


The other rpm stuff required I downloaded from:

http://users.design.ucla.edu/~acolubri/arduino/avr-rpms/avr-binutils-2.17-4.fc8.i386.rpm
http://users.design.ucla.edu/~acolubri/arduino/avr-rpms/avr-gcc-4.1.2-5.fc8.i386.rpm
http://users.design.ucla.edu/~acolubri/arduino/avr-rpms/avr-gcc-c++-4.1.2-5.fc8.i386.rpm
http://users.design.ucla.edu/~acolubri/arduino/avr-rpms/avr-gdb-6.6-5.fc8.i386.rpm
http://users.design.ucla.edu/~acolubri/arduino/avr-rpms/avr-libc-1.4.6-4.fc8.noarch.rpm
http://users.design.ucla.edu/~acolubri/arduino/avr-rpms/avr-libc-docs-1.4.6-4.fc8.noarch.rpm

Thanks for those links on:
http://codeanticode.wordpress.com/2007/11/15/arduino-in-mandriva-2008/

Download them to somewhere convenient, and install them in whatever is
your favoured way. I use the Mandriva Control Centre to use a
'repository' that is just the directory ~/Downloads/rpm I've downloaded
stuff into.

Those particular rpm files are for Fedora Core 8, but are still
compatible with Mandriva 2008 except for the prerequisites for the
avr-gdb whereby libtinfo is required but not available anywhere. Our own
Martin G describes the problem very nicely:

http://shoe.bocks.com/nlug/2003-Jul/3221.html
####
Mandrake (and redhat and probably others) compile ncurses without the
"--with-termlib" option. The "--with-termlib" option splits ncurses into
two: libncurses and libtinfo. It's not "wrong" to do it one way or the
other, but applications compiled against it need to match.

In other words, either download an ... rpm that was build for redhat
or mandrake, or grab a source rpm from somewhere and try rebuilding on
your machine ... (or of course, just dload the source ... and
compile it yourself)
####

Perhaps we should have a talk and demonstration on how to put an rpm
together? Anyone??

So far, I've not bothered with avr-gdb. Then again, I usually get
excellent mileage out of a few carefully planted "printf"s!


The Arduino IDE uses "RXTX" for the serial link through the USB. You
need to ensure that the arduino IDE whilst running with your user
credentials will have access to the /dev/ttyUSB0 device...

LOG OUT OF YOUR USER (otherwise usermod will error out) and drop down to
a text terminal using such as ctl-alt-f1. Login as root:

groupadd -r uucp
chgrp uucp /var/lock
usermod -a -G uucp,tty your_login_name

Logout of root and relogin back as your usual user.

(Use ctl-alt-f7 to get back to your graphical display.)

Then download arduino-0010-linux.tgz from such as
http://www.arduino.cc/files/arduino-0010-linux.tgz

For example, to do this go to wherever you want to use the Arduino IDE:

cd ~
mkdir arduino
cd arduino
wget http://www.arduino.cc/files/arduino-0010-linux.tgz
tar xzf arduino-0010-linux.tgz

Now is the time to plug in your Arduino board into the USB. You should
see the green power LED light and another LED randomly blink.

Mandriva2008 already has the FTDI kernel module required to drive the
USB-serial interface chip used on the Arduino board.

To run the IDE, you just use (in your ~/arduino directory)

./arduino

A good first example to try is to select
File -> Sketchbook -> Examples -> Digital -> Blink
Click on the "play" button on the IDE to compile it, and then on the
"->|" button to upload it onto the Arduino.

Viola! You should have a blinking LED :-)


The most confusing thing I found was in the name/jargon of "Sketches".
All a "Sketch" is is a normal C program where the main loop is instead
called "void loop()". The hardware bit twiddling is all done by calling
up various C subroutines, no assembly code required. I guess the
"Sketch" jargon is to try to entice more artists into this high-tech!


Mmmm... And that little lot is a good example of what is both good and
bad about Linux!

There's various details on:

http://www.arduino.cc/en/Guide/HomePage


Have fun,
Martin


-- 
----------------
Martin Lomas
martin at ml1.co.uk
----------------



More information about the Nottingham mailing list