EasyManua.ls Logo

Keyestudio 4WD - Page 346

Keyestudio 4WD
369 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
346
www.keyestudio.com
Click“JavaScript" to switch into the corresponding JavaScript code:
① The "on start" command block runs only once to start the
program.
②Connect the IR receiver to P9
③Set the variable val to 0
④Set the variable val2 to 0
⑤In the "forever" instruction box, the program runs cyclically
⑥Set val to IR button
⑦ When the variable val ≠ 0 is established, execute the
program under then
⑧Set variable val2 to val
⑨When val2=70 is established, execute the program under
then
⑩The car goes forward
⑪When val2=68 is established, execute the program under
then
⑫Turn left
⑬When val2=67 is established, execute the program under
then
⑭Car turn right
⑮When val2=21 is established, execute the program under
then
⑯The car goes back
⑰When val2=64 is established, execute the program under
then
⑱The car stops