The send value function broadcasts
string/number pairs. You can use a second Calliope mini to receive them,
and then send them directly to the serial port with write value
.
Write a name/value pair and a newline character (\r\n
) to the serial port.
serial.writeValue("x", 0);
Every 10 seconds, the example below sends the temperature and light level to the serial port.
basic.forever(() => {
serial.writeValue("temp", input.temperature())
serial.writeValue("light", input.lightLevel())
basic.pause(10000);
})