Hi, I´m using Spence Konde cores and Arduino as ISP but the pin mapping of the 2313 is somehow strange to me. I have tried Blink sw in 2313, but how to use physical pin 6 (PD2) as a Output? I can do this by using no 14 in SW, but is this the correct way? The B port pins 12 - 19 works as a outputs with pin map 0-7 or PB0-PB7 in SW. How to use PA and PD pins?
Current test SW:
int pin=14;
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(pin, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(pin, HIGH); // turn the LED on (HIGH is the voltage level)
delay(100); // wait for a second
digitalWrite(pin, LOW); // turn the LED off by making the voltage LOW
delay(100); // wait for a second
}
From this i'd gather that PIN6 / PD2 == 4,
but in the Spence Konde Cores documentation i found
When using digitalRead/digitalWrite/pinMode, you must use the digital pin number, the A# constant, or the PIN_xn constants (for example PIN_B3 for PB3).
so then it would just be PIN_D2
Hi, something is still missing? Error: PIN_D2 was not declared in this scope.
// int PIN_D2=6;
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(PIN_D2, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(PIN_D2, HIGH); // turn the LED on (HIGH is the voltage level)
delay(100); // wait for a second
digitalWrite(PIN_D2, LOW); // turn the LED off by making the voltage LOW
delay(100); // wait for a second
}
Well that is what it says in the documentation, but i guess then it should just be '4' for pin
Hi, by using just 4 it controls physical pin no. 16 (PB4)...
int pin=4;
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(pin, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(pin, HIGH); // turn the LED on (HIGH is the voltage level)
delay(100); // wait for a second
digitalWrite(pin, LOW); // turn the LED off by making the voltage LOW
delay(100); // wait for a second
}
Hi, problem solved! I need to reboot my computer and now it works fine as arduino pin mapping diagrams shows: just '4' ->PD2. Thanks guys!