'module' object has no attribute 'A14'

For Adafruit customers who seek help with microcontrollers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Post Reply
User avatar
aschmie
 
Posts: 7
Joined: Wed Dec 30, 2020 9:00 pm

'module' object has no attribute 'A14'

Post by aschmie »

I'm trying to set up the softpot potentiometer to work on a teensy4.1.

I have gotten it to work on other analog pins, but for some reason I am getting
Traceback (most recent call last):
File "<stdin>", line 17, in <module>
AttributeError: 'module' object has no attribute 'A14'
for the following code:

Code: Select all

potentiometer5 = AnalogIn(board.A1)  # potentiometer connected to A1, power & ground
potentiometer6 = AnalogIn(board.A16)  # potentiometer connected to A1, power & ground
It does this for A14, A15, and A16 and with nothing else plugged in.

Any help would be greatly appreciated!

User avatar
dastels
 
Posts: 17274
Joined: Tue Oct 20, 2015 3:22 pm

Re: 'module' object has no attribute 'A14'

Post by dastels »

In the REPL execute the following and post the result.

Code: Select all

import board
dir(board)
Dave

User avatar
aschmie
 
Posts: 7
Joined: Wed Dec 30, 2020 9:00 pm

Re: 'module' object has no attribute 'A14'

Post by aschmie »

['__class__', '__name__', 'A0', 'A1', 'A10', 'A11', 'A12', 'A13', 'A2', 'A3', 'A4', 'A5', 'A6', 'A7', 'A8', 'A9', 'CLK', 'CMD', 'D0', 'D1', 'D10', 'D11', 'D12', 'D13', 'D14', 'D15', 'D16', 'D17', 'D18', 'D19', 'D2', 'D20', 'D21', 'D22', 'D23', 'D24', 'D25', 'D26', 'D27', 'D28', 'D29', 'D3', 'D30', 'D31', 'D32', 'D33', 'D34', 'D35', 'D36', 'D37', 'D38', 'D39', 'D4', 'D40', 'D41', 'D42', 'D43', 'D44', 'D45', 'D46', 'D47', 'D48', 'D49', 'D5', 'D50', 'D51', 'D52', 'D53', 'D54', 'D6', 'D7', 'D8', 'D9', 'DAT0', 'DAT1', 'DAT2', 'DAT3', 'FLASH_CS', 'I2C', 'LED', 'MISO', 'MOSI', 'PSRAM_CS', 'QSPI_CLK', 'QSPI_IO0', 'QSPI_IO1', 'QSPI_IO2', 'QSPI_IO3', 'RX', 'RX1', 'RX2', 'RX3', 'RX4', 'RX5', 'RX6', 'RX7', 'RX8', 'SCK', 'SCL', 'SCL0', 'SCL1', 'SCL2', 'SDA', 'SDA0', 'SDA1', 'SDA2', 'SPI', 'TX', 'TX1', 'TX2', 'TX3', 'TX4', 'TX5', 'TX6', 'TX7', 'TX8', 'UART', 'USB_HOST_DM', 'USB_HOST_DP', 'USB_HOST_POWER', '__dict__', 'board_id']

User avatar
aschmie
 
Posts: 7
Joined: Wed Dec 30, 2020 9:00 pm

Re: 'module' object has no attribute 'A14'

Post by aschmie »

Also going to post the Teensy 4.1 pinout in case it is useful

https://www.pjrc.com/teensy/pinout.html

User avatar
dastels
 
Posts: 17274
Joined: Tue Oct 20, 2015 3:22 pm

Re: 'module' object has no attribute 'A14'

Post by dastels »

Well, there's no board.A14.

Try board.D38. Comparing the schematic (https://www.pjrc.com/teensy/schematic.html) and pin definitions (https://github.com/adafruit/circuitpyth ... y41/pins.c), that looks like it's it.

Dave

User avatar
aschmie
 
Posts: 7
Joined: Wed Dec 30, 2020 9:00 pm

Re: 'module' object has no attribute 'A14'

Post by aschmie »

Yup that looks like it is working! Thanks!

User avatar
Timeline
 
Posts: 1319
Joined: Sun Feb 18, 2024 7:13 pm

Re: 'module' object has no attribute 'A14'

Post by Timeline »

Someone (who cares; I have no interest in this board) should submit a change to the pin definitions to add not only the A14 but A14 through A17.

TeensyCapture.PNG
TeensyCapture.PNG (86.43 KiB) Viewed 11 times

Post Reply
Please be positive and constructive with your questions and comments.

Return to “Microcontrollers”