Can i use the code written for arduino mega board directly for the nRF51822 in arduino IDE?

initially we developed code for arduino mega board but now we want to use the nRF51822 soc,so how i can utilize my arduino code for nRF51822 ....i have gone through the some topics but there no clarity about code conversion to nrf51822.

thanks & regards, satish

  • AFIK there is no official Arduino "core" for the nRF51, however Sandeep's core is very good

    But... its unlikely that all of your Arduino Mega core will compile for the nRF5 series processors as the internal processor architecture is ARM rather than AVR and its a 32 bit processor rather than an 8 bit.

    Additionally, if you use any external libraries which directly interface with AVR hardware e.g. the hardware timer etc, the code will not compile at all, as the nRF5 peripheral hardware is completely different.

    All that being said, if you just run standard libs etc, there is a reasonable chance your code will port to the nRF5 series without too many problems.