Reading serial port data


#1

hi,
I have a simple program in an arduino UNO that measures an analog voltage and writes it to the serial port.

what is the simplest way to read this within mblock? I can see the data when i use arduino mode but cannot work out how to use the data. DO I use a communication block? Have tried with no success. Any help greatly appreciated.

Thanks
greg


#2

Hi gg23,

The communication block cannot be used with the Arduino program in mBlock.
We have plan modify the Arduino program block include adding the serial trasmint function for the new version mBlock in the future.


#3

hi,
so there is no way of reading the serial data?

greg


#4

Hi gg23

Currently, there is no program block on mBlock to read serial data from Arduino uno board.


#5

How to read serial data on MegaPi using mBlock?


#6

Hi,

Please refer to the FAQ 4 in this link about how to use the communication part on mBlock: http://www.mblock.cc/faq

You need select the Communication under Extensions when you need use this part. Then choose the board as MegaPi, you can see both the program blocks for MegaPi and Communication.


#7

It’s been nearly a month. Is there any update on this? Will the writeLine block work for mBot/mCore in mBlock 3.38?

–andrew


#8

Hi tieandjeans,

Adding serial transmit function for Arduino uno program will be achieved in mBlock 3.3.8 and this version is still under testing now.

As for the writeLine block for mBot, I think it already can work with mBot with current version mBlock.


#9

I have been testing with 3.3.8 and an Aduino Nano. I have a program loaded into the Arduino that sends serial data (at 11950bps) In Arduino mode the data is shown in mBlock’s serial monitor.

I would like to use the communication blocks to wait for data and then read a line of data and do something with it.

It is not an option to load the mBlock firmware in the Arduino because that would overwrite the program that reads an RFID scanner and sends the data as serial.

Is this currently possible? If not is it something you plan on implementing soon?

Thanks


#10

Hi Mike_Dash,

This is currently not possible, the communications blocks cannot be used with the Arduino uno/Nano.
Temporarily, there is no such plan to implementing it. Anyway, I will add this request to customer requirement list for furture assessment.


#11

Hi,

It’s been more than a year . Any updates on this ?


#12

It works fine with the blocks from the Arduino extension, which has similar blocks for reading and sending serial data.


#13