yoelk / instrumentino

Instrumentino is an open-source modular graphical user interface framework for controlling Arduino based experimental instruments
GNU General Public License v3.0
137 stars 59 forks source link

Arduino sketch #2

Closed 1am closed 9 years ago

1am commented 9 years ago

Hi,

You seem to be using Eclipse to build Arduino firmware required by Instrumentino but I've pasted the https://github.com/yoelk/Instrumentino/blob/master/controlino/controlino.cpp into Arduino editor and compiled succesfully. The problem is that the resulting firmware doesn't fit on an Arduino Decimalia with ATMega168. Is there a simple way to strip down the firmware to make it do the bare minimum? I see that there's a PID library which is probably not necessary for simple use cases?

yoelk commented 9 years ago

Yes, I recently added support for PID.

I think the generic solution would be to use #ifdefs around the usage of different libraries. If you do it, please send me the revised file.

Also, I currently support the Arduino Nano and Mega controllers, as I've never used other ones (see the define statements on the top of the file). You'd need to add comparable define statements for the Decimalia Arudino.

Again, please send me the revised file, or consider becoming a fellow developer and get write permissions on GitHub.

On Thu, Nov 6, 2014 at 5:30 PM, Piotr notifications@github.com wrote:

Hi,

You seem to be using Eclipse to build Arduino firmware required by Instrumentino but I've pasted the https://github.com/yoelk/Instrumentino/blob/master/controlino/controlino.cpp into Arduino editor and compiled succesfully. The problem is that the resulting firmware doesn't fit on an Arduino Decimalia with ATMega168. Is there a simple way to strip down the firmware to make it do the bare minimum? I see that there's a PID library which is probably not necessary for simple use cases?

— Reply to this email directly or view it on GitHub https://github.com/yoelk/Instrumentino/issues/2.

1am commented 9 years ago

Sure, I'd like to help out. Depending on the time I'll have available which is a bit tough :) Do you have a rough outline of the protocol used for communication? Decimalia is pretty old but I've got a few of them laying around so i took one. It actually doesn't even fit Firmata firmware. I'll try later with an Uno

yoelk commented 9 years ago

Great! Which protocol are you referring to?

On Thu, Nov 6, 2014 at 5:39 PM, Piotr notifications@github.com wrote:

Sure, I'd like to help out. Depending on the time I'll have available which is a bit tough :) Do you have a rough outline of the protocol used for communication? Decimalia is pretty old but I've got a few of them laying around so i took one. It actually doesn't even fit Firmata firmware. I'll try later with an Uno

— Reply to this email directly or view it on GitHub https://github.com/yoelk/Instrumentino/issues/2#issuecomment-62008229.

1am commented 9 years ago

I'm referring to messages used for communication between the Instrumentino and Arduino firmware. From looking briefly at the Arduino source file it receives and sends some commands from/to Instrumentino.

yoelk commented 9 years ago

It's very simple, and I think it's explained in one of the files or documents. The Arduino is always waiting for commands, which are recognized by the terminating '\r'. Then it compares the first word and chooses the right function to use. The parameters of each function are listed in the comment above them. In return, the Arduino sends a "done" reply, after any other relevant data (like the values of input pins) was sent. e.g. Instrumentino: "Write 5 digi 100" Arduino: "done"

or

Instrumentino: "Read D5" Arduino: "100 done"

This protocol actually limits the read time resolution because of serial timeout values. I mean to extend it so the Arduino will constantly send the values he was told to send and in the meantime wait for other commands. But I haven't had the time yet to do that.

On Thu, Nov 6, 2014 at 5:44 PM, Piotr notifications@github.com wrote:

I'm referring to messages used for communication between the Instrumentino and Arduino firmware. From looking briefly at the Arduino source file it receives and sends some commands from/to Instrumentino.

— Reply to this email directly or view it on GitHub https://github.com/yoelk/Instrumentino/issues/2#issuecomment-62009379.