Pins used for sample code used for Stepper + DC Motor FeatherWing

Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
hoobay
 
Posts: 8
Joined: Thu Dec 22, 2022 10:29 am

Pins used for sample code used for Stepper + DC Motor FeatherWing

Post by hoobay »

The sample code for the featherwing uses Adafruit_MotorShield.cpp

In this file, I see the pin mapping for a stepper motor:

Code: Select all

    if (num == 0) {
      pwma = 8;
      ain2 = 9;
      ain1 = 10;
      pwmb = 13;
      bin2 = 12;
      bin1 = 11;
    } else {
      pwma = 2;
      ain2 = 3;
      ain1 = 4;
      pwmb = 7;
      bin2 = 6;
      bin1 = 5;
    }
    steppers[num].PWMApin = pwma;
    steppers[num].PWMBpin = pwmb;
    steppers[num].AIN1pin = ain1;
    steppers[num].AIN2pin = ain2;
    steppers[num].BIN1pin = bin1;
    steppers[num].BIN2pin = bin2;
In the onestep() function in the same file, the AINx/BINx pins are toggled.

The sample code seems to work, in terms of the stepper motor is moving. I want to probe/monitor the AINx and BINx pins. I am trying to probe the pins numbers described in the source code above. AIN1 for example would be pin 10 for Motor 1.

I am not seeing any activity on these pins. Any suggestions on what the issue may be?

I am using this with the Feather 32u4 BLE. On pin 10/AIN1, for example, I am looking at pin "D10" as shown on the 32u4 BLE pinout.

Thanks!

User avatar
adafruit_support_carter
 
Posts: 29150
Joined: Tue Nov 29, 2016 2:45 pm

Re: Pins used for sample code used for Stepper + DC Motor FeatherWing

Post by adafruit_support_carter »

How are you probing the pin(s)?

User avatar
adafruit_support_bill
 
Posts: 88086
Joined: Sat Feb 07, 2009 10:11 am

Re: Pins used for sample code used for Stepper + DC Motor FeatherWing

Post by adafruit_support_bill »

In this file, I see the pin mapping for a stepper motor:
Please post a link to the file you are referencing.

The current Motor Shield & Wing do not directly map any pins to any motors. They use i2c to communicate with the shield.

User avatar
hoobay
 
Posts: 8
Joined: Thu Dec 22, 2022 10:29 am

Re: Pins used for sample code used for Stepper + DC Motor FeatherWing

Post by hoobay »

This is the file that I'm referencing:

https://github.com/adafruit/Adafruit_Mo ... Shield.cpp

Around line ~497 is where pins are set. I understand i2c is used, but my guess is that the pins might also be set for debug, or portability if trying to adapt to another motor driver that doesn't use i2c.

I have a logic analyzer connected to these pins, to answer the other question.

User avatar
adafruit_support_carter
 
Posts: 29150
Joined: Tue Nov 29, 2016 2:45 pm

Re: Pins used for sample code used for Stepper + DC Motor FeatherWing

Post by adafruit_support_carter »

The pins referenced are the PCA9685 pins, not the pins of the Arduino itself.
https://learn.adafruit.com/adafruit-mot ... /resources

User avatar
hoobay
 
Posts: 8
Joined: Thu Dec 22, 2022 10:29 am

Re: Pins used for sample code used for Stepper + DC Motor FeatherWing

Post by hoobay »

Aha! That's it, thanks!

Locked
Please be positive and constructive with your questions and comments.

Return to “Feather - Adafruit's lightweight platform”