Took me a couple days and some studying of "TFM" but I got it to work. Here is the code snippett I ended up with. Any comments or tips are welcome. Thanks for the help so far.
Same idea used for increasegain and Quiet subroutines.Code:Decreasegain: if PortB.2 = 1 then return leftvolume = leftvolume - 1 rightvolume = rightvolume - 1 HSerout ["Left = ",dec leftvolume, 13,10] HSerout ["Right = ",dec rightvolume, 13,10] gosub getgain if gain.15 then gain = abs gain gain2 = gain dig 2 gain1 = gain dig 1 HSerout ["Gain = -",dec gain2,dec gain1, ".", dec (gain.0* 5 ), " Db", 13,10] else gain2 = gain dig 2 gain1 = gain dig 1 HSerout ["Gain = ",dec gain2,dec gain1, ".", dec (gain.0* 5 ), " Db", 13,10] endif Low RST SHIFTOUT IO,SCLK,1,[leftvolume, rightvolume] high rst write 1, leftvolume write 2, rightvolume return




Bookmarks