Hi everyone! I'm new to Arduino and this is my first time posting.
I tried to upload a sketch that used to work with unoR3 to the new R4 and got this error. I running IDE 1.8.19 on RasPi. Already select Board: UNO R4 MINIMA and PORT: ACM0 (UNO R4 MINIMA)
The error message is quite descriptive but I am confused about what I should exactly do. Any suggestion would be appreciated. Thank you in advance.
'PORTD', 'UCSR0A', 'TXEN0', 'DDRD', and '_BV' are not defined for your current board (Renesas UNO Minima).
/home/afc/Desktop/sketch_aug04/sketch_aug04.ino: In function 'void sendBits(byte)':
sketch_aug04:843:21: error: 'PORTD' was not declared in this scope
#define PIXEL_PORT PORTD // Data register of the pins the pixels are connected to
^
/home/afc/Desktop/sketch_aug04/sketch_aug04.ino:885:35: note: in expansion of macro 'PIXEL_PORT'
[port] "I" (_SFR_IO_ADDR(PIXEL_PORT)),
^~~~~~~~~~
sketch_aug04:885:22: error: '_SFR_IO_ADDR' was not declared in this scope
[port] "I" (_SFR_IO_ADDR(PIXEL_PORT)),
^~~~~~~~~~~~
/home/afc/Desktop/sketch_aug04/sketch_aug04.ino:885:22: note: suggested alternative: 'FSP_IP_ADC'
[port] "I" (_SFR_IO_ADDR(PIXEL_PORT)),
^~~~~~~~~~~~
FSP_IP_ADC
/home/afc/Desktop/sketch_aug04/sketch_aug04.ino: In function 'void show()':
sketch_aug04:902:3: error: '_delay_us' was not declared in this scope
_delay_us( (RES_NS / 1000UL) + 1); // Round up since the delay must be _at_least_ this long (too short might not work, too long not a problem)
^~~~~~~~~
/home/afc/Desktop/sketch_aug04/sketch_aug04.ino:902:3: note: suggested alternative: 'delay'
_delay_us( (RES_NS / 1000UL) + 1); // Round up since the delay must be _at_least_ this long (too short might not work, too long not a problem)
^~~~~~~~~
delay
/home/afc/Desktop/sketch_aug04/sketch_aug04.ino: In function 'void serialPollRX()':
sketch_aug04:939:7: error: 'UCSR0A' was not declared in this scope
if (UCSR0A & _BV(RXC0) ) { // If there is a byte ready in the recieve buffer
^~~~~~
sketch_aug04:939:20: error: 'RXC0' was not declared in this scope
if (UCSR0A & _BV(RXC0) ) { // If there is a byte ready in the recieve buffer
^~~~
sketch_aug04:939:16: error: '_BV' was not declared in this scope
if (UCSR0A & _BV(RXC0) ) { // If there is a byte ready in the recieve buffer
^~~
/home/afc/Desktop/sketch_aug04/sketch_aug04.ino:939:16: note: suggested alternative: '_B'
if (UCSR0A & _BV(RXC0) ) { // If there is a byte ready in the recieve buffer
^~~
_B
sketch_aug04:940:21: error: 'UDR0' was not declared in this scope
appendToBuffer( UDR0 ); // Read it and add to our buffer. Note reading the byte clears the RXC0 flag
^~~~
/home/afc/Desktop/sketch_aug04/sketch_aug04.ino:940:21: note: suggested alternative: 'UART'
appendToBuffer( UDR0 ); // Read it and add to our buffer. Note reading the byte clears the RXC0 flag
^~~~
UART
/home/afc/Desktop/sketch_aug04/sketch_aug04.ino: In function 'void setup()':
sketch_aug04:1055:3: error: 'UCSR0B' was not declared in this scope
UCSR0B &= ~ _BV( TXEN0 ); // Disable the serial TX pin (digital pin 1) so we can use it as digital IO for an LED string
^~~~~~
sketch_aug04:1055:20: error: 'TXEN0' was not declared in this scope
UCSR0B &= ~ _BV( TXEN0 ); // Disable the serial TX pin (digital pin 1) so we can use it as digital IO for an LED string
^~~~~
sketch_aug04:1055:15: error: '_BV' was not declared in this scope
UCSR0B &= ~ _BV( TXEN0 ); // Disable the serial TX pin (digital pin 1) so we can use it as digital IO for an LED string
^~~
/home/afc/Desktop/sketch_aug04/sketch_aug04.ino:1055:15: note: suggested alternative: '_B'
UCSR0B &= ~ _BV( TXEN0 ); // Disable the serial TX pin (digital pin 1) so we can use it as digital IO for an LED string
^~~
_B
sketch_aug04:844:21: error: 'DDRD' was not declared in this scope
#define PIXEL_DDR DDRD // Direction register of the pins the pixels are connected to
^
/home/afc/Desktop/sketch_aug04/sketch_aug04.ino:1061:3: note: in expansion of macro 'PIXEL_DDR'
PIXEL_DDR |= 0xff; // Set all 8 pins to output mode (note that digital pin 0 is controlled by the serial port so this has no effect on it)
^~~~~~~~~
sketch_aug04:843:21: error: 'PORTD' was not declared in this scope
#define PIXEL_PORT PORTD // Data register of the pins the pixels are connected to
^
/home/afc/Desktop/sketch_aug04/sketch_aug04.ino:1064:3: note: in expansion of macro 'PIXEL_PORT'
PIXEL_PORT |= 0xff; // Set all outputs to 1
^~~~~~~~~~
sketch_aug04:1079:3: error: 'cli' was not declared in this scope
cli();
^~~
/home/afc/Desktop/sketch_aug04/sketch_aug04.ino:1079:3: note: suggested alternative: 'ceil'
cli();
^~~
ceil
/home/afc/Desktop/sketch_aug04/sketch_aug04.ino: In function 'void loop()':
sketch_aug04:1099:5: error: '_delay_us' was not declared in this scope
_delay_us(900); // Pool just often enough that we do not miss any serial bytes at 9600bd (1 byte about 1ms)
^~~~~~~~~
/home/afc/Desktop/sketch_aug04/sketch_aug04.ino:1099:5: note: suggested alternative: 'delay'
_delay_us(900); // Pool just often enough that we do not miss any serial bytes at 9600bd (1 byte about 1ms)
^~~~~~~~~
delay
exit status 1
'PORTD' was not declared in this scope