Arduino + Rhino + Grasshopper + Firefly

For me this is finally the wow moment. Today I have made the connection between all my Arduino experiments and the latest work I’ve been doing in Rhino. This video shows a very simple Arduino circuit featuring nothing more than a potentiometer (basically like a volume knob). Rather than writing code within the Arduino IDE as per normal, you can actually load an add-in for Grasshopper called Firefly, which will allow you to build code through the normal Grasshopper graphic interface. As a designer, not a coder, this really makes a lot more sense to me!

I’ve then added the Arduino to my previous Grasshopper model (check it out here), allowing the heights of the hexagons to be controlled by turning the potentiometer, and dividing the area of each hexagon by a function of this reading. The attractor points still also modify the model when dragged, so if I had some more potentiometers I could potentially control the location of these as well and creat a model that is easily modified using hardware external to the computer. Very cool!

As yet I’ve had no real luck finding any tutorials for Firefly so I think I’ll be making it up as I go from now on. If anyone does have some good links, please leave me a comment.

– Posted by James Novak

Advertisements

Arduino 102

150329 Arduino ProjectsFinally another chance to spend some time learning my new Freetronics Eleven (aka. Arduino). Some of the basics are starting to sink in, the project guide that came with the kit is actually quite good at explaining the reasons why certain things must be done for both hardware and software. The projects pictured above are:

  1. Project #4: using a light sensor to dim an LED.
  2. Project #6: controlling a servo.
  3. Project #6 Customised: adding an LED that turns on when the servo spins in one direction, and off in the other.

Again not the most exciting projects, but at the moment it’s all about making sense of this ‘new world.’ I have included the code for the custom project #6 if you want to build it yourself.

int led = 13;
int delaytime=5;
int angle=0;

#include <Servo.h>
Servo myservo;

void setup()
{
  myservo.attach(11);
  pinMode(led, OUTPUT);
}

void loop()
{
  while (angle <=180)
  {
      myservo.write(angle);
      delay(delaytime);
      angle = angle + 1;
      digitalWrite(led, HIGH);
  }
  while (angle > 0)
  {
      myservo.write(angle);
      delay(delaytime);
      angle = angle - 1;
      digitalWrite(led, LOW);
  }
}

Happy hacking!

– Posted by James Novak

Arduino 101

150324 Arduino ProjectsFor something new outside the normal 3D printing stuff I post here, I have now started experimenting with the Freetronics Eleven Kit (essentially an Arduino). This has been something I’ve wanted to try for a long time now, and I’ve finally found an excuse through my PhD research to make time to learn about the electronics and coding of this system. Admittedly I feel like a child when it comes to my knowledge of circuits, so I’m starting out nice and simple!

Pictured above are photos of the first 3 projects supplied with the kit:

  1. Firstly creating a basic LED circuit with coding to control blinking.
  2. Controlling 8 LED’s and using coding to control a ‘scanning’ effect progressing through the LED’s.
  3. Adding a button to allow pausing of the LED’s during scanning (reminds of of arcade games where you have to stop the lights in a certain spot to win a prize).

Now I admit it’s far from exciting like a robot would be, but for someone with no electronic skills it’s a great way to get started with an understanding of both circuitry and coding. As a designer used to using 3D modelling tools to produce what I imagine, using text-based code to control this is quite a side-step, requiring a new way of thinking. But what I like about the Arduino is the community surrounding it – there is a tutorial and free code for almost anything you need to create. I don’t know how well I’ll pick it up, but it’s great to begin learning something totally new! Stay tuned, I’m sure there will be some 3D printed enclosures or something coming very soon.

– Posted by James Novak