In search for the holy grail in TV volume control

[/codevoid loop() {

for (int i=1;i<=75;i++){
  irsend.sendSAMSUNG(POWER, SAMSUNG_BITS);
  delay(100);
}
  delay (5000);

}//end of loop
]

The above told me that I have reached my limit in programming.... So, the pro's should take over

When I fire this code, the TV displays 100% bar with the volume increasing a "chunk" at a time  i=75 very arbitrary number.

Here is my ambitious target.

1. what parameter that takes me from 0 to 100% The reason for that is to help me to know when the loop is increasing the volume in [b]relation to the 100% reference[/b] "the parameter" I hope I explained it clear  enough. 

Why I need this ? Since the TV cannot feed back WHERE the volume is I have to find it this way.
Of course I am assuming my approach is valid one

2. The ultimate is to send commands to the TV to increase volume in preset "chunks"  say Vol up 25%


I will stop here waiting for your comments before I explain the next challenging job which is Auto control the Vol to a specific Target Volume level.

fix the post

It's not at all clear to me what you're asking.

What I have done to deal with the lack of volume level feedback is to periodically send the volume down signal repeatedly enough times that, even if the volume had been at max, it would now be at zero. Once you hit zero, further attempts to lower the volume do nothing, so now the volume is at a known level and then it can set the volume to preset levels relative to that zero point. This volume sync is done before the stereo is automatically turned on as my alarm clock each day. In my system, it's probably not necessary to do it so frequently since the volume changes are always tracked, but it is possible for it to get out of sync if the volume was manually changed, etc. It's convenient to do it before the alarm goes off because it takes a little while to do the sync but I won't notice while I'm sleeping.

Let us take it one step at a time. We will need to start from a reference point. Your reference point is 0%
Let us assume that When you open your device you know it is at zero %

My comfortable level is x%. So now we need to program two things

  1. routine to get the device to zero % when you initiate the switch off routine the device that trigger the switch off routine will include forcing the volume to zero.

  2. routine to get the volume to x%... Let us focus on this one. How can we do it.??

My digital tuner takes time to start playing. In that time I can lower the volume. I can turn on my TV with direct channel selection to channel or aux input with no sound and lower the sound to zero before changing to a station with sound.

And to lower the volume from unknown volume, you simply send volume down so many times how many steps are from full volume to zero. Then you know you are on zero.