mBot 1.1 Getting started: 4 questions


#1

Working on getting off the ground with 11yo son. I have extensive programming experience.

We are able to upload minimal Scratch-transpiled programs on a Mac via the mBlock application. Questions are:

  1. Is it ever possible to upload programs over BT or is program upload strictly limited to USB?
  2. When we issue sequential move commands, separated by delays, we only get one or the other. E.g.

move(2, 200);
_delay(1);
move(4,100);

Only the first move (backward) is executed. The length of the delay doesn’t seem to affect this behavior.

  1. Is it possible to log data to a visible console, e.g. to monitor the values of sensors? Is this doable without a USB connection (over BT, I guess?)

  2. Is there a recommendation for the 3.7V lithium-ion battery that doesn’t ship with the unit?

Thank you all!


#2
  1. No, neither the Bluetooth nor the 2.4G WiFi can access the onboard avrdude programming that does the actual upload.
  2. Using the program below, my mBot backed up and turned right:
  3. I haven’t done so, but there is a thread where another person said he had done it.
  4. I use the one from Adafruit for my older 1.0 mBots. There is a thread suggesting one that fits the plastic case for the 1.1 mBots.

#3

Hi Chuck,
Love your posts.

The key point here that I would like to point out is that when you send a movement command to mBot you must specify a WAIT afterwards otherwise it will not appear to have any effect. I learned from my mistake and your post has confirmed that.
I see that ‘free variation’ had a delay after the forward (move (2,200)), but not after the turn (move (4,100)), so that must be the reason it did not turn. I’m guessing that _delay(1) after the move(4,100) would do the trick.

Marcel


#4

As you note, specifying the motor speed and direction merely turns it on until the motor receives a new command. If the duration between movement commands is too short, it will appear to not occur at all because the next movement command will be executed 1. :slight_smile:

1 According to Atmel, the ATMega328 (the Arduino CPU) operates at a rate of 16MIPS (million instructions per second)


#5

Thank you so much Chuck. I will try your solutions this weekend when we’re back at it.


#6