Tip:
Highlight text to annotate it
X
this is my experience getting the teensy 3.1 set up with the
"RawHID" example in Arduino dev environment. I am running
Ubuntu 13.10 with a 64-bit chip
If you're watching it on YouTube
I suggest watching at two-times speed as I'll speak rather slowly
and take a lot of pauses.
First I bought the Teensy 3.1. It cost me about twenty dollars plus shipping
and I bought it with pins so that I could put it on a breadboard.
I went to this "First Use" page which tells you to you
plug in USB in the computer, plug the micro USB and the Arduino
you'll see the first sketch running which just blinks this light on and off
and then you if you click the button you'll go into "HalfKay" bootloader mode
which I don't completely understand. Anyways, you go to this
next page
and it says that you need a teensy loader application but
teensy is supported by Teensyduino which is an update to the Arduino dev
environment which will run
that loader for you so we go to this link here this is how we get Teensyduino
installed on top
of Arduino; so first we download this executable.
I've downloaded it to my downloads directory and I did a "chmod" on it so it can be
executable and well see
now it's highlighted in green.
Then we have to you download and extract Arduino so we go to that link
there
i download the 64 bit tarball
and I extracted it in
dev Arduino you can see these are the files you get and here is the executable.
Then the next step is to copy the udev rules
and the link is up at the top here. That will take you here: copy that file.
I copied it to my downloads directory as
49-teensy.rules and then I ran the command
here to copy that into /etc/udev/rules.d/
then I ran the installer
Run the installer
and you can see that is slightly different from the version here this is
version 1.18-rc4 as opposed to version 1
that's for Arduino 1.0.5 as opposed to 1.0-rc1
So we'll hit "next."
We have to go to the place where we unzipped
Arduino; that's in ~/dev/arduino-1.0.5. You can see when I click on that directory
the "Next" button will be enabled menaing that Teensyduino recognizes this as
directory it's looking for. Go through the installation.
It walks you through it here and I picked all the libraries
and at the end this is telling you what you would do to run a sketch
and you just hit "Done". Alright so Teensyduino is
installed on top of Arduino so let's run
Arduino. I have Arduino in
my ~/dev/Arduino-1.0.5 directory so we'll run
./arduino
That error that you see is is normal for me it still runs.
Now we have are "RawHID" example first thing you need to do though is we need to go into
tools and
because we've installed Teensyduino it installs some add-ons for Arduino which
is
stuff for the teensy boards. So we picked the board we have 3.1
We also need to go and pick the USB type for the RawHID example
which is "RawHID". Then we need to open the sketch by going to examples
and teensy and USB RawHID basic
which is what I have here. There is some C code that goes with this
you have to find the C code; I can't even remember where I found it, but
you're astute and you will find it. There is a problem with the C code that we
download
and it says, if you look it hid_LINUX.c,
that they're using libusb-0.1; I missed that the first time and installed libusb-1.0
Another thing to note is that you need the libusb-dev
package not just the regular libusb package on 13.10 Ubuntu
libusb is already installed if you try and install it with
"sudo apt-get install libusb-0.1
it'll tell you it's already installed. So you need to install
"sudo apt-get install libusb-dev"
and that will give you the header files you need and then you need to tell the
make file where to find those header files I had added this live usb part
wasn't in there.
In order to find those you do this
"pkg-config --clibs --libs libusb"
and it will tell you to add "-lusb"
onto your CFLAGS
and in the make file you just add that to the CFLAGS right there and then you can
make
that program. Once we have that made
will see we have rawhid_test
So we will first go into
Arduino and I've already
verified this and run it but we'll run it again.
I've already got it loaded and as soon as I plug in the Arduino it's gonna be start sending
that data.
So I'm going to hold the button down so that doesn't do anything;
it says that on the first page, and then I'm going to you
go to this "verify". If you get a
thing saying that RawHID
isn't found, or whatever, it's because you didn't go to tools and
then USB Type RawHID. You have to do that first. So now I've
verified it; I'm going to upload to my Teensy. You can see that this
Teensy loader on comes up automatically
I can let the button go when it's done uploading
and it'll say "reboot okay". So now if we go to "serial monitor"
we're gonna see that
that teensy is transmitting stuff to the computer
on the serial port. Now we can go to our RawHID test
and we can run that and we'll see that
the RawHID C program is picking up stuff on USB from the teensy and if we
hit
keys we can see that as we hit each key
the teensy is picking up that key. And that's it that's running the RawHID
example
with a teensy 3.1 on Ubuntu 13.10 on a 64-bit machine.
I had a few bumps along the way. I hope that helps.