PDA

View Full Version : gong or dingdong sound



Pedro Santos
- 13th March 2007, 17:03
Hello

Have anyone idea how to make a dong or dindong sound with pic controller
Perhaps a sample code please?

Thanks

Regards

Pedro

Evolution
- 13th March 2007, 18:19
here is some working picbasic pro code
these sounds wont be like a gong but all
you have to do is change the numbers to
suit,it works in pairs for example
SOUND PORTb.1,[100,10] sends tone 100
to portb.1 for a duration of 10ms
target prosesor is 16f628-a

cmcon = 7 'turn compartors off
vrcon = 0 'turn voltage refrence off
define osc 4 'set oscillator speed

finaly:
SOUND PORTb.1,[100,10,60,15,120,10,73,10]
pause 400
SOUND PORTb.1,[120,10]
pause 400
SOUND PORTb.1,[120,10]
pause 400
SOUND PORTb.1,[120,10]
goto finaly
end