Friday, September 6, 2013

Installing Arduino on Ubuntu

Once we're in XFCE, its time to get to business. The first thing that we need to do is install the Arduino IDE, which will allow us to write "sketches" and load them to the Arduino processor.

There are already some helpful tutorials on how to do this in Ubuntu, the most helpful of which was this one:


However, I didn't have any problem just getting and running the IDE package from the Ubuntu repository, so I will provide instructions to do it that way instead of downloading the most recent versions of the software.

We will use the Advanced Package Tool apt to locate the Arduino IDE on the Ubuntu software repository server and  install the package arduino on our machines.

First though, we need to do that for a couple other critical components to our system. These include gcc-avr and avr-libc, two packages that compile code written in the C programming language to Atmel AVR microcontrollers, which are used as the CPUs on Arduino boards.

We also need to install the open source Java Development Kit (OpenJDK) because the Arduino IDE is written in the Java programming language. There is currently a version 7 of OpenJDK, but it seems like version 6, openjdk-6-jre, is sufficient for Arduino IDE.

This can all be done simultaneously with a single command line argument:
sudo apt-get install gcc-avr avr-libc openfdk-6-jre arduino

Once these are installed, we can in principle, plug in our board and get to work. However, we do need to know the port address that Ubuntu is using to communicate with the Arduino board via USB. This seems to be a standard ttyACM0, but to find out for sure, we can execute a dmesg to read the kernel ring buffer, which is written to memory at boot and contains information about hardware loaded to the machine. To grab the information about serial input/output devices specifically (i.e. USB connections), we use the command line argument:
dmesg | grep -i tty

Note: grep is an awesome command that can pull text and works alot like find.

There may be some other kinks to work out, which are discussed in the troubleshooting section of the post that is referenced and linked above.

3 comments:

  1. (Not sure if my previous comment went through.)

    You have written "openfdk". Do you mean "openjdk"?

    ReplyDelete
  2. PS: Your posts are awesome! SO Helpful.

    ReplyDelete
  3. This blog awesome and i learn a lot about programming from here.The best thing about this blog is that you doing from beginning to experts level.

    Love from

    ReplyDelete