Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 7 of 7

Thread: Teensy 2.0 ANALOG IN

  1. #1
    Junior Member
    Join Date
    Nov 2012
    Posts
    3

    Teensy 2.0 ANALOG IN

    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

  2. #2
    Senior Member
    Join Date
    Nov 2012
    Location
    Los Angeles
    Posts
    100
    Check out:
    http://www.pjrc.com/teensy/pinout.html

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

  3. #3
    Senior Member
    Join Date
    Nov 2012
    Location
    Boston, MA, USA
    Posts
    1,107
    Quote Originally Posted by dpmarkman View Post
    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 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 to be helpful.

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

  4. #4
    Junior Member
    Join Date
    Nov 2012
    Posts
    3
    @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.

  5. #5
    Senior Member
    Join Date
    Nov 2012
    Location
    Boston, MA, USA
    Posts
    1,107
    Quote Originally Posted by dpmarkman View Post
    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.

  6. #6
    Glad I'm not the only one intrigued by that article/use of Teensy!

  7. #7
    Junior Member
    Join Date
    May 2014
    Posts
    6
    Ok... typical... had the wrong pins connected... sorry about the fuss guys!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •