Closed 13LenD closed 5 months ago
That's because PIN_PC2
is defined as 16:
https://github.com/MCUdude/MiniCore/blob/0bb50f6a6648e37cbe53012c61322345847c2a03/avr/variants/standard/pins_arduino.h#L172
Instead of Serial.println(Motion);
you should do Serial.println(digitalRead(Motion));
instead.
Thanks!
Sorry, to come back to this! What are the reasons that you should use digitalread here? Normally this isn't necessary, is it? Is this due to the type of bootloader?
Because Serial.println(Motion);
will only print the value Motion
holds (16), while Serial.println(digitalRead(Motion));
will read the value of pin Motion
(16). This isn't MiniCore spesific, but applies for all Arduino boards.
Thanks for your explanation. Learned something again!
I'm working with the minicore bootloader on an ATmega 328BP version 3.0.2 Now I try to use the digital port PC2, but it does not give a normal response as I expected? This port is externally pulled to 0V or to 5V. So I would expect a high or low but instead I see a 16 in my serial monitor? are there more people with this problem? See the code used below: