Paso 3: Cargar el programa
La forma más fácil de subir un programa a la 328 de 8 MHz es el chip de 16 MHz de tu Arduino y reemplazarlo con el chip de 8 MHz.
Iniciar el IDE de Arduino, haga clic en herramientas = > Board y seleccione ATmega328 en un protoboard (reloj interno de 8 MHz).
Haga clic en herramientas = > Programador y seleccione AVRISP mkII.
Copiar/pegar el siguiente código en el IDE de Arduino y presione el botón subir.
/***************************************************************** * Filename: Count22.ino * * This program runs on an Atmega328P using the internal clock. *****************************************************************/ int j = 0; // First nested index. int k = 0; // Second nested index void setup() { DDRB = B11111111; // Set the pin banks to OUTPUT DDRC = B11111111; DDRD = B11111111; } void loop() { for(int i=0;i<256;i++) // The primary index { PORTB = i; // Set/Clear bits 0 - 7 delay(5); } j++; if(j<256) PORTD = j; // Set/Clear bits 8 - 15 else { PORTD = B00000000; // Clear bits 8 - 15 j = 0; k++; if(k<64) PORTC = k; // Set/Clear bits 16 - 21 else { PORTB = B00000000; // Zero everything to start over PORTC = B00000000; PORTD = B00000000; j = 0; k = 0; } } }