home/ atoms/ arduino-vpt-serial-bridge

VPT exchanges sensor and actuator data with Arduino over serial using an id-plus-value format

VPT communicates bidirectionally with serial devices like Arduino, set up in the serial tab much like a MIDI device. Incoming sensor data must be prefixed with a single-letter identifier A–H then a space and the value (e.g. ‘A 678’ for an analog reading, ‘B 1’ for a digital pin); VPT maps each identifier to a controller number, and the sensor module smooths jumpy input and rescales the raw min/max (default 0–1024) to VPT’s 0–1 range. For output, the router maps VPT controllers to serial outs s1–s8, which VPT formats as ‘id value’ (e.g. ‘1 127’ for half PWM) so the Arduino can dim LEDs, switch outputs, or drive servos. This lets physical sensors control visuals and lets VPT control lights and motors.

Examples

Arduino sends ‘A 678’ from an analog sensor; VPT receives it on controller 1 and the router maps ctrl 1 to layer fade 0.–1., so proximity fades the projection. In reverse, an LFO on ctrl 1 to s1 (range 0–255) dims an LED.

Assessment

How must Arduino format one analog and one digital sensor value for VPT, and how does VPT format data it sends back out to control an LED or servo?

“To send sensor data from an arduino to VPT we need to format the data so VPT understands it. This is done by putting an identifier (A-H) in front of the data.”
corpus · vpt-8-documentation-hc-gilje-s-free-projection-tool · chunk 16