Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: use rotary encoder to select digital inputs #20

Open
zas opened this issue Jul 7, 2020 · 1 comment
Open

Suggestion: use rotary encoder to select digital inputs #20

zas opened this issue Jul 7, 2020 · 1 comment
Labels
feature New feature request help wanted Extra attention is needed

Comments

@zas
Copy link
Contributor

zas commented Jul 7, 2020

I don't know what's planned for rotary encoder, but it would be great to have the option to use it as source selector.

With push button and addon B, it could be:

  • normal position, select between digital inputs
  • in pushed position, select presets

Together with volume potentiometer, it'd pretty near usual preamp features.

Of course an alternative use is as volume controller. Various options should be offered by default imho.

@zas zas changed the title Suggestion: use rotary encode to select digital inputs Suggestion: use rotary encoder to select digital inputs Jul 7, 2020
@dspverden dspverden added feature New feature request help wanted Extra attention is needed labels Apr 21, 2021
@zas
Copy link
Contributor Author

zas commented Dec 12, 2021

function changeSPDIF(id){
var data={};
data.len=3;
data.i2c=["0x82", "0x01", document.getElementById(id).value];
fetch("/addoncfg",{method:"POST",headers:{"Content-Type": "application/json"},body:JSON.stringify(data)});
}
is the code switching inputs inside the web interface

For AddonB, server side it is handled by

if( Settings.addonid == ADDON_B )
{
JsonObject root = jsonDoc.as<JsonObject>();
int len = root["len"].as<String>().toInt();
for( int ii = 0; ii < len; ii++ )
Serial.println( root["i2c"][ii].as<String>() );
currentAddOnCfg[0] = (uint8_t)strtoul( root["i2c"][0].as<String>().c_str(), NULL, 16 );
currentAddOnCfg[1] = (uint8_t)strtoul( root["i2c"][1].as<String>().c_str(), NULL, 16 );
currentAddOnCfg[2] = (uint8_t)strtoul( root["i2c"][2].as<String>().c_str(), NULL, 16 );
Wire.beginTransmission( currentAddOnCfg[0]>>1 ); //ADDONB_SPDIFMUX_ADDR
Wire.write( currentAddOnCfg[1] ); // regaddr
Wire.write( currentAddOnCfg[2] ); // data
Wire.endTransmission( true );
}

From that, I'm not sure how to proceed, I don't know enough about addons internals & input configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants