cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
86
Views
0
Helpful
0
Replies

GPIO Code for Codec Pro

tylergriffin
Level 1
Level 1

After some very long hours, many you tube videos, and reading countless pointless forums. I completely gave up looking for help and decided to start from scratch. Trial and error my friends! For all looking to control a projector screen based on Standby Status here you do. Screen goes up on Pin3 when the system goes into standby. Screen comes down when the system wakes up. 

import xapi from 'xapi';

function screenControl(Standby)
{
  if (Standby == 'Off')
  {
    xapi.Command.GPIO.ManualState.Set(
      {Pin3: "Low", Pin4: "High" });
  }
  else
  {
    xapi.Command.GPIO.ManualState.Set(
      {Pin3: "High", Pin4: "Low" });
  }
}
xapi. Status . Standby . State .on(screenControl)

0 Replies 0