The message monkey visualizer sends a sequence of serial messages to a connected device. This page describes the methods implemented by the Monkey class in the MegunoLink Arduino library to send commands to set the state of message monkey triggers.

Message monkey trigger example
Triggers help synchronize interaction between the message monkey visualizer and your Arduino sketch.

Method Descriptions

The functions and parameters for the Monkey class are described. Optional parameters are surrounded by []‘s. Printable parameters support any type that can be passed to Print::println(…) including all basic types and classes inheriting from Printable.

Monkey Constructor

Constructs a Monkey variable, which can be used to send commands to MegunoLink to set and clear message monkey triggers.

Monkey(Print& Destination = Serial)
Monkey(char const* Channel, Print& Destination = Serial)
Monkey(__FlashStringHelper const* Channel, Print& Destination = Serial)

Parameters
Name Type Required? Description
Channel const char *, const __FlashStringHelper No The name of the destination channel for message monkey commands. Defaults to the broadcast channel (NULL).
Destination Print & No Sets the serial connection to use for sending messages to MegunoLink. Defaults to Serial, the default Arduino RS232 port.

SetTrigger

Sets a named trigger to the triggered state allowing any await-trigger waiting on, or subsequently encountering, the trigger to continue.

SetTrigger(TriggerName)

Parameters
Name Type Required? Description
TriggerName Printable Yes The name of the trigger to set. Any type that can be passed to Serial.print(…).

ClearTrigger

Sets a named trigger to the un-triggered state. Any await-trigger command in the monkey missive will block until the trigger is set. A manual reset trigger is automatically created if it doesn’t already exist.

Auto-reset triggers will clear automatically when read. A separate clear command is not required.

ClearTrigger(TriggerName)

Parameters
Name Type Required? Description
TriggerName Printable Yes The name of the trigger to clear. Any type that can be passed to Serial.print(…).

Start typing and press Enter to search