According to the beautiful examples of behavior (dance, curious_position, …) embedded with the Snap! version of my PoppyErgoJr, I guess there must be a way to control the LEDs of the servos.
But how ?
Q1 : what is the pypot procedure to control the LEDs ?
Q2 : when making a new block in Snap!, can we use python instead of javascript ?
From pypot, you can simply do something like:
for m in poppy.motors:
m.led = 'red'
You can choose among [‘red’, ‘yellow’, ‘green’, ‘purple’] (I’m missing one I think) and ‘off’.
I’m not sure to understand what you means. Actually Snap blocks are written in Snap. The way to communicate with Pypot is using HTTP requests that “triggers” behaviours on the Python web server. Does that answer your question?
Ok, that’s perfect, thank you !
Unfortunately, it must because it’s very foggy in my head (even though it’s getting clearer everyday, thanks to your support ).
I would like to make a new block (guess what : “light a LED”), and the only way I managed to write code (instead of all-made blocks) was of course in javascript.
I tried to edit your personal blocks, such as :
I understand that you’re calling a script located on the Pi, but I didn’t managed to find it.
If you think it’s getting too hard for me, just say it, Pierre, I don’t have many skills in programming and I know it ! (By the way, thanks again for all your patience with us)