I did a C program in AVRStudio, and i have a arduino atmega 2650. I want to use this C program at arduino.. Can I?
And another question, i didn't know how to use the ADC at C code, but it's easy at arduino compiler. Can I mix codes and do the adc's part at arduino compiler ???
Mostly you just have to 'unwind' it from it's main function, as the arduino uses a 'hidden' main function. What you also have to determine is if your existing code uses any includes that aren't part of the arduino platform.
Can I mix codes and do the adc's part at arduino compiler ???
void conversao() {
PORTC = 0x0;
_delay_us(2);
PORTC = 0x2;
_delay_us(10);
OCR1AH = PINB;
OCR1AL = PINA;
OCR3AH = OCR1AH;
OCR3AL = OCR1AL;
OCR4AH = OCR1AH;
OCR4AL = OCR1AL;
TCCR1B = 0x9; // inicia o timer da fase A
}
ISR(INT0_vect)
{
conversao();
}
ISR(INT1_vect)
{
TCCR3B = 0x9; // inicia o timer da fase B
}
when i put this code at arduino, it rejected the registers, but i thought about putting the avr libraries at arduino… can i do that ?
will it fix my problem?
Hey guys, thanks for the help... it really was the board :sweat_smile:
i compiled and it did any error.. i still didnt tested at the board yet but i think that's ok... about the CPU_L, whats the clock frequency for arduino atmega 2650?