Hello -

NetLogo can communicate with an Arduino board, and the sketch that is running 
on it, using the arduino extension.

Can I ask you some questions to diagnose your problem?  

First, have you found the arduino extension, and can you get the sample model 
to communicate with the corresponding sketch?

If that works, you can turn the built-in LED on and off.  If you open the code 
in the BUTTON and the corresponding procedure in the CODE tab, you will see 
that you are sending a “1” or a “0” to the arduino.  Does this make sense?

If you then open the Arduino sketch, you will see that it reads the serial port 
(which is how NetLogo communicates).  It then looks to see whether it gets a 0 
(and then sets pin 13 to LOW), or ‘anything else’ (and then sets the pin to 
HIGH).  Does this make sense?

If you want to turn an insertable LED on and off, you can test it by putting it 
in pin 13 (long leg of LED) and the nearby ground GND pin (short leg of LED).  
Does that work?

If you want to make it work on a different pin, you just need to change the 
hardware setup and also change the Arduino sketch logic to work with a 
different pin than 13.  Does that work?

If I know where your problem comes up in the above sequence, and/or what 
doesn’t make sense or work, then I can help you find and address the issue.

Thanks,
-Corey




On May 5, 2016, at 10:24 PM, mostcrazygirle...@gmail.com wrote:

> hi 
> how can i turn-on/off a led connected to arduino by sending the order from 
> netlogo? 
> the code arduino it's ok but i have broblem in code netlogo
> thank you
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "netlogo-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to netlogo-devel+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"netlogo-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to netlogo-devel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to