Python Forum
Thread Rating:
  • 2 Vote(s) - 1.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pyfirmata and Teensy 3.6
#1
Hello everyone,

I am trying to use pyfirmata with the Teensy 3.6. I am struggling with the dictionary for this board, in particular for its two DAC pins (A21 and A22). This is what I have so far:

teensy36 = {
    'digital' : tuple(x for x in range(40)),
    'analog' : tuple(x for x in range(23)),
    'pwm' : (2,3,4,5,6,7,8,9,10,14,16,17,20,21,22,23,29,30,35,36,37,38), // I know this can be done more elegantly :)
    'use_ports' : True,
    'disabled' : (0, 1) # Rx, Tx, Crystal
}
board = fm.Arduino('COM5')
board.setup_layout(teensy36)
Problem is, I can't write to the two DAC pins. It either tells me that they are inputs, not outputs, or, if I force them to be outputs, the output voltage doesn't change, no matter the .write() value.

What am I missing?
Thanks!
Reply
#2
Difficult to say, since you did not include the code you are using to read and write to set/unset the pins.  Are you remembering that index's start with '0' and not '1'?  If you are getting an error, you should post the error code, in it's entirety, using the error tags.

You should also presume that not every one (including me) is familiar with the Arduino. So looking at your dictionary and it's overlapping pin numbers, is is safe to presume there are no 'pre-defined' pins?
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020