audio and motor board conflict and wrong pins on motor4


  • Newbie
  • *
    • Posts: 1
    • View Profile
I'm building a projects with 2 motors and triggering audio files while the motors are running. It looks like the audio pins conflict with motor1 and motor2, so I can only use motor3 and motor4. Is there any way I can get around this to use more than 2 motors in the future with audio?

Also, while using motor3 and motor4, the audio was being distorted only when motor4 was being PWMed. After much experimentation, I found the fix to be swithing the pin assignments for motor4. I made pin8 the PWM and pin9 the direction (opposite of what shown in the documentation). Am I correct that this might be a mistake? Thanks!
« Last Edit: June 05, 2015, 08:34:18 PM by stmchris »

Ben Rose

  • Administrator
  • Hero Member
  • *****
    • Posts: 357
    • View Profile
Unfortunately when the compatibility chart was made, only pin compatibility was considered- the wave library and PWM on pin 9 both use the Timer1 counter and can't be used together. Pin 8 doesn't actually have PWM, the analogWrite function should just be setting the pin high or low depending on if the value passed to it is above or below half the maximum.

If only need on/off control, you can just use digitalWrite on both control pins as a quick workaround. If you do need PWM, we'll definitely get our error sorted out in some way.


SMF spam blocked by CleanTalk