6 years, 8 months ago.

Importing a package from your local computer

Hello

How can you import a whole package of code from your local computer?

A general answer should suffice; however in my particular situation, I want to import code for Hexiwear's Original Factory code, which i could not find on mbed.org. I do have the MikroC for Arm code, which lots of levels of directories and files. Therefore I would prefer to import the code rather than manual create files to copy-and-paste code.

Thank you,

Hi there,

Are you using the Online Compiler or offline Mbed CLI?

- Jenny, team Mbed

posted by Jenny Plunkett 29 Aug 2017

Hi Jenny. I am using the Online Compiler on SeaMonkey 2.46 and Firefox49.0, on MS Windows 7.

posted by Therverson Kanavathy 29 Aug 2017

Another option is to use the online IDE:

  • On the toolbar click on the Import button.
  • Proceed to the Upload tab.
  • Click on the Browse button located at bottom-left corner.
  • Navigate to the folder on your PC which contains the files you'd like to upload.
  • Select files one by one to be added to the upload list ( (NOTE: if you pack them in advance then it's sufficient to upload the zip file).
  • Once the list is complete, click on the Import! button located in the upper-right corner and then specify the destination program name.
posted by Zoltan Hudak 30 Aug 2017

Ah, that's actually better! Didn't know that we had that feature :-)

posted by Jan Jongboom 31 Aug 2017

1 Answer

6 years, 8 months ago.

  1. Go to your profile page.
  2. Go to the code tab.
  3. Click *Create repository*.
  4. After creation, look under 'Clone repository to desktop' and note that URL.
  5. Create a new Mercurial (hg) repository, commit your code and push to this URL.

Now you can import the project in the online compiler.

Hi. Thank you for this. However I do not know what is a Mercurial (hg) repository). Can you explain please?

posted by Therverson Kanavathy 30 Aug 2017

It's a source control management system. It's what we use to store code on mbed.org. Install Mercurial, then open a terminal in the project you want to upload (locally) and type:

$ hg init
$ hg add .
$ hg commit -m "initial commit"

Then create a file .hg/hgrc and add:

[paths]
default = http://PATH_TO_YOUR_REPO_ON_MBED

Then from the terminal, run:

$ hg push
posted by Jan Jongboom 30 Aug 2017