Sunday, June 9, 2013

Individual contribution - Grasshopper development

To light up LEDs, grasshopper is definitely needed as a platform.
Based on Felix's code, I've added an VB script which ensures grasshopper works for the aim of interactivity by using the data received from Arduino .

Firefly setup.
Firefly is a plug-in of grasshopper, it is designed for arduino connection. It opens a port, which is exactly the one for arduino and reads data from it, activates grasshopper script with its ouptus.
VB script
This is the VB script that I created within grasshopper code to ensure that it is the Arduino which actually controls LEDs. Any received data will be placed in one of these ranges and of course each of them will light up different amount of LEDs

Full grasshopper script 


Screen shot of Rhino + grasshopper script

In this grasshopper script, we have a 2D grid at the back,  with different colors changing at all times and also another grid in the color of black in the front, covers the back. What people can see are those which are not covered up. The front grid has a fixed width , but its height is controlled by the VB script that is shown above. As I've mentioned in my ping sensor post, number is the only output, the large the number is, means the further the object is from the sensor. So here, the larger the number has been sent into VB script, the lower the black grid is, the more LED will be lit up . Another issue of this script is, it judges if any objects have been detected within the range of ping sensor. If it is, it will run the VB script that I've just explained, if it cannot detect anything, it will run a rainbow loop. It would be easier for you to understand by watching the video below :


I tested it with a very low speed of moving object away from the sensor is because I want everyone can clearly recognize that the color of the back grid is changing all the time when arduino is sensing . If it's not, it runs the rainbow flashing loop.



Grasshopper script : http://www.mediafire.com/download/g74c33123v6x8qw/final_design_developed.gh

No comments:

Post a Comment