algorithmic modeling for Rhino
Hi, I'm sorry for crossposting but the Fireflyexperimetns forum seems to be very quiet now. I'm trying to send a serial command using Firefly and Arduino UNO to SSC-32U servo controller. SSC-32U accepts ASCII code, e.g. #0 P1000 T2000 (rotate servo no. 0 to position 1000 in 2 seconds). This works for Arduino:
void setup(){
Serial.begin(9600);
}
void loop(){
Serial.println(“#0 P1000 T2000”);
}
but doesn´t when sent from Firefly, see attached image.
What am I doing wrong?
Tags:
Sorry Marcin for the delay. I would recommend trying to send just the "#0 P1000 T2000" command instead of the entire program. You'll also want to make sure you use the same baud rate in your sketch as in the Grasshopper definition. Right now, you're using 9600, but the default baud rate for the Open/Close component is set to 115200. I don't know what sketch you need to upload to your Arduino board, because theoretically the Grasshopper Generic Serial Write component will essentially be calling the same Serial.println() command when you send data from it... So, theoretically just writing the appropriate data (with the right baud rate) should work. If it doesn't, let me know and perhaps I can help you modify the appropriate arduino sketch.
Thank you for your reply. Unfortunately sending just the command '#0 P1000 T2000' and setting the baud rate to 115200 (or 9600) on the Open/Close component doesn't work either. Anyway, for the code to work I have to set the SSC-32U baud rate to 9600, as I'm doing in my Arduino sketch. I found a way around in Firefly by controlling my servos from the Arduino and powering them from the SSC-32, but it would be neater to be able to use the logic from the SSC-32U. Is the Generic Serial Write component suitable for what I'm trying to do?
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by