Closed mathgcosta closed 5 years ago
You can try using an OutputPort; I'd be interested to know whether a 1-bit port ends up generating the same code. Or you could add a new board type with the associated port-pin mapping in ports.h, which would allow you to use the normal Input and Output classes.
Wow,
Great idea. I'll do that. Thanks a lot.
Hey,
I did this implementation but something is going wrong (the led doesn't blinked and there wasn't compilation error)
Here is your original port.h:
And here is what I wrote below:
Can you see some wrong with it?
That looks reasonable, provided it matches your board pinout and you have wired the correct pin.
Yeah,
But doesn't work any output pin on the board, neither blink led nor something else =/ And all wires are correct. The same code using Arduino pins works, that new implementation don't.
Just checking, is ARDUINO_AVR_NANO defined?
You mean, when I compile the code? Like here:
On ports.h file I just removed
defined (ARDUINO_AVR_NANO) || \
from here
and added a new #elif defined (ARDUINO_AVR_NANO) statement, as I posted before.
OK, that seems right... just wanted to be sure it was actually defined at compile time so it would use the correct definitions. (you can always verify by putting a #warning
statement there). And your code is using pin 32 (Output<32> my_output
)?
Hi @mmarchetti. Sorry for delayed answer, I got so stuffs to do last month and so. I'm not using pin32, why? I'll do using #warning and check how it goes.
@mathgcosta, You mentioned a compile error - would you post it here? It would also be good if you can post a code section where you are using the Input or Output class.
Closing this for now, if more details become available we can reopen.
Hi,
I'm using atmega328P-AU standalone (the same used in arduino nano boards) and I would like to know if its possible declare, for example,
Output<2> my_output;
as
OutputPort<PORT_D, 2> my_output;
Or, declare a output pin passing the AVR PORT name, rather than look up equivalent Arduino pin, as reference:
Thanks!