Dual Hbridge icon Dual Hbridge — Two-channel Dual H-Bridge movement panel to control two DC motors (on/off) for forward, reverse, left, right via EZ-B digital ports; no PWM speed. Try it →

ARC Pro

Upgrade to ARC Pro

Discover the limitless potential of robot programming with Synthiam ARC Pro – where innovation and creativity meet seamlessly.

Author Avatar
United Kingdom
LinkedIn Twitter Google+ YouTube
#9  

Add a SoundServo control from the servo section of control. Set the port to the same port your LED is connected to. Get your robot to speak:)

You may need to play with the scalar setting in the SoundServo

User-inserted image

It should increase the LED brightness depending on the sound.

If not, you could add the SoundServo control. Set the port to V1 Add a script;

:loop
If($soundvalue > 25)
  Set(D1, On)
Else
  Set(D1, Off)
EndIf
Sleep(100)
Goto(loop)

Play with the sleep and soundvalue.

#10  

Thanks rich . Awesome ! I was on the right track with the script! But failed to add ( ) with the if command line . Again awesome! Thanks

Author Avatar
United Kingdom
LinkedIn Twitter Google+ YouTube
#11  

You could use PWM rather than Set... so PWM(D1, $soundvalue)

I just tested it and it works nicely.

Author Avatar
Brazil
#13  

HI Rich! do you think it is possible to use the PMW to drive the LEd, but instead of getting the $soundvalue from the MIC, get that only from the soundboard ? I'm trying to sync my prototype's mouth LED, but using the soundservo I don't know how to avoid it to get the sound coming from the mic (and, if I turn the mic off, I can't use the speach command...). I'm using an bluetooth speaker... and I wired the leds on the speaker + and -... IT works, but it's draining too much power... can you help ? thanks so much! Tevans.

Author Avatar
United Kingdom
LinkedIn Twitter Google+ YouTube
#14  

The SoundServo picks up all sound on the PC (all soundcards, all mics, system sounds, everything) so it wouldn't work for that.

You're already doing what my first suggestion would have been. My only other suggestion would be to hook up the +ve side of the speaker to one of the ADC signal pins (make sure the speaker doesn't exceed 5V). You can then ReadADC(ADCPort) to get the level and use that to PWM a digital pin driving the LED...