Grasshopper

algorithmic modeling for Rhino

Hello,

I have a program with four two-way faders controlling servos and LEDs that I'm having trouble perfecting. I need to find a way to start the faders offset from one another, so that one begins its cycle while the other three are dormant. When the first reaches its peak the next one should begin its cycle, and so on.  Currently I can only get them to function in unison. 

Is there a way to delay the start of the fader cycle? There is no on/off input in the two-way fader component and I don't know any other way to enable/disable the component.

This is all being exported to my arduino via code generator. Maybe I should just rewrite the code in the arduino program?

Views: 468

Attachments:

Replies to This Discussion

Can you upload the code that your getting?

My guess would be that adding a delay in the code would be the simplest thing to do.

Definitely, here it is. I'm not very experienced with writing code which is why I was doing it in Grasshopper

Attachments:

Two ideas and not having the hardware I cant relay test this (my experience is mostly guess and check only knowing enough to be dangerous)

1- in the code there are the lines

void setup() {
  Fader2_StartTime_0 = millis();
  Fader2_StartTime_1 = millis();
  Fader2_StartTime_2 = millis();
  Fader2_StartTime_3 = millis();
  Fader2_StartTime_4 = millis();
  Fader2_StartTime_5 = millis();
  Fader2_StartTime_6 = millis();
  Fader2_StartTime_7 = millis();

try giving the time you want in milliseconds so 1000=1sec?  for each fader between the ()

idea 2

if idea 1 don't work

in the void loop add the line

delay(1000);

with whatever time you want between each fader starting in the ().

it looks like it is all kinda happening at once so you might need to sort out which servo goes with which fader.


hope this helps

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service