Home AMX General Discussion

Sharp LCXXDXX RS232 protocol

yanbinyanbin Junior MemberPosts: 86
Anyone has volume up/down RS232 command for Sharp LCxxDxx LCD TV? In the Sharp LCD Manual I have only stats the volume in level: VOLM** (volume0-60).
Thanks

Comments

  • yuriyuri Junior Member Posts: 861
    there are no RS232 vol up and down commands.
    Keep track of your volume, and send out VOLMxx
  • yanbinyanbin Junior Member Posts: 86
    Thanks a lot.
  • flcusatflcusat Junior Member Posts: 309
    yuri wrote: »
    there are no RS232 vol up and down commands.
    Keep track of your volume, and send out VOLMxx

    Excuse my ignorance, but if you now the level at which the volume is; how that helps to ramp the volume up or down.
  • yuriyuri Junior Member Posts: 861
    flcusat wrote: »
    Excuse my ignorance, but if you now the level at which the volume is; how that helps to ramp the volume up or down.

    i don't understand...

    You have to build your own volume up/down routine, and use the VOLMxx command to send it to the LCD tv...
  • TonyAngeloTonyAngelo Code Monkey Posts: 315
    Here's an example:
    DEFINE_FUNCTION fnVolAdjust(INTEGER nArgZone, INTEGER nArgState)
    {
        STACK_VAR INTEGER nMyZone
        SWITCH(nArgState)
        {
    	CASE 1: // Up
    	{
    	    IF(nZoneGain[nArgZone]<stZones[nArgZone].MaxLevel)
    	    {
    		    nZoneGain[nArgZone]++
    		    IF(nArgZone<=6) // ZonePro 1
    		    {
    			SEND_COMMAND vdvDBX1, "'LEVEL=1:O:',itoa(nArgZone),':',
    			    itoa(nZoneGain[nArgZone])"
    		    }
    		    ELSE // ZonePro 2
    		    {
    			nMyZone = (nArgZone-6)
    			SEND_COMMAND vdvDBX2, "'LEVEL=1:O:',itoa(nMyZone),':',
    			    itoa(nZoneGain[nArgZone])"
    		    }
    	    }
    	}
    	CASE 2: // Down
    	{
    	    IF(nZoneGain[nArgZone]>0)
    	    {
    		nZoneGain[nArgZone]--
    		IF(nArgZone<=6) // ZonePro 1
    		{
    		    SEND_COMMAND vdvDBX1, "'LEVEL=1:O:',itoa(nArgZone),':',
    			itoa(nZoneGain[nArgZone])"
    		}
    		ELSE // ZonePro 2
    		{
    		    nMyZone = (nArgZone-6)
    		    SEND_COMMAND vdvDBX2, "'LEVEL=1:O:',itoa(nMyZone),':',
    			itoa(nZoneGain[nArgZone])"
    		}
    	    }
    	}
        }
    }
    

    nZoneGain is updated with the current volume level in the Data_Event. This function increments or decrements then sends the new level to the device. This is for devices with no vol+ or vol- commands, where you can only send a level. TO emulate a ramp, you track the vol level in a variable, then adjust that variable and send it to the device.

    Looking at this code now there are cleaner ways of doing it, but it gives you a general idea.
Sign In or Register to comment.