Problem

I used an Arduino device or extension on mBlock 5. After I clicked the </> button on the right to view Arduino C transcoding, the loop statement wasn’t displayed properly.

Cause

To optimize the transcoding of the loop field, it is changed to _loop for Arduino devices.

Solution

Modify the device or extension on mBlock 5 Extension Builder as follows:

1. Open the editing page of the device or extension

Use a device as an example.
Choose My Plugin > My Device and click the Edit button of the device to be modified.
image.png

2. Modify the Arduino C transcoding template

(1) Click the Transcode settings tab.
image.png
(2) Modify loop to _loop in the Arduino C transcoding template and save the modification.
image.png

3. Modify the block configuration

(1) Click the Blocks settings tab.
image.png
(2) Click Upload transcode in the Blocks settings area.
image.png
(3) Copy the code from the original loop field to the _loop field.
image.png