Firefly – TouchOSC Listener & Sender Control Interface

A demonstration of how to use the TouchOSC app to wirelessly control a servo on an Arduino connected to firefly / Grasshopper and how to use buttons connected to the Arduino to show feedback on the app. TouchOSC is an app available for iPhone, iPad and android devices that provides a customisable graphical user interface which can be used to wirelessly control our Grasshopper code and subsequently a connected Arduino. It can also be used to receive inputs from the Arduino with the result being displayed on the app. This can be used to create quick graphical interfaces to control our projects and show graphical feedback from them. This demo shows how to receive an input from the TouchOSC app via the OSC Listener module in firefly and also how to provide feedback to the app via the OSC sender module in firefly. [Note: Change the video quality to 1080p if you are having difficulty making out details] [UPDATE: I have been unable to get this code working on Rhino 6, if you wish to use it, the evaluation version of Rhino 5 can still be downloaded here under archive] 

WIRING & GRASSHOPPER / TouchOSC CODE

Tactile buttons – these buttons have a momentary action meaning that they are only connected while they are being pressed (which we change in code to be on or off with each press). They have 4 legs which are connected in 2 joined pairs so you will only need to access one leg of each pair, pay attention to the orientation in the diagram to distinguish the pairs. These (as with most buttons & switches) will require a resistor to function consistently, the resistor acts as a pull-down resistor by ensuring that a low (GND) signal is always present unless the button is pressed and a high (+5V) signal overrides the resistor.  [Button 1 Pin1 → 5V,  Pin2 → D2,  Pin2 → 10kΩ → GND] [Button 2 Pin1 → 5V,  Pin2 → D4,  Pin2 → 10kΩ → GND]  [Button 3 Pin1 → 5V,  Pin2 → D7,  Pin2  → 10kΩ → GNDServo motor SG90 9g – servos have 3 wires, 2 for power and a single data pin. [Servo Red → 5V,  Brown → GND,  Orange → D9]


 

0 Comments

Submit a Comment

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

ADDRESS

BRISBANE,
QLD, AUSTRALIA

CONTACT

NEWSLETTER

Sign up to recieve my newsletter