You can test for the presence of “connection” with this approach:
The code above will use connection.sendMessage() when running on the display module but will use console.log() when running on the PC.
You can test for the presence of “connection” with this approach:
The code above will use connection.sendMessage() when running on the display module but will use console.log() when running on the PC.