//Define Digital Pin
// Pin 3,5,6,9,10,11 have hardware ~ PWM support.
#define PinD0 0 // D0/RX PD0 Serial (USART) RX
#define PinD1 1 // D1/TX PD1 Serial (USART) TX
#define PinD2 2 // D2 PD2 External interrupt INT0
#define PinD3 3 // D3~ PD3 External interrupt INT1
#define PinD4 4 // D4 PD4
#define PinD5 5 // D5~ PD5
#define PinD6 6 // D6~ PD6
#define PinD7 7 // D7 PD7
#define PinD8 8 // D8 PB0
#define PinD9 9 // D9~ PB1
#define PinD10 10 // D10~ PB2 SPI SS (Chip select)
#define PinD11 11 // D11~ PB3 CIP0 SPI MOSI
#define PinD12 12 // D12 PB4 COPI SPI MISO
#define PinD13 13 // D13 PB5 LED SPI SCLK (Clock)
//Define Analog Pin
#define PinA0 14 // D14/A0 PC0 ADC[0]
#define PinA1 15 // D15/A1 PC1 ADC[1]
#define PinA2 16 // D16/A2 PC2 ADC[2]
#define PinA3 17 // D17/A3 PC3 ADC[3]
#define PinA4 18 // D18/A4 PC4 ADC[4] I2C SDA (Data)
#define PinA5 19 // D19/A5 PC5 ADC[5] I2C SCL (Clock)
#define PinA6 20 // A6 AN_IN ADC[6]
#define PinA7 21 // A7 AN_IN ADC[7]
#define RESET 22 // RESET PC6
#define CycleTime 250
//ICSP (In-circuit serial programming)
// P1 Atmega328 Serial Wire Debug (MISO)*
// P2 Atmega328 Serial Wire Debug (VCC)
// P3 Atmega328 Serial Wire Debug (SCK)
// P4 Atmega328 Serial Wire Debug (MOSI)
// P5 Atmega328 Serial Wire Debug (RESET)
// P6 Atmega328 Serial Wire Debug (GND)
// 8 bit timer Timer0, Timer 2
// 16 bit timer Timer1,
// GPIO Including External/Pin Change Interrupts
// Watchdog Timer Usage example
//Define Digital Pin
// +3V3 +3.3V Output - 5V USB Power Output
// +5V +5.0V Output/Imput - 5V Power Rail Output
// GND
// VIN Voltage Input 7-12V
// USB Voltage Input 5V
void setup() {
// put your setup code here, to run once:
pinMode(PinD0, OUTPUT);
pinMode(PinD1, OUTPUT);
pinMode(PinD2, OUTPUT);
pinMode(PinD3, OUTPUT);
pinMode(PinD4, OUTPUT);
pinMode(PinD5, OUTPUT);
pinMode(PinD6, OUTPUT);
pinMode(PinD7, OUTPUT);
pinMode(PinD8, OUTPUT);
pinMode(PinD9, OUTPUT);
pinMode(PinD10, OUTPUT);
pinMode(PinD11, OUTPUT);
pinMode(PinD12, OUTPUT);
pinMode(PinD13, OUTPUT);
pinMode(PinA0, OUTPUT);
pinMode(PinA1, OUTPUT);
pinMode(PinA2, OUTPUT);
pinMode(PinA3, OUTPUT);
pinMode(PinA4, OUTPUT);
pinMode(PinA5, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(PinD0, HIGH); // turn the LED on (HIGH is the voltage level)
delay(CycleTime); // wait for a second
digitalWrite(PinD1, HIGH); // turn the LED on (HIGH is the voltage level)
delay(CycleTime); // wait for a second
digitalWrite(PinD0, LOW); // turn the LED off by making the voltage LOW
digitalWrite(PinD2, HIGH); // turn the LED on (HIGH is the voltage level)
delay(CycleTime); // wait for a second
digitalWrite(PinD1, LOW); // turn the LED off by making the voltage LOW
digitalWrite(PinD3, HIGH); // turn the LED on (HIGH is the voltage level)
delay(CycleTime); // wait for a second
digitalWrite(PinD2, LOW); // turn the LED off by making the voltage LOW
digitalWrite(PinD4, HIGH); // turn the LED on (HIGH is the voltage level)
delay(CycleTime); // wait for a second
digitalWrite(PinD3, LOW); // turn the LED off by making the voltage LOW
digitalWrite(PinD5, HIGH); // turn the LED on (HIGH is the voltage level)
delay(CycleTime); // wait for a second
digitalWrite(PinD4, LOW); // turn the LED off by making the voltage LOW
digitalWrite(PinD6, HIGH); // turn the LED on (HIGH is the voltage level)
delay(CycleTime); // wait for a second
digitalWrite(PinD5, LOW); // turn the LED off by making the voltage LOW
digitalWrite(PinD7, HIGH); // turn the LED on (HIGH is the voltage level)
delay(CycleTime); // wait for a second
digitalWrite(PinD6, LOW); // turn the LED off by making the voltage LOW
digitalWrite(PinD8, HIGH); // turn the LED on (HIGH is the voltage level)
delay(CycleTime); // wait for a second
digitalWrite(PinD7, LOW); // turn the LED off by making the voltage LOW
digitalWrite(PinD9, HIGH); // turn the LED on (HIGH is the voltage level)
delay(CycleTime); // wait for a second
digitalWrite(PinD8, LOW); // turn the LED off by making the voltage LOW
digitalWrite(PinD10, HIGH); // turn the LED on (HIGH is the voltage level)
delay(CycleTime); // wait for a second
digitalWrite(PinD9, LOW); // turn the LED off by making the voltage LOW
digitalWrite(PinD11, HIGH); // turn the LED on (HIGH is the voltage level)
delay(CycleTime); // wait for a second
digitalWrite(PinD10, LOW); // turn the LED off by making the voltage LOW
digitalWrite(PinD12, HIGH); // turn the LED on (HIGH is the voltage level)
delay(CycleTime); // wait for a second
digitalWrite(PinD11, LOW); // turn the LED off by making the voltage LOW
digitalWrite(PinD13, HIGH); // turn the LED on (HIGH is the voltage level)
delay(CycleTime); // wait for a second
digitalWrite(PinD12, LOW); // turn the LED off by making the voltage LOW
digitalWrite(PinA0, HIGH); // turn the LED on (HIGH is the voltage level)
delay(CycleTime); // wait for a second
digitalWrite(PinD13, LOW); // turn the LED off by making the voltage LOW
digitalWrite(PinA1, HIGH); // turn the LED on (HIGH is the voltage level)
delay(CycleTime); // wait for a second
digitalWrite(PinA0, LOW); // turn the LED off by making the voltage LOW
digitalWrite(PinA2, HIGH); // turn the LED on (HIGH is the voltage level)
delay(CycleTime); // wait for a second
digitalWrite(PinA1, LOW); // turn the LED off by making the voltage LOW
digitalWrite(PinA3, HIGH); // turn the LED on (HIGH is the voltage level)
delay(CycleTime); // wait for a second
digitalWrite(PinA2, LOW); // turn the LED off by making the voltage LOW
digitalWrite(PinA4, HIGH); // turn the LED on (HIGH is the voltage level)
delay(CycleTime); // wait for a second
digitalWrite(PinA3, LOW); // turn the LED off by making the voltage LOW
digitalWrite(PinA5, HIGH); // turn the LED on (HIGH is the voltage level)
delay(CycleTime); // wait for a second
digitalWrite(PinA4, LOW); // turn the LED off by making the voltage LOW
delay(CycleTime); // wait for a second
digitalWrite(PinA5, LOW); // turn the LED off by making the voltage LOW
delay(CycleTime); // wait for a second
}