Nano every compilation problem

I'm beeing new in the Arduino community so un able to aderstand hard terms.

Firt I've launched doom-nano (GitHub - daveruiz/doom-nano: A 3d raycast engine for Arduino) on Uno board and it workd perfectly. In try to reduse the size of my arduboy I've bought Nano-Every on Amazon. Right now it gives me tones of errors.

C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp: In function 'void TWI_Start_Transceiver_With_Data(uint8_t, unsigned char*, uint16_t)':
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:113:5: error: expected initializer before 'case'
case TWI_START: // START has been transmitted
^~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:116:5: error: case label '24' not within a switch statement
case TWI_MTX_ADR_ACK: // SLA+W has been transmitted and ACK received
^~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:117:5: error: case label '40' not within a switch statement
case TWI_MTX_DATA_ACK: // Data byte has been transmitted and ACK received
^~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:118:11: error: 'TWI_bufPtr' was not declared in this scope
if (TWI_bufPtr < TWI_msgSize)
^~~~~~~~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:118:11: note: suggested alternative: 'TWI_buf'
if (TWI_bufPtr < TWI_msgSize)
^~~~~~~~~~
TWI_buf
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:120:9: error: 'TWDR' was not declared in this scope
TWDR = TWI_buf[TWI_bufPtr++];
^~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:120:9: note: suggested alternative: 'TWI0'
TWDR = TWI_buf[TWI_bufPtr++];
^~~~
TWI0
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:121:9: error: 'TWCR' was not declared in this scope
TWCR = (1<<TWEN)| // TWI Interface enabled
^~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:121:9: note: suggested alternative: 'TWI0'
TWCR = (1<<TWEN)| // TWI Interface enabled
^~~~
TWI0
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:121:20: error: 'TWEN' was not declared in this scope
TWCR = (1<<TWEN)| // TWI Interface enabled
^~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:121:20: note: suggested alternative: 'TWI0'
TWCR = (1<<TWEN)| // TWI Interface enabled
^~~~
TWI0
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:122:20: error: 'TWIE' was not declared in this scope
(1<<TWIE)|(1<<TWINT)| // Enable TWI Interrupt and clear the flag to send byte
^~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:122:20: note: suggested alternative: 'TWI0'
(1<<TWIE)|(1<<TWINT)| // Enable TWI Interrupt and clear the flag to send byte
^~~~
TWI0
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:122:30: error: 'TWINT' was not declared in this scope
(1<<TWIE)|(1<<TWINT)| // Enable TWI Interrupt and clear the flag to send byte
^~~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:122:30: note: suggested alternative: 'TWI_t'
(1<<TWIE)|(1<<TWINT)| // Enable TWI Interrupt and clear the flag to send byte
^~~~~
TWI_t
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:123:20: error: 'TWEA' was not declared in this scope
(0<<TWEA)|(0<<TWSTA)|(0<<TWSTO)| //
^~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:123:20: note: suggested alternative: 'TWI0'
(0<<TWEA)|(0<<TWSTA)|(0<<TWSTO)| //
^~~~
TWI0
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:123:30: error: 'TWSTA' was not declared in this scope
(0<<TWEA)|(0<<TWSTA)|(0<<TWSTO)| //
^~~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:123:41: error: 'TWSTO' was not declared in this scope
(0<<TWEA)|(0<<TWSTA)|(0<<TWSTO)| //
^~~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:124:20: error: 'TWWC' was not declared in this scope
(0<<TWWC); //
^~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:124:20: note: suggested alternative: 'TWI0'
(0<<TWWC); //
^~~~
TWI0
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:128:9: error: 'TWCR' was not declared in this scope
TWCR = (1<<TWEN)| // TWI Interface enabled
^~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:128:9: note: suggested alternative: 'TWI0'
TWCR = (1<<TWEN)| // TWI Interface enabled
^~~~
TWI0
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:128:20: error: 'TWEN' was not declared in this scope
TWCR = (1<<TWEN)| // TWI Interface enabled
^~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:128:20: note: suggested alternative: 'TWI0'
TWCR = (1<<TWEN)| // TWI Interface enabled
^~~~
TWI0
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:129:20: error: 'TWIE' was not declared in this scope
(0<<TWIE)|(1<<TWINT)| // Disable TWI Interrupt and clear the flag
^~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:129:20: note: suggested alternative: 'TWI0'
(0<<TWIE)|(1<<TWINT)| // Disable TWI Interrupt and clear the flag
^~~~
TWI0
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:129:30: error: 'TWINT' was not declared in this scope
(0<<TWIE)|(1<<TWINT)| // Disable TWI Interrupt and clear the flag
^~~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:129:30: note: suggested alternative: 'TWI_t'
(0<<TWIE)|(1<<TWINT)| // Disable TWI Interrupt and clear the flag
^~~~~
TWI_t
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:130:20: error: 'TWEA' was not declared in this scope
(0<<TWEA)|(0<<TWSTA)|(1<<TWSTO)| // Initiate a STOP condition.
^~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:130:20: note: suggested alternative: 'TWI0'
(0<<TWEA)|(0<<TWSTA)|(1<<TWSTO)| // Initiate a STOP condition.
^~~~
TWI0
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:130:30: error: 'TWSTA' was not declared in this scope
(0<<TWEA)|(0<<TWSTA)|(1<<TWSTO)| // Initiate a STOP condition.
^~~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:130:41: error: 'TWSTO' was not declared in this scope
(0<<TWEA)|(0<<TWSTA)|(1<<TWSTO)| // Initiate a STOP condition.
^~~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:131:20: error: 'TWWC' was not declared in this scope
(0<<TWWC); //
^~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:131:20: note: suggested alternative: 'TWI0'
(0<<TWWC); //
^~~~
TWI0
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:133:7: error: break statement not within loop or switch
break;
^~~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:134:5: error: case label '80' not within a switch statement
case TWI_MRX_DATA_ACK: // Data byte has been received and ACK transmitted
^~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:135:15: error: 'TWI_bufPtr' was not declared in this scope
TWI_buf[TWI_bufPtr++] = TWDR;
^~~~~~~~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:135:15: note: suggested alternative: 'TWI_buf'
TWI_buf[TWI_bufPtr++] = TWDR;
^~~~~~~~~~
TWI_buf
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:135:31: error: 'TWDR' was not declared in this scope
TWI_buf[TWI_bufPtr++] = TWDR;
^~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:135:31: note: suggested alternative: 'TWI0'
TWI_buf[TWI_bufPtr++] = TWDR;
^~~~
TWI0
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:136:5: error: case label '64' not within a switch statement
case TWI_MRX_ADR_ACK: // SLA+R has been transmitted and ACK received
^~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:139:9: error: 'TWCR' was not declared in this scope
TWCR = (1<<TWEN)| // TWI Interface enabled
^~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:139:9: note: suggested alternative: 'TWI0'
TWCR = (1<<TWEN)| // TWI Interface enabled
^~~~
TWI0
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:139:20: error: 'TWEN' was not declared in this scope
TWCR = (1<<TWEN)| // TWI Interface enabled
^~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:139:20: note: suggested alternative: 'TWI0'
TWCR = (1<<TWEN)| // TWI Interface enabled
^~~~
TWI0
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:140:20: error: 'TWIE' was not declared in this scope
(1<<TWIE)|(1<<TWINT)| // Enable TWI Interrupt and clear the flag to read next byte
^~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:140:20: note: suggested alternative: 'TWI0'
(1<<TWIE)|(1<<TWINT)| // Enable TWI Interrupt and clear the flag to read next byte
^~~~
TWI0
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:140:30: error: 'TWINT' was not declared in this scope
(1<<TWIE)|(1<<TWINT)| // Enable TWI Interrupt and clear the flag to read next byte
^~~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:140:30: note: suggested alternative: 'TWI_t'
(1<<TWIE)|(1<<TWINT)| // Enable TWI Interrupt and clear the flag to read next byte
^~~~~
TWI_t
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:141:20: error: 'TWEA' was not declared in this scope
(1<<TWEA)|(0<<TWSTA)|(0<<TWSTO)| // Send ACK after reception
^~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:141:20: note: suggested alternative: 'TWI0'
(1<<TWEA)|(0<<TWSTA)|(0<<TWSTO)| // Send ACK after reception
^~~~
TWI0
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:141:30: error: 'TWSTA' was not declared in this scope
(1<<TWEA)|(0<<TWSTA)|(0<<TWSTO)| // Send ACK after reception
^~~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:141:41: error: 'TWSTO' was not declared in this scope
(1<<TWEA)|(0<<TWSTA)|(0<<TWSTO)| // Send ACK after reception
^~~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:142:20: error: 'TWWC' was not declared in this scope
(0<<TWWC); //
^~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:142:20: note: suggested alternative: 'TWI0'
(0<<TWWC); //
^~~~
TWI0
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:145:9: error: 'TWCR' was not declared in this scope
TWCR = (1<<TWEN)| // TWI Interface enabled
^~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:145:9: note: suggested alternative: 'TWI0'
TWCR = (1<<TWEN)| // TWI Interface enabled
^~~~
TWI0
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:145:20: error: 'TWEN' was not declared in this scope
TWCR = (1<<TWEN)| // TWI Interface enabled
^~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:145:20: note: suggested alternative: 'TWI0'
TWCR = (1<<TWEN)| // TWI Interface enabled
^~~~
TWI0
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:146:20: error: 'TWIE' was not declared in this scope
(1<<TWIE)|(1<<TWINT)| // Enable TWI Interrupt and clear the flag to read next byte
^~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:146:20: note: suggested alternative: 'TWI0'
(1<<TWIE)|(1<<TWINT)| // Enable TWI Interrupt and clear the flag to read next byte
^~~~
TWI0
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:146:30: error: 'TWINT' was not declared in this scope
(1<<TWIE)|(1<<TWINT)| // Enable TWI Interrupt and clear the flag to read next byte
^~~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:146:30: note: suggested alternative: 'TWI_t'
(1<<TWIE)|(1<<TWINT)| // Enable TWI Interrupt and clear the flag to read next byte
^~~~~
TWI_t
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:147:20: error: 'TWEA' was not declared in this scope
(0<<TWEA)|(0<<TWSTA)|(0<<TWSTO)| // Send NACK after reception
^~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:147:20: note: suggested alternative: 'TWI0'
(0<<TWEA)|(0<<TWSTA)|(0<<TWSTO)| // Send NACK after reception
^~~~
TWI0
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:147:30: error: 'TWSTA' was not declared in this scope
(0<<TWEA)|(0<<TWSTA)|(0<<TWSTO)| // Send NACK after reception
^~~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:147:41: error: 'TWSTO' was not declared in this scope
(0<<TWEA)|(0<<TWSTA)|(0<<TWSTO)| // Send NACK after reception
^~~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:148:20: error: 'TWWC' was not declared in this scope
(0<<TWWC); //
^~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:148:20: note: suggested alternative: 'TWI0'
(0<<TWWC); //
^~~~
TWI0
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:150:7: error: break statement not within loop or switch
break;
^~~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:151:5: error: case label '88' not within a switch statement
case TWI_MRX_DATA_NACK: // Data byte has been received and NACK transmitted
^~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:154:7: error: 'TWCR' was not declared in this scope
TWCR = (1<<TWEN)| // TWI Interface enabled
^~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:154:7: note: suggested alternative: 'TWI0'
TWCR = (1<<TWEN)| // TWI Interface enabled
^~~~
TWI0
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:154:18: error: 'TWEN' was not declared in this scope
TWCR = (1<<TWEN)| // TWI Interface enabled
^~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:154:18: note: suggested alternative: 'TWI0'
TWCR = (1<<TWEN)| // TWI Interface enabled
^~~~
TWI0
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:155:18: error: 'TWIE' was not declared in this scope
(0<<TWIE)|(1<<TWINT)| // Disable TWI Interrupt and clear the flag
^~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:155:18: note: suggested alternative: 'TWI0'
(0<<TWIE)|(1<<TWINT)| // Disable TWI Interrupt and clear the flag
^~~~
TWI0
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:155:28: error: 'TWINT' was not declared in this scope
(0<<TWIE)|(1<<TWINT)| // Disable TWI Interrupt and clear the flag
^~~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:155:28: note: suggested alternative: 'TWI_t'
(0<<TWIE)|(1<<TWINT)| // Disable TWI Interrupt and clear the flag
^~~~~
TWI_t
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:156:18: error: 'TWEA' was not declared in this scope
(0<<TWEA)|(0<<TWSTA)|(1<<TWSTO)| // Initiate a STOP condition.
^~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:156:18: note: suggested alternative: 'TWI0'
(0<<TWEA)|(0<<TWSTA)|(1<<TWSTO)| // Initiate a STOP condition.
^~~~
TWI0
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:156:28: error: 'TWSTA' was not declared in this scope
(0<<TWEA)|(0<<TWSTA)|(1<<TWSTO)| // Initiate a STOP condition.
^~~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:156:39: error: 'TWSTO' was not declared in this scope
(0<<TWEA)|(0<<TWSTA)|(1<<TWSTO)| // Initiate a STOP condition.
^~~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:157:18: error: 'TWWC' was not declared in this scope
(0<<TWWC); //
^~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:157:18: note: suggested alternative: 'TWI0'
(0<<TWWC); //
^~~~
TWI0
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:158:7: error: break statement not within loop or switch
break;
^~~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:159:5: error: case label '56' not within a switch statement
case TWI_ARB_LOST: // Arbitration lost
^~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:164:7: error: break statement not within loop or switch
break;
^~~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:165:5: error: case label '32' not within a switch statement
case TWI_MTX_ADR_NACK: // SLA+W has been transmitted and NACK received
^~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:166:5: error: case label '72' not within a switch statement
case TWI_MRX_ADR_NACK: // SLA+R has been transmitted and NACK received
^~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:167:5: error: case label '48' not within a switch statement
case TWI_MTX_DATA_NACK: // Data byte has been transmitted and NACK received
^~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:168:5: error: case label '0' not within a switch statement
case TWI_BUS_ERROR: // Bus error due to an illegal START or STOP condition
^~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:169:5: error: case label not within a switch statement
default:
^~~~~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:170:19: error: 'TWSR' was not declared in this scope
TWI_state = TWSR; // Store TWSR and automatically sets clears noErrors bit.
^~~~
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:170:19: note: suggested alternative: 'TWI0'
TWI_state = TWSR; // Store TWSR and automatically sets clears noErrors bit.
^~~~
TWI0
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp: At global scope:
C:\Users\dansh\Downloads\doom-nano\TWI_Master.cpp:177:1: error: expected declaration before '}' token
}
^
In file included from C:\Users\dansh\Downloads\doom-nano\doom-nano.ino:8:0:
C:\Users\dansh\Downloads\doom-nano\sound.h: In function 'void sound_init()':
C:\Users\dansh\Downloads\doom-nano\sound.h:37:3: error: 'TCCR2A' was not declared in this scope
TCCR2A = (1 << WGM21); // CTC
^~~~~~
C:\Users\dansh\Downloads\doom-nano\sound.h:37:3: note: suggested alternative: 'TCB2'
TCCR2A = (1 << WGM21); // CTC
^~~~~~
TCB2
C:\Users\dansh\Downloads\doom-nano\sound.h:37:18: error: 'WGM21' was not declared in this scope
TCCR2A = (1 << WGM21); // CTC
^~~~~
C:\Users\dansh\Downloads\doom-nano\sound.h:38:3: error: 'TCCR2B' was not declared in this scope
TCCR2B = (1 << CS22) | (1 << CS21) | (1 << CS20); // prescaler 1024
^~~~~~
C:\Users\dansh\Downloads\doom-nano\sound.h:38:3: note: suggested alternative: 'TCB2'
TCCR2B = (1 << CS22) | (1 << CS21) | (1 << CS20); // prescaler 1024
^~~~~~
TCB2
C:\Users\dansh\Downloads\doom-nano\sound.h:38:18: error: 'CS22' was not declared in this scope
TCCR2B = (1 << CS22) | (1 << CS21) | (1 << CS20); // prescaler 1024
^~~~
C:\Users\dansh\Downloads\doom-nano\sound.h:38:32: error: 'CS21' was not declared in this scope
TCCR2B = (1 << CS22) | (1 << CS21) | (1 << CS20); // prescaler 1024
^~~~
C:\Users\dansh\Downloads\doom-nano\sound.h:38:46: error: 'CS20' was not declared in this scope
TCCR2B = (1 << CS22) | (1 << CS21) | (1 << CS20); // prescaler 1024
^~~~
C:\Users\dansh\Downloads\doom-nano\sound.h:39:3: error: 'OCR2A' was not declared in this scope
OCR2A = 112 - 1; // 16000000 / 1024 / 112 -> 139,5 Hz
^~~~~
C:\Users\dansh\Downloads\doom-nano\sound.h:40:3: error: 'TIMSK2' was not declared in this scope
TIMSK2 = (1 << OCIE2A);
^~~~~~
C:\Users\dansh\Downloads\doom-nano\sound.h:40:3: note: suggested alternative: 'TIMERB2'
TIMSK2 = (1 << OCIE2A);
^~~~~~
TIMERB2
C:\Users\dansh\Downloads\doom-nano\sound.h:40:18: error: 'OCIE2A' was not declared in this scope
TIMSK2 = (1 << OCIE2A);
^~~~~~
C:\Users\dansh\Downloads\doom-nano\sound.h: In function 'void setFrequency(uint16_t)':
C:\Users\dansh\Downloads\doom-nano\sound.h:73:3: error: 'TCCR1A' was not declared in this scope
TCCR1A = _BV(COM1A0) /+ _BV(COM1B0)/;
^~~~~~
C:\Users\dansh\Downloads\doom-nano\sound.h:73:3: note: suggested alternative: 'TCB1'
TCCR1A = _BV(COM1A0) /+ _BV(COM1B0)/;
^~~~~~
TCB1
In file included from c:\users\dansh\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino5\avr\include\avr\io.h:99:0,
from c:\users\dansh\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino5\avr\include\avr\pgmspace.h:90,
from C:\Users\dansh\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.7\cores\arduino/api/String.h:31,
from C:\Users\dansh\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.7\cores\arduino/api/IPAddress.h:24,
from C:\Users\dansh\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.7\cores\arduino/api/ArduinoAPI.h:30,
from C:\Users\dansh\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.7\cores\arduino/Arduino.h:23,
from C:\Users\dansh\AppData\Local\Temp\arduino-sketch-2898B900DAB4DC70159A363E88D22165\sketch\doom-nano.ino.cpp:1:
C:\Users\dansh\Downloads\doom-nano\sound.h:73:16: error: 'COM1A0' was not declared in this scope
TCCR1A = _BV(COM1A0) /+ _BV(COM1B0)/;
^
In file included from C:\Users\dansh\Downloads\doom-nano\doom-nano.ino:8:0:
C:\Users\dansh\Downloads\doom-nano\sound.h:74:3: error: 'TCCR1B' was not declared in this scope
TCCR1B = (1 << WGM12) | prescalerBits; // CTC
^~~~~~
C:\Users\dansh\Downloads\doom-nano\sound.h:74:3: note: suggested alternative: 'TCB1'
TCCR1B = (1 << WGM12) | prescalerBits; // CTC
^~~~~~
TCB1
C:\Users\dansh\Downloads\doom-nano\sound.h:74:18: error: 'WGM12' was not declared in this scope
TCCR1B = (1 << WGM12) | prescalerBits; // CTC
^~~~~
C:\Users\dansh\Downloads\doom-nano\sound.h:75:3: error: 'TCCR1C' was not declared in this scope
TCCR1C = _BV(FOC1A);
^~~~~~
C:\Users\dansh\Downloads\doom-nano\sound.h:75:3: note: suggested alternative: 'TCB1'
TCCR1C = _BV(FOC1A);
^~~~~~
TCB1
In file included from c:\users\dansh\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino5\avr\include\avr\io.h:99:0,
from c:\users\dansh\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino5\avr\include\avr\pgmspace.h:90,
from C:\Users\dansh\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.7\cores\arduino/api/String.h:31,
from C:\Users\dansh\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.7\cores\arduino/api/IPAddress.h:24,
from C:\Users\dansh\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.7\cores\arduino/api/ArduinoAPI.h:30,
from C:\Users\dansh\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.7\cores\arduino/Arduino.h:23,
from C:\Users\dansh\AppData\Local\Temp\arduino-sketch-2898B900DAB4DC70159A363E88D22165\sketch\doom-nano.ino.cpp:1:
C:\Users\dansh\Downloads\doom-nano\sound.h:75:16: error: 'FOC1A' was not declared in this scope
TCCR1C = _BV(FOC1A);
^
In file included from C:\Users\dansh\Downloads\doom-nano\doom-nano.ino:8:0:
C:\Users\dansh\Downloads\doom-nano\sound.h:76:3: error: 'OCR1A' was not declared in this scope
OCR1A = top;
^~~~~
C:\Users\dansh\Downloads\doom-nano\sound.h: In function 'void off()':
C:\Users\dansh\Downloads\doom-nano\sound.h:80:3: error: 'TCCR1A' was not declared in this scope
TCCR1A = 0;
^~~~~~
C:\Users\dansh\Downloads\doom-nano\sound.h:80:3: note: suggested alternative: 'TCB1'
TCCR1A = 0;
^~~~~~
TCB1

exit status 1

Compilation error: expected initializer before 'case'

The Nano Every, using the ATmega 4809, is based on an entirely different processor than the Nano (or Uno) which uses the ATmega 328. The only thing the boards share in common is the physical size, the name and the pin out.

The code you are trying to uses is written for the Registers of the ATmega328 and they are not valid for the ATmega 4809.

Many people, myself included, think that Arduino made an error in confounding the two devices and you would not be the first Nano Every user who expected to port over programs from the standard Nano and ran into problems with low level register code.

You would probably find it easier to port your code over to a Mega which uses registers similar to the Uno/Nano than to work your way through the data sheet to convert the code for a Nano Every.

2 Likes

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.