Why can't I find "set motor speed" block?


#1

Hello Everyone, Why can’t I find “set motor speed” block ??? I can’t see it in the block library anywhere. let me know. Thanks!


#2

Are the instructions in the section: Action you looking for?


#3

Hello Crackel, no. It’s not there, but it “should” be. It’s a block called Set Motor Speed and you can select which wheel motor and then set the speed. It’s needed for navigating obstructing obstacles… I’ve seen many sample projects using this code for Line Tracking plus obstacle sensing using ultrasonic sensor…

-Monique


#4

Hi Monique,

This is probably what you saw.
ttt

In my opinion, this is version 3 of mblock …

I use version 5.10. I believe Makeblock has tried to simplify the use of motors. I believe these are the instructions to look for. You will have to try to reproduce what you saw but with the new instructions.

The example dates back a bit.


#5

Hi Monique,

I converted the code quickly without improving it and it looks like that.
In principle, I would have used: my instruction # 1 but it reacted badly so I took another one.
line

Is this what you are looking for but better ???
If so, it is possible to improve the code. I remain available if you have any other questions. If not, I wait to understand better.

Michel


#6

Hello Michel, thanks so much. I’ve been experimenting with various variations and finally landed on this. It worked last night and earlier today, but now it refuses to compile. It’s very strange. It was working more or list, but i tried to tweek the variables and now its crashing upon upload/compile. Any thoughts ?


#7

Btw, here is the compile error I’m getting "start processing code…

processing code by middleware of arduino_formatter

Arduino server connected.

Arduino compile…

variantPath:/app/src/external/arduino/avr-library/variants/standard

avr-toolchain/bin/avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10605 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -I"/app/src/external/arduino/avr-library/variants/standard" -I"avr-library/cores/arduino" -I"arduino-libraries/makeblock/src/" -I"arduino-libraries/makeblock/src/utility/avr/" -I"avr-library/libraries/Wire/src/utility/" -I"avr-library/libraries/Wire/src/" -I"avr-library/libraries/EEPROM/src/" -I"avr-library/libraries/SPI/src/" -I"avr-library/libraries/SoftwareSerial/src/" -I"arduino-libraries/arduino/WiFi/src/" -I"arduino-libraries/arduino/SD/src/" -I"arduino-libraries/arduino/Bridge/src/" -I"arduino-libraries/arduino/Temboo/src/" -I"arduino-libraries/arduino/Servo/src/" -I"arduino-libraries/arduino/Ethernet/src/" -I"arduino-libraries/arduino/TFT/src/" -I"arduino-libraries/arduino/SpacebrewYun/src/" -I"arduino-libraries/arduino/LiquidCrystal/src/" -I"arduino-libraries/arduino/GSM/src/" “/root/mblock-avr/temp/build/src/demo.cpp” -o “/root/mblock-avr/temp/build/src/demo.o”

Command failed: avr-toolchain/bin/avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10605 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -I"/app/src/external/arduino/avr-library/variants/standard" -I"avr-library/cores/arduino" -I"arduino-libraries/makeblock/src/" -I"arduino-libraries/makeblock/src/utility/avr/" -I"avr-library/libraries/Wire/src/utility/" -I"avr-library/libraries/Wire/src/" -I"avr-library/libraries/EEPROM/src/" -I"avr-library/libraries/SPI/src/" -I"avr-library/libraries/SoftwareSerial/src/" -I"arduino-libraries/arduino/WiFi/src/" -I"arduino-libraries/arduino/SD/src/" -I"arduino-libraries/arduino/Bridge/src/" -I"arduino-libraries/arduino/Temboo/src/" -I"arduino-libraries/arduino/Servo/src/" -I"arduino-libraries/arduino/Ethernet/src/" -I"arduino-libraries/arduino/TFT/src/" -I"arduino-libraries/arduino/SpacebrewYun/src/" -I"arduino-libraries/arduino/LiquidCrystal/src/" -I"arduino-libraries/arduino/GSM/src/" “/root/mblock-avr/temp/build/src/demo.cpp” -o “/root/mblock-avr/temp/build/src/demo.o” sh: 0: getcwd() failed: No such file or directory /bin/sh: 1: avr-toolchain/bin/avr-g++: not found

Failed to compile file src/demo.cpp

Arduino compile finish.

Arduino server disconnected.":


#8

Hi moniqua13,

There is no problem in the code, although I find it complex. It compiles and the robot executes it.

When the mBot has trouble, I import the Firmware again and upload the code again.


#9

Here is the simple code that works correct.


#10

Thanks for the response and recommending the solution. I see how the line following may work, but the ultrasonic sensor piece seems incomplete for obstacle avoidance. My solution seems to have more details instructions on how the ultrasonic sensor should avoid and maneuver around an obstacle on a track. Thoughts ?

-Monique


#11

There is no wrong solution.

It all depends on what is the goal. I saw in another post that the error was with the mBlock Web + mLink version … When Makeblock is back, they will certainly find the problem.


#12

Hello Crackel, thanks. what do you mean, “when makeblock is back”? I’m still having the upload, compile program and at a standstill with even the basics when it was all working before. I’ll keep investigating and posting until I get it resolved…

-Monique


#13

Makeblock support is based in China.

Between the Lunar New Year holiday and the coronavirus, it may be awhile until they are back to work.


#14

Oh…wow. That’s a good point. Thank you for your insights. Well, I have until 2/21 to get this figured out. We are preparing for Math and Science night at my daughter’s grade school. If everything works out, mBot and MakeBlock could get a lot of good publicity. There will be other robots there, probably not mBots and we were hoping to put on a good show.

-Monique

@tech_support


#15

Hi Monique,

It seems that the web version works quite badly. With the local version, everything works fine. When I go to the web version, I am not even able to download in the robot and my code is super simple.

I hope Makeblock will correct the problem before your party but if I were you, I would plan a plan B.

Maybe make your code and download it by a local version under a Windows version.
save

I had this type of surprise 1 or 2 times before a special event. I hope Makeblock will think of a web way to use an earlier version.


#16

Hi Monique,
It has been a few days since the last post. You may have gotten everything sorted out in the meantime, but I have combined the line follow code posted by Crackel and your object avoid code to create a combined line follow/object avoid robot.

I have also shared this code with the mBlock Community (https://planet.mblock.cc/project/161607).

To upload the program to your robot from the web based version you do need to have mLink installed.


#17

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.