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

Thread: teensy 3.1 as a GPIO extension

  1. #1
    Junior Member
    Join Date
    Dec 2013
    Posts
    8

    teensy 3.1 as a GPIO extension

    Hi forum,
    I just got my first teensy board, a teensy 3.1.

    I do some robotics with linux and just want my "normal" CPU to be able to
    interact with the real world.
    I chose the teensy 3.1 because of the i2c bus and the 12 pwm channels.
    I do not want to use the teeny cpu to do any kind of calculation,
    I just want to use the GPIO ports from my linux programs.
    The easiest way for me would be to plug in the teensy with
    a USB cable, get a virtual serial device on my linux and
    send commands like "port1=on" or "pwm7=90" (in %)
    or "i2c send 0x100 0xFF 0x00" or "i2c read 0x100" or something like this.

    Is there already a mode to use the teensy like this or a ready made
    program providing this feature?

    Thanks for your help!
    Roland

  2. #2
    Senior Member Constantin's Avatar
    Join Date
    Nov 2012
    Location
    In the yard with a 17' Dia. Ferris Wheel
    Posts
    1,408
    Seems perfectly reasonable to use the teensy 3 in this fashion, especially if you use either the usb or one of the three hardware serial ports.

    Look through the serial commands for inspiration. As for how to accept commands through serial, an obvious example I can think of is setting a ds3231, ds3107, etc real time clock from the command line. So have a look for that over at the arduino website.

    Another example of parsing I can think of are the gps libraries that Paul includes with the teensy 3.

Posting Permissions

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