PDA

View Full Version : Teensy 2.0 ANALOG IN



dpmarkman
11-15-2012, 04:01 AM
I'm sorry if this question is answered somewhere else, I tried looking for the answer and could not find it.

I am trying to port over some code I wrote for the Arduino Diecimilia and in the code i use I2C and the 2wire.h library to communicate with a parallax OFN Module (part number 27903). To do that with the Diecimilia I connect two of the OFN pins (CLK and SDA) to ANALOG IN pin 4 and 5 of the Diecimilia. I don't see any pins on the Teensy marked "ANALOG IN". Which pins on the Teensy work as analog in, or, which pins should I use on the Teensy for I2C communication?

Thank you

virtualdave
11-15-2012, 04:37 AM
Check out:
http://www.pjrc.com/teensy/pinout.html

Scroll down to teensy 2/arduino. you'll see which pins are a4 & a5.

Nantonos
11-15-2012, 06:20 AM
I am trying to port over some code I wrote for the Arduino Diecimilia and in the code i use I2C and the 2wire.h library to communicate with a parallax OFN Module (part number 27903). To do that with the Diecimilia I connect two of the OFN pins (CLK and SDA) to ANALOG IN pin 4 and 5 of the Diecimilia. I don't see any pins on the Teensy marked "ANALOG IN". Which pins on the Teensy work as analog in, or, which pins should I use on the Teensy for I2C communication?


On the Diecimilia (and the Uno) the I2C functionality and the Analog to Digital functionality happen to share pins. Apart from that though they are unrelated (I2C communicates with digital pulses, not analog voltage levels). So you should be looking on the Teensy pinout (http://www.pjrc.com/teensy/pinout.html) for SDA (I2C serial data) and SCL (I2C serial clock). On Teensy 2.0 these are D1 (SDA) and D0 (SCL).

You might find this page about I2C (http://gammon.com.au/i2c) to be helpful.

@virstualdave - yes, but dpmarkman is not looking for analog to digital conversion, in fact.

dpmarkman
11-15-2012, 06:33 AM
@virtualdave thanks for answering the first part of the question. This will be helpful for me on my next project.

@Nantonos, thanks for answering the other portion of my question. I will update this post when I've got my final project working. I am combining two projects from Make Magazine issue 32. I'm using the OFN module to act as a combination lock and a buttion/selector. I am using the Teensy's USB keyboard functionallity to help me remember and enter passwords for different websites and logins.

Nantonos
11-15-2012, 08:17 AM
I'm using the OFN module to act as a combination lock and a buttion/selector. I am using the Teensy's USB keyboard functionallity to help me remember and enter passwords for different websites and logins.

That sounds like a useful project! Avoids the temptation for password re-use between sites.

Magnethead494
11-16-2012, 11:44 AM
Glad I'm not the only one intrigued by that article/use of Teensy!

dinka
05-09-2014, 10:18 PM
Ok... typical... had the wrong pins connected... sorry about the fuss guys!:p