Firefly – XYZ Dimension 3D model with Joystick & Pot
A demonstration of how to dimension a 3D rhino model in XYZ using a joystick and potentiometer connected to an arduino through grasshopper / firefly. This demo shows how to generate and dimension a rectangle / cube in Rhino and highlights the name of the Grasshopper modules used. First the analog input values from the X and Y joystick axis are remapped (remap numbers module) from 0-1023 (analog range) to suitable dimension values. The remapped values are run through an integer module to remove decimals and input into a rectangle module (along with a start position) to generate a rectangle in Rhino. The same process is repeated with the analog input from the potentiometer (z axis) and input as a height into a box rectangle module. [Note: Change the video quality to 1080p if you are having difficulty making out details]
WIRING & GRASSHOPPER CODE
Joystick module KY-023 – contains 2 analog potentiometers (X axis and Y axis) and a button. [Joystick GND → GND, (+) → +5V, VX → A0, VY → A1] Potentiometer B10kΩ – this is a variable resistor with 3 pins (2 outer pins for power and a middle pin for output). Typical values used with the Arduino are 5kΩ – 100kΩ and come in linear (B) style which is the most common and logarithmic (A) style often used for volume control. They have a continuous analog output (0 – 5V) and are read as values 0 – 1023 by the Arduino. [Potentiometer Pin1 → 5V, Pin2 → A2, Pin3 → GND]
0 Comments