Block setting question, please help!


#1

Hello~

Does anyone know what should I put inside the “servo_9.write()” if I want to set an angle value to the servo_9?
I tried to put the parameter name and the default value, but none of them works.

Thanks!!


#2

No matter how I change the servo value, the arduinoC code on the right always stay the same.
servo_9.write(TestServoAngle)


#3

Hi jxsun, you declare a parameter name called TestServoAngle to save the user input in the “block setting page” while, in the “transcoding” page, you didn’t call the parameter name correctly. The right way to do it is shown below:

you put the parameter name inside a “commented” curly bracket.

and the result is:

We have instructions and demos showing this specific way of using parameter that take the input value. Please refer to the guide: http://www.mblock.cc/doc/zh/developer-documentation/tutorials/add-led-light-to-arduino-uno.html


#4

Thanks to you also helped me.
Thank you very much.