Port coding from arduino to AVR

Hello,

I have been programming code in Arduino to work on AVR. However I have been told that i should port code the arduino code into AVR.

I am currently using an Atmega328p chip, how would I port the code into AVR?

Sorry if this topic has already been mentioned before.

  • I am currently using avr studio 4*

However I have been told that i should port code the arduino code into AVR.

By what moron?

well i have only started programming code, i dont even know what port code means, furthermore in simpler terms how do you sendd code done in arduino using arduino uno board into avr studio 4?

well i have only started programming code

Does a beginning driver need a Formula 1 race car? Use the IDE. Forget Atmel Studio.

how do you sendd code done in arduino using arduino uno board into avr studio 4?

A wild guess, but copy/paste springs to mind.

dizzzmal:
Hello,

I have been programming code in Arduino to work on AVR. However I have been told that i should port code the arduino code into AVR.

I am currently using an Atmega328p chip, how would I port the code into AVR?

Sorry if this topic has already been mentioned before.

  • I am currently using avr studio 4*

What reason did your friend give for working in AVR Studio instead of the Arduino IDE? I sometimes work in Atmel Studio 7 (also, why AVR Studio 4?) when I want to use my AVR Dragon for debugging. If you expect to reuse your code in other microprocessors then it could be useful to break from the Arduino environment as well.

If your friend doesn't have a reason, however, it's possible he's just being snobby. Lots of embedded programmers like to piss on the Arduino as being beneath them when it really is just fine for most things hobbyists want to do.

If you really do need to convert your Arduino code to standard C/C++, step 1 is replacing setup() and loop() with main(). Step 2 is avoiding all of the Arduino functions like digitalRead(). Step 3 is...well...there's more steps than I want to list without knowing if you really want to do this.