
arduino casco iron man
Publicado por Mario (3 intervenciones) el 21/01/2022 22:52:16
Un saludo a todos, haber si alguien me puede ayudar, me he copiado este programa de arduino y me he bajado la librería correspondiente, lo envío al arduino nano pero me da un error y yo no tengo ni idea de todo esto, estoy empezando, quizás alguien me pueda echar un cable:
#include "ServoEasing.hpp"
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);
}
}
}
y el problema que me da es este:
avrdude: ser_open(): can't open device "\\.\COM3": El sistema no puede encontrar el archivo especificado.
Problem uploading to board. See https://support.arduino.cc/hc/en-us/sections/360003198300 for suggestions.
#include "ServoEasing.hpp"
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);
}
}
}
y el problema que me da es este:
avrdude: ser_open(): can't open device "\\.\COM3": El sistema no puede encontrar el archivo especificado.
Problem uploading to board. See https://support.arduino.cc/hc/en-us/sections/360003198300 for suggestions.
Valora esta pregunta


0