Building a simple live mode extension


#1

I am trying to create a new block that reads analog input from a port on the mblock ranger. The code should work in live mode. This is my code but this always returns Null.

async (args, app, device, block) => {
const portMap = {
    "Port6": 6, "Port7": 7, "Port8": 8, "Port9": 9, "Port10": 10
};

const slotMap = { "W1": 1, "W2": 2 };

const port = portMap[args.port];
const slot = slotMap[args.slot];

if (port === undefined || slot === undefined) return 0;

return await device.asyncReadSensor("analog", port, slot);

}


#2

hello @dvderels, I’m trying to create live mode for my device, were you able to make it live, did it work for you? In which part of the settings on the development platform can I configure my device for live mode?