How to program exchange (reading and writing) between Orion and PC


#1

Hello,
First, can you explain me if, in Mblock easy programming, when sélectionning Arduino code, the restriction of coloured menu is because some functions are not for Arduino (the bot with the Orion card) but only for the panda.
Secondly , can you explain me if, programming directly in C or Arduino code allows more functionnality than what Mblock allows to write.
Third: Does scratch has more functions than the code produce withs Mblock
Fourth : Is it possible to exchange information double sens (double way). I mean, can i read informations from the bot to the PC, and the PC decides what to do.
I haven’t seen fonctions of sending informations to the PC in the Mblock language. For example, there is if ultrasonic distance … than, but the robot must have the programm to decide. How to send theses information to the PC by bluetooth.

Thank you for Help, and sorry for my english .
I would like to go further than simply giving a standalone program in the bot.


#2
  1. I’m not sure that I understand your first question. If you move to Arduino mode you would normally be setting up an upload with the header block on the Scratch side being mBot Program, Auriga Program, etc. In this case many of the Scratch blocks are disabled because they do not apply to autonomous programs.

  2. Writing software in C/C++ will always provide finer control and potentially more functionality. The C/C++ code generated through mBlock covers the blocks but nothing else.

  3. Scratch has add-on libraries and there is a repository that has mBlock add-ons as well.

  4. You can do this from within the mBlock environment or from C/C++ code. Communications occur over the serial link provided by Bluetooth or WiFi (depending on what module you have).

I would suggest that you check out the Makeblock Learning site (learn.makeblock.com). I published an mBot-specific eBook that covers programming the mBot in the mBlock environment (link) although it is mostly focused on autonomous operations.


#3

Thank you very much for your answer.
Yes, for the first question, i mean (but didn’t find english words) that scratch blocks were disabled. Ok i undestand
2 ok
3 ok thanks
4. I have the bluetooth environment. But don’t find where , in mblock (scratch) i can write code that capture informations from the bot. For exemple a sensor that give a data to the arduino/orion (the arduino/orion program read this) , then the Arduino Orion program that transfer the information to the PC (bluetooth) and finally the pc program that read.
Ok with C/C++ but dont find programming functions in scratch or Mblock programming

Thanks for the link , I’ll read
And sorry again for my poor english.


#4

Here is a brief example from the mBot that displays a value. The Scratch program is running on the computer but it is communicating with the mBot via the 2.4GHz WiFi connection (the same would hold true if I was using the Bluetooth module). The ultrasonic sensor is connected to port 3 in this case.

Read_Ultrasonic_Sensor

The rounded corner teal colored blocks are called “reporters” and essentially read the current value of whatever the reporter is associated with.


#5