Hi!
Could you provide the following information?
- What OS (Windows, macOS) and version are you using?
- What version of mBlock are you using? (Or are you using the Arduino programming environment?)
- Is your computer connected to the mBot Ranger via USB cable?
- Have you connected to the USB cable from the Connect->Serial Port menu?
- Are you sure you are using the correct COM port (if on Windows)?
Uploading code to an mBot Ranger requires that you be connected via USB cable. You cannot do this over Bluetooth or Wifi because those modules do not have access to the onboard avrdude programmer.
Also, be aware that running a program over Bluetooth, Wifi, or even the USB cable is not uploading the program, it is merely executing the program within the mBlock environment which sends action codes over the serial connection to the onboard firmware. Uploading a program requires the use of the Auriga Program hat block and will invoke the embedded Arduino compilation environment to compile and upload the code to the mBot Ranger.
To restore the default program:
- Connect the mBot Ranger with the USB cable.
- Select the serial port from the Connect->Serial Port menu item.
- Select the Connect->Reset Default Program menu item
Hope this helps.
Chuck