algorithmic modeling for Rhino
Hello Firefliers,
Any chance to add Arduino Leonardo support? I know the serial changed on this board. Now the USB serial is not the same as the TTL, meaning that we would need a serial to usb adapter (FTDI cable?) to get this over the serial port. I guess one could also tap into the CDC driver. Is this something you have considered?
Thanks!
Luis
Tags:
Hey Luis,
I definitely want to add support for the new Leonardo. I bought one recently, I just haven't had a lot of time to test it out. Your right that the USB serial connection has changed a bit. Since I haven't had a chance to thoroughly test the Leonardo out just yet... I can tell that there are probably going to need to be a few minor changes (and potentially a few big changes). The minor changes will probably need to address the fact that a sketch doesn't 'reset' itself upon opening a serial port. This means that anything in the setup() function wont be initialized, and the serial communication might not work properly. It doesn't look like it's too hard to fix (just by adding a new while loop to check if the serial stream is open or not). But, this needs to be added to the Firmata. Some of the potentially bigger changes will deal with the fact that all 20 pins can be used for digital input and output. In addition, some of the digital pins can also be used for analog input (bringing the total analog inputs up to 12 using the Leonardo). This could potentially be really useful, especially if you could simply click on a pin in Grasshopper and tell it if you want it to be used as an analog or digital input. However, this opens up a lot of challenging tasks. Since the code would already be loaded onto the board, it would need to be able to respond to dynamic pin changes (which at the moment doesn't really happen, except for the different states for digital, PWM, and servo outputs... but in general those are all still outputs). I need to think a bit about the best way to approach this problem. Any suggestions would be greatly appreciated.
In general, I think the Leonardo can be used very similar to older boards. So, I think you could still use it with the current version of the Firmata... although I haven't had a chance to test it... and as I said, I may need to add a few lines of code just to get the serial connection established upon opening the port. I'll try to give this a look over the next week and provide some feedback. As always your input is appreciated.
Cheers,
Andy
Yes, I tried the UNO firmata, but again the Serial issue will not be solved unless I use a FTDI cable on pins 0,1 on the Leonardo (I guess). The Firmata does not work with the Serial class at the moment. Unfortunately my leonardo is not with me at the moment to keep testing, but will have access next week.
Hey Luis,
did you get it working? Am trying to use a Arduino Micro with Grasshopper, but I actually don't know how...
Greets
Benjamin
Hi Benjamin... I'm not sure the firmata will work with the Micro because its pin configuration is different than a standard arduino or the mega. You could modify it to suit your purposes though...
Hi Andy,
thanks a lot for the quick respond. But how exactly would I modify it? Should I solder some extra pins on it? Or utilize an FTDI cable?
Maybe it would be best to use the generic serial connection? Not as easy as the Arduino Uno Read / write components, but sure teaches you a lot about how to set up your own communication protocol...
Hi Luis,
so is it possible to use the Firefly "open port" and "write generic serial" - components if the firefly firmata doesn't work? Somehow Grasshopper crashes when I try that. Or do you mean not to use Firefly at all and upload from the Arduino software?
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
© 2024 Created by Scott Davidson. Powered by