Firefly – Move 3D Model With Joystick & Pot

A demonstration of how to change the colour of a 3D rhino model using buttons connected to an arduino through grasshopper / firefly. This demo shows how to create a basic shape in rhino and highlights the name of the modules used. First the analog input values from the joystick (X & Y axis) and the potentiometer (Z axis) are remapped using the 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 then fed into a vector XYZ module which creates a dimension vector value. This vector value is in-turn fed into a move module along with the 3D rhino model linked to a geometry module. To change the colour of the model a custom preview module is used together with a colour swatch module. [Note: Change the video quality to 1080p if you are having difficulty making out details] 


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]



Submit a Comment

Your email address will not be published. Required fields are marked *





Sign up to recieve my newsletter