EXTERNAL EMAIL : Exercise caution when responding, opening links, or opening attachments.
--
You received this message because you are subscribed to the Google Groups "Bonsai Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bonsai-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bonsai-users/f0f53dd6-4095-4b69-bb58-e8e199c524cen%40googlegroups.com.
Hi Paolo,
As far as I know there are different ways to do what are you trying to do. You can use the digital output node in Bonsai with fermata protocol uploaded on your Arduino to drive a pin on HIGH and use that pin to drive a second Arduino (with a frequency defined loop and an if statement [if digitalRead(Pin x == High)]. I personally don’t like using Arduino with fermata protocol. Another possibility is to set a function generator node in bonsai to define the desired frequency. Moreover, you can change the digitalWriteCallback function in the fermata protocol to generate a simple stimulation (I believe most of these topic are already covered in previous threads).
The option that I like is to send from bonsai a String (with the serial string write node) an let Arduino do the rest. In your Arduino sketch you can Serial.readStringUntill(‘\n’) and with an if statement (if == “x”), drive the frequency loop. You may want to set a millis() timer to drive the stimulation for a specific amount of time or a counter for a specific number of times.
But of course it depends on your goal and your experimental setting.
G
To view this discussion on the web visit https://groups.google.com/d/msgid/bonsai-users/CAPfi2QFg%3D7WxNg0%3DULiuf1C3Z3xZT7-uwDVV_A%2BjcYNNcCZUzw%40mail.gmail.com.
Of course I meant “Firmata” but my laptop didn’t like the word 😉