Home AMX User Forum AMX General Discussion
Options

Presets feedback

What is the best way to get a feedback to the presets buttons base in the actual tuner feddback? I'm working with a Yamaha 2500 receiver using the amx module. There is variable that stores the returned feedback for the tuned frequency.
CASE 'TUNE=':  cFREQ=DATA.TEXT
                             IF(nAudio==1) SEND_COMMAND dvTP,"'@TXT',nBUTTONS[96],DATA.TEXT,cBAND[bBAND+1]"


I have 12 presets buttons and I would like the presets buttons to light up when the frequency value of the variable, matches the frequency stored in a particular preset.

Comments

  • Options
    flcusat wrote:
    What is the best way to get a feedback to the presets buttons base in the actual tuner feddback? I'm working with a Yamaha 2500 receiver using the amx module. There is variable that stores the returned feedback for the tuned frequency.
    CASE 'TUNE=':  cFREQ=DATA.TEXT
                                 IF(nAudio==1) SEND_COMMAND dvTP,"'@TXT',nBUTTONS[96],DATA.TEXT,cBAND[bBAND+1]"
    
    

    I have 12 presets buttons and I would like the presets buttons to light up when the frequency value of the variable, matches the frequency stored in a particular preset.

    Try something like
    FOR(i=1;i<=LENTGTH_ARRAY(cMyFrequencies);i++)
      {
      IF(COMPARE_STRING(cFREQ, cMyFrequencies[i])==1)
        {
        OFF[dvTP, nMyTunerButtons];
        ON[dvTP, nMyTunerButtons[i]];
        BREAK;
        }
      }
    

    make sure cFREQ is actually in the same format as the array with your Freqs.
  • Options
    alexanboalexanbo Posts: 282
    You could do it a bit more compact if you said for the code inside the loop

    [dvTP, nMyTunerButtons] = COMPARE_STRING(cFREQ, cMyFrequencies)

    You might need to be aware of the format the frequency comes out as and make sure you're storing your frequencies the same way, such as the difference between AM and FM frequency feedback.
Sign In or Register to comment.