Copy Blocks from one device to another (eg Arduino Mega to Uno)


#1

Hi,

Does anyone know if you can copy mblock code from one type of device to a different type of device in mblock?. In my case Im trying to compile mblock on an Arduino Uno, which Ive currently got in mblock compiling on a Mega.

I’ve tried the copy/paste, drag/drop and import/export variations on this for copying from sprites to sprites, ad duplicating a device type. These don’t seem to work in the case where the types of Arduino are different.

Thankyou! Chris


#2

Hi poundlane,
Actually I’m not sure about your request.
Arduino Uno is supported in mBlock5.
You can use the blocks directly, why you need to copy from other device?


#3

Hi, I developed the code for a mega device, in mblock. I now want to compile and run the same code on a Uno. This is because it’s a smaller unit. The program is about 40 or 50 blocks, so I don’t want to re-enter the code on an added Uno device from scratch, I want to add the Uno device and copy the blocks over from the mega device blocks…hope that makes sense!

Cheers
Chris


#4

To make it clear…I’m talking about ‘device’ in mblock terms and not in the physical sense. So if I have one Uno device and one mega device…how do I copy blocks between those devices in the mblocks ide?


#5

I think that I might understand what you want to do. You have some code you have written for 1 device and you want to copy that code to another device.

Answer is there doesn’t seem to be a clip board you can copy it on to then off from. The way I have done this is I take a picture of my code with my phone then build it again on the new device or program. I did make a suggestion in mblock5 about a clip board being added so that you can copy and paste between programs and devices.


#6

Agree with OooB, this drove me nuts too - I suspect it’s because some blocks aren’t supported in all devices, so it was just too complicated a coding task. Very annoying when you have a decent sized program.
Another thread here: Hi how do i copy and paste - Chuck says something about creating a template program - not sure if that’s relevant or not, I got frustrated and just re-entered the code block by block


#7

@OutoftheBOTS, @MurrayElliot, Thanks for the insights. Yes, I too have a significant (50+block lines) of code to ‘port’ to another Arduino model. I might raise this as a feature ask, as you can see with Live and Upload modes there is ‘block sensitivity’ to what works in a given configuration…for now I’ll get reblocking! You never know I m ight clean up my awful code in the process! :wink:
Cheers guys


#8

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.