Skip to content
Christopher Konopka edited this page May 7, 2019 · 1 revision

Widget

arduivis-widget

  • i (inputs) - The number of inputs, going from Max to Arduino
  • o (outputs) - The number of outputs, going from Arduino to Max
  • create - Create a new arduivis instance based on the number of i/o's
  • code - View generated Arduino code
  • save - Save new Arduino code
  • clear - Clear arduivis instance and generated code

Generated Max patch and Arduino code

arduivis-codegen-export

Max patch

arduivis-codegen-max

Arduino code

arduivis-codegen-arduino

Max patch

arduivis-codegen-max

Board setup

arduivis-codegen-boardsetup

update - Update the [umenu] with available boards.

umenu - Select the board.

Input parsing

arduivis-codegen-inputparse

[pak] - Pack data streams into a single data packet. Each item to be packed equals a line for Serial.parseInt() within the Arduino sketch.

Example:

arduivis-codegen-inputs

[qmetro] - Master clock for controlling the flow of data between Max and the Arduino. The slowest rate available is 50 milliseconds, going below that will cause the Serial buffer to back up.

[atoi] - Converts the incoming [pak] data from ASCII to an int so the Arduino can read it. Send data to the rightmost inlet of the [atoi] object; incoming data waits until being triggered by the [qmetro] pulses going to the leftmost inlet.

[append 10] - Adds a carriage return to the newly created int, creating a single data packet that can be read by the Arduino via the Serial.parseInt() function versus being interpreted as a stream of chars.

Output parsing

arduivis-codegen-ouptutparse

[sel 13 10] - Receive a data stream through [serial] and from the Arduino. The rightmost outlet loads the [zl group 1000] object with a data packet. Every time a carriage return is detected, the leftmost outlet triggers the [zl group 1000] object. Data does not move to [iota] until a carriage return triggers it.

[zl group 1000] - Output a list after N items are received. The number 1000 determines the largest data packet it will output. The large number is used as an output buffer as to not choke the output stream from [serial].

[iota] - Converts integers to UTF-8 (Unicode) characters that acts as a symbol.

[fromsymbol] - Convert a symbol into numbers/messages.

[unpack] - Break the stream of data into individual messages.

Example

arduivis-codegen-outputs

Clone this wiki locally