Hello! I'm trying to building Iron Man helmet from Box and Loop Youtube Video Here
I ordered a knock off Arduino Nano Every from Aliexpress and it's giving me issues. I've found out that it's a Atmega4808 model and I've installed the Thinary AVR Boards plugin but now the code doesn't work. Can someone help me get it to work with this board?
The original code is here:
#include "ServoEasing.h"
ServoEasing servoTop;
ServoEasing servoBottom;
const int action_pin = 2;
const int ledPin = 6;
const int potPin = A0;
int location = 31;
int bottom_closed = 107;
int top_closed = 167;
int bottom_open = 20;
int top_open = 20;
int value;
int maxBrightness;
void setup()
{
pinMode(action_pin, INPUT_PULLUP);
pinMode(potPin, INPUT);
servoTop.attach(9);
servoBottom.attach(10);
setSpeedForAllServos(190);
servoTop.setEasingType(EASE_CUBIC_IN_OUT);
servoBottom.setEasingType(EASE_CUBIC_IN_OUT);
synchronizeAllServosStartAndWaitForAllServosToStop();
}
void loop()
{
value = analogRead(potPin);
maxBrightness = map(value, 250, 750, 0, 255);
int proximity = digitalRead(action_pin);
if (proximity == LOW)
{
if (location > bottom_open) {
servoTop.setEaseTo(top_open);
servoBottom.setEaseTo(bottom_open);
synchronizeAllServosStartAndWaitForAllServosToStop();
location = bottom_open;
delay(10);
analogWrite(ledPin, 0);
} else {
servoTop.setEaseTo(top_closed);
servoBottom.setEaseTo(bottom_closed);
synchronizeAllServosStartAndWaitForAllServosToStop();
location = bottom_closed;
delay(50);
analogWrite(ledPin, maxBrightness / 3);
delay(100);
analogWrite(ledPin, maxBrightness / 5);
delay(100);
analogWrite(ledPin, maxBrightness / 2);
delay(100);
analogWrite(ledPin, maxBrightness / 3);
delay(100);
analogWrite(ledPin, maxBrightness);
delay(100);
}
}
}
When I try to verify/upload this code, this is the error I get. I'm completely new to this and have no idea what to do to fix it:
C:\Users\silen\AppData\Local\Arduino15\libraries\Servo\src\avr\Servo.cpp: In function 'void TIMER1_COMPA_vect()':
C:\Users\silen\AppData\Local\Arduino15\libraries\Servo\src\avr\Servo.cpp:82:31: error: 'TCNT1' was not declared in this scope
handle_interrupts(_timer1, &TCNT1, &OCR1A);
^~~~~
C:\Users\silen\AppData\Local\Arduino15\libraries\Servo\src\avr\Servo.cpp:82:31: note: suggested alternative: 'TCB1'
handle_interrupts(_timer1, &TCNT1, &OCR1A);
^~~~~
TCB1
C:\Users\silen\AppData\Local\Arduino15\libraries\Servo\src\avr\Servo.cpp:82:39: error: 'OCR1A' was not declared in this scope
handle_interrupts(_timer1, &TCNT1, &OCR1A);
^~~~~
C:\Users\silen\AppData\Local\Arduino15\libraries\Servo\src\avr\Servo.cpp: In function 'void initISR(timer16_Sequence_t)':
C:\Users\silen\AppData\Local\Arduino15\libraries\Servo\src\avr\Servo.cpp:128:5: error: 'TCCR1A' was not declared in this scope
TCCR1A = 0; // normal counting mode
^~~~~~
C:\Users\silen\AppData\Local\Arduino15\libraries\Servo\src\avr\Servo.cpp:128:5: note: suggested alternative: 'TCB1'
TCCR1A = 0; // normal counting mode
^~~~~~
TCB1
C:\Users\silen\AppData\Local\Arduino15\libraries\Servo\src\avr\Servo.cpp:129:5: error: 'TCCR1B' was not declared in this scope
TCCR1B = _BV(CS11); // set prescaler of 8
^~~~~~
C:\Users\silen\AppData\Local\Arduino15\libraries\Servo\src\avr\Servo.cpp:129:5: note: suggested alternative: 'TCB1'
TCCR1B = _BV(CS11); // set prescaler of 8
^~~~~~
TCB1
In file included from c:\users\silen\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\silen\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino5\avr\include\avr\interrupt.h:38,
from C:\Users\silen\AppData\Local\Arduino15\libraries\Servo\src\avr\Servo.cpp:22:
C:\Users\silen\AppData\Local\Arduino15\libraries\Servo\src\avr\Servo.cpp:129:18: error: 'CS11' was not declared in this scope
TCCR1B = _BV(CS11); // set prescaler of 8
^
C:\Users\silen\AppData\Local\Arduino15\libraries\Servo\src\avr\Servo.cpp:129:18: note: suggested alternative: 'B111'
C:\Users\silen\AppData\Local\Arduino15\libraries\Servo\src\avr\Servo.cpp:130:5: error: 'TCNT1' was not declared in this scope
TCNT1 = 0; // clear the timer count
^~~~~
C:\Users\silen\AppData\Local\Arduino15\libraries\Servo\src\avr\Servo.cpp:130:5: note: suggested alternative: 'TCB1'
TCNT1 = 0; // clear the timer count
^~~~~
TCB1
C:\Users\silen\AppData\Local\Arduino15\libraries\Servo\src\avr\Servo.cpp:136:5: error: 'TIFR1' was not declared in this scope
TIFR1 |= _BV(OCF1A); // clear any pending interrupts
^~~~~
In file included from c:\users\silen\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\silen\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino5\avr\include\avr\interrupt.h:38,
from C:\Users\silen\AppData\Local\Arduino15\libraries\Servo\src\avr\Servo.cpp:22:
C:\Users\silen\AppData\Local\Arduino15\libraries\Servo\src\avr\Servo.cpp:136:18: error: 'OCF1A' was not declared in this scope
TIFR1 |= _BV(OCF1A); // clear any pending interrupts
^
C:\Users\silen\AppData\Local\Arduino15\libraries\Servo\src\avr\Servo.cpp:137:5: error: 'TIMSK1' was not declared in this scope
TIMSK1 |= _BV(OCIE1A) ; // enable the output compare interrupt
^~~~~~
C:\Users\silen\AppData\Local\Arduino15\libraries\Servo\src\avr\Servo.cpp:137:5: note: suggested alternative: 'TIMERB1'
TIMSK1 |= _BV(OCIE1A) ; // enable the output compare interrupt
^~~~~~
TIMERB1
In file included from c:\users\silen\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\silen\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino5\avr\include\avr\interrupt.h:38,
from C:\Users\silen\AppData\Local\Arduino15\libraries\Servo\src\avr\Servo.cpp:22:
C:\Users\silen\AppData\Local\Arduino15\libraries\Servo\src\avr\Servo.cpp:137:20: error: 'OCIE1A' was not declared in this scope
TIMSK1 |= _BV(OCIE1A) ; // enable the output compare interrupt
^
exit status 1
Compilation error: exit status 1