TinyCircuits Forum

TinyCircuits Products => TinyDuino Processors & TinyShields => Topic started by: stmchris on June 03, 2015, 03:30:18 PM

Title: audio and motor board conflict and wrong pins on motor4
Post by: stmchris on June 03, 2015, 03:30:18 PM
Hi,
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!
Title: Re: audio and motor board conflict and wrong pins on motor4
Post by: Ben Rose on June 18, 2015, 07:13:41 PM
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.