Use WLED to control and configure the HDMILIGHTv2

Hi all
I have done the project hdmilightv2, link is here https://github.com/esar/hdmilight-v2 and https://hacks.esar.org.uk/hdmi-light-v2/ , It works well, but now can only change colour with the video, so I want to integrate the function into WLED as a usermod, in the usermod, I need to set the left, top, right and bottom pixel number, after save, it will use uart to send the number to hdmilightv2, also when next time power up WLED, change to usrmod, it also automatic send these pixel number again. when WLED change to othermod, it also work correctly. BTW, I will add a switch for WLED and hdmilightv2 to controll the pixel strip led. So can this workable, or could anyone give some advices, Thanks

Hi all
I have used the boblight for a reference, and change some code, I use the enable value, when enable==1, let a gpio output high, else the gpio output low, code is below. the problem is when I tick or untick the ENABLE in usermod page, I can get the correct log “ambictl enable” or “ambictl inactive.”, but I can’t get the right gpio output value, it is always output low, please help me thanks

  public:

    void setup() {
         ......
	  pinMode(SWITCHPIN, OUTPUT);

	  if (enabled)
	    digitalWrite(SWITCHPIN, HIGH); //
	  else
          digitalWrite(SWITCHPIN, LOW);
......

and the loop code

    void loop() {

	  if (millis() - lastTime > 1000) {
		lastTime = millis();
	    if(enabled)
		{
		  Serial.println("bi4wms: ambictl enable.");
      digitalWrite(SWITCHPIN, HIGH);		  
		}
		else
		  Serial.println("bi4wms: ambictl inactive.");
	    digitalWrite(SWITCHPIN, LOW);
	  }