//Define Digital
// Pin 3,5,6,9,10,11 have hardware ~ PWM support.
#define PinD0 0 // D0/RX PD0 RX LED Serial (USART) RX GPIO
#define PinD1 1 // D1/TX PD1 TX LED Serial (USART) TX GPIO
#define PinD2 2 // D2 PD2 External interrupt INT0 GPIO
#define PinD3 3 // D3~ PD3 External interrupt INT1 GPIO
#define PinD4 4 // D4 PD4 GPIO
#define PinD5 5 // D5~ PD5 GPIO
#define PinD6 6 // D6~ PD6 GPIO
#define PinD7 7 // D7 PD7 GPIO
#define PinD8 8 // D8 PB0 GPIO
#define PinD9 9 // D9~ PB1 GPIO
#define PinD10 10 // D10~ PB2 SPI SS (Chip select)
#define PinD11 11 // D11~ PB3 SPI MOSI (Main Out Secondary In)
#define PinD12 12 // D12 PB4 SPI MISO (Main In Secondary Out)
#define PinD13 13 // D13 PB5 LED SPI SCK (Serial clock output)
// PinA4_2 // D18/A4 PC4 I2C SDA (Data) (duplicated)
// PinA5_2 // D19/A5 PC5 I2C SCL (Clock) (duplicated)
//Define Analog
#define PinA0 14 // D14/A0 PC0 ADC[0] GPIO
#define PinA1 15 // D15/A1 PC1 ADC[1] GPIO
#define PinA2 16 // D16/A2 PC2 ADC[2] GPIO
#define PinA3 17 // D17/A3 PC3 ADC[3] GPIO
#define PinA4 18 // D18/A4 PC4 I2C SDA (Data) ADC[4]
#define PinA5 19 // D19/A5 PC5 I2C SCL (Clock) ADC[5]
//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)
//Define Other
// +3V3 +3V3 Power Rail Output
// +5V +5V Power Rail Output
// GND Ground
// VIN Voltage Input 5-12V
// USB VCC Voltage Input 5V
// RESET Reset
// AREF Analog reference voltage
// IOREF Reference for digital logic V - connected to 5V
// Other
// 8 bit timer Timer0, Timer 2
// 16 bit timer Timer1,
// GPIO General IO/ Including External/ Pin Change Interrupts
// Watchdog Timer Usage example
#define CycleTime 250
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
}