Squirrels have fuzzy tails.
0 Members and 1 Guest are viewing this topic.
#include <avr/io.h>int del = 0; //create integer "del"int val = 16000; //create integer "val"int main(void) { DDRB = 0xFF; //Set B ports output DDRC = 0x00; //Set all C ports input DDRD = 0xFF; //Set all D ports output PORTB = 0b00000000; //Set all B ports low PORTC = 0x00; //Set all C ports low PORTD = 0b00010000; //Set D4 high while(1) { del = val; //Set "del" equal to "val" PORTB = 0b00000001; //Set B0 high PORTD = 0b00000000; //Set all D ports low while(del > 0) { del--; // These two waits should create the frequency } del = val; PORTB = 0b00000000; //Set all B ports low PORTD = 0b00010000; //Set D4 high while(del > 0) { del--; // These two waits should create the frequency } } }
yea but doesnt AVR translate it into low-level language before sending it the the MCU? It converts it into Hexidecimal right?
_asmASSEMBLY GOES HERE_endasm
//**************RESET TIMER**************void reset_timer(void) { //restart timer count TCNT0=0x00;//clear timer timer0ClearOverflowCount();//clear timer0's overflow counter. }//***************************************
since your program is written in C, which is an interpreted language