I am trying to join these two programs but it is not working

My first code turns on and off something so I want that to show In the planner and I always want the voltage reader to show in the planner.
// input class for Power control channel (from HTML IN)
/****ON AND OFF CODE/
class power_input extends InputPort
{
name = "Power On"
type = “number”

function set(value)
{
// update the display

    server.show("Power On");
    
    imp.sleep(2);
    hardware.pin8.configure(DIGITAL_OUT);
    hardware.pin8.write(1);
    imp.sleep(2); 
    hardware.pin8.configure(DIGITAL_OUT);
    hardware.pin8.write(0);

}
}

class power_off extends InputPort
{
name = "Power Off"
type = “number”

function set(value)
{
// update the display

    server.show("Power Off");
    
    imp.sleep(2);
    hardware.pin7.configure(DIGITAL_OUT);
    hardware.pin7.write(1);
    imp.sleep(2); 
    hardware.pin7.configure(DIGITAL_OUT);
    hardware.pin7.write(0);

}
}

class power_cup extends InputPort
{
name = "Power for one cup"
type = “number”

function set(value)
{
server.show(“Power for one cup”);
imp.wakeup(2, function() {
hardware.pin8.configure(DIGITAL_OUT);
hardware.pin8.write(1);
imp.wakeup(2, function() {
hardware.pin8.write(0);
imp.wakeup(20, function() {
hardware.pin7.configure(DIGITAL_OUT);
hardware.pin7.write(1);
imp.wakeup(2, function() {
hardware.pin7.write(0);
})
})
})
});
}
}

imp.configure(“CoffeeControlCenter”, [power_input(), power_off(), power_cup()], []);
/************VOLTAGE READING CODE *********************/
hardware.pin5.configure(ANALOG_IN);

local voltage = hardware.voltage();
server.log(format(“Running at %.2f V”, voltage));

local lastRawValue = 0;

server.log(“Hardware Configured”);

function checkPot() {
local rawValue = hardware.pin5.read();
if (math.abs(rawValue - lastRawValue) > 150) {
local potValue = rawValue / 65535.0;
lastRawValue = rawValue;
// note that we divide by 65535.0 to get a value between 0.0 and 1.0
server.show(potValue);
out_pot.set(potValue);
}

imp.wakeup(0.01, checkPot);

}

server.log(“Potentiometer Started”);
checkPot();

I want it to show on and the voltage at the same time

You need to store the voltage somewhere (eg in a global) and then when you print your string, format it, eg:

server.show(format(“on, voltage=%f”, globalVoltage));

where can i read up on this I don’t really understand this