mBot SerialPrint Sensor Data


#1

Silly question , but i cant find an example

How can I serial print the sensor data from mbot and display it on the mBlock or anywhere else

the mbot can be connected to the PC using the USB cable. can you please help me to find an example please.

Thanks


#2

If you are connected via USB, you can use the say block to display the data either directly from the reporter block associated with the sensor or you can store the reading into a list or a variable and access it with the say block.


#3

Chuck, this isn’t working for me. I am just starting with mBlock and am very confused: my goal is to log temperature data. Is there a good source for learning how to do this? I haven’t found one. Thanks.

By the way, I do hope to get your book soon.


#4

Hi!

You’ll need to be connected to mBlock via the USB cable (it appears you are from your screenshot), and then this program should display the reading from the temperature sensor (assuming your port and slot assignments are correct):

Display_Temperatur

When running a program through mBlock, you’ll need the When [green flag] clicked hat block so that you can use the say block. The say block (and the rest of the UI blocks) are disabled when you start your program with the mBot Program hat block. Hope this helps! :slight_smile:


#5