Makeblock-official / mBlock

base on scratch offline v2.0 by MIT, Learn more from Makeblock official website
http://www.makeblock.com
GNU General Public License v2.0
319 stars 228 forks source link

Problems reading data from serial #64

Open josejuansanchez opened 7 years ago

josejuansanchez commented 7 years ago

I am developing an extension for mBlock in order to use a custom shield for the Arduino Nano but I have some issues reading data from serial port with mBlock.

I am using mBlock v3.4.6 and I believe that there is a problem related with the reading of values from the serial port.

I have performed a basic test in order to show the problem. In this test the Arduino Nano is writing the same value on the serial port and mBlock only is able to receive the data when the board is connected the first time. If I disconnect the board and then I connect it again, mBlock seems that does not receive the values properly.

Here are the steps that I have followed:

1) This is the Arduino code uploaded to the board.

void setup() {
  Serial.begin(57600);
}

void loop() {
  Serial.print(15);
  delay(250);
}

2) Connect with the board from mBlock. 3) Once the board is connected the serial monitor start to display the values sent through the serial port. 4) Disconnect the board from mBlock. 5) Connect the board again. 6) Once the board is connected the serial monitor does not display any values.

mblock-bug-reading-serial

Could you help me to understand what is happening?

Thanks!

bigeyex commented 7 years ago

Hi, it seems to be a known bug in mBlock 3.x. Would you please try 4.x and see whether the issue still exists? There is an easy web access to 4.x version.