Bonjour a tous
Je souhaite réaliser ce projet Anubis & Horus
J'ai tous en ma possession enfin presque, mais comment faire un test sur Tinkercad ou autre avec ces éléments
-Raspberry PI model 4B 8GB
-raspberry cammera module 5MP V1.3
-Arduino Uno WS2812 LED Strips
-Servo MG995
-DC-DC LM2596
-Servo 3pin connectors
Bonjour.
L'aide d'un ami qui fait le même projet, qui n'est pas mieux loti sur Arduino que moi, m'a permis de trouver quelques plans plus simples. Animatronic Stargate Helmet
Cependant, une fois que j'ai réalisée comme le plan, à moins d'une erreur de ma part, j'ai cramé les moteurs (trop de tension)
J'ai du mal à comprendre comment réduire la tentation.
Merci.
J’ai l’impression que tu as succombé à la la tentation de faire directement le montage complet.
D’après tes photos tu utilises moteurs et servos.
Et si tu testais d’abord un seul moteur, puis un seul servo, ne crois tu pas que ce serait plus simple pour bien comprendre comment il faut faire.
Bonjour a tours
sur mon projet un système à installer sur Raspberry pour faire un tracking lier au mouvement de la tête.
Le problème, j'ai beau regarder des tutos, je ne pige pas tous déjà pour faire fonctionner mon Raspberry, en premier lieu, il faudrait bien un système d'exploitation non ? pour vous avouer il y a très longtemps que je n'ai pas pratiqué donc je repartir de
merci de votre aide Video
Oui, les raspberry que le youtuber utilise doivent avoir un rasbydebian il me semble.
c'est le problème avec youtube, il y a la moitié des informations
Mais tu as le logiciel, ou tu veux le faire toi même ?
slt (je suis aussi motion3d)
ce n'est pas claire sur les vidéos, j'ai un plan pour + de détail, mais bon là, je suis un peu largué sur ce projet
je vous donne toutes les infos que j'ai
Pour les led je les connect sur l'arduino ou raspberry ? anubis.pdf (43,2 Ko)
//{"X":90,"Y":90,"ER":90,"EL":90,"servos":1}
#include <Servo.h>
#include <ArduinoJson.h>
#include <Ramp.h>
//*****************************
class Interpolation {
public:
rampInt myRamp;
int interpolationFlag = 0;
int savedValue;
int go(int input, int duration) {
if (input != savedValue) { // check for new data
interpolationFlag = 0;
}
savedValue = input; // bookmark the old value
if (interpolationFlag == 0) { // only do it once until the flag is reset
myRamp.go(input, duration, LINEAR, ONCEFORWARD); // start interpolation (value to go to, duration)
interpolationFlag = 1;
}
int output = myRamp.update();
return output;
}
}; // end of class
Interpolation interpX; // interpolation objects
Interpolation interpY;
Interpolation interpER;
Interpolation interpEL;
Servo myservoX;
Servo myservoY;
Servo earL;
Servo earR;
int pos = 0;
String inputString = "";
bool stringComplete = false;
bool ServoEnabled = false;
int x_val = 90;
int y_val = 90;
int earl_val = 90;
int earr_val = 90;
StaticJsonDocument<200> doc;
void connect_servos(){
myservoX.attach(9);
myservoY.attach(10);
earL.attach(5);
earR.attach(6);
}
void disconnect_servos(){
myservoX.detach();
myservoY.detach();
earL.detach();
earR.detach();
}
void setup() {
pinMode(11, OUTPUT);
Serial.begin(9600);
inputString.reserve(200);
connect_servos();
myservoX.write(90);
myservoY.write(90);
earL.write(90);
earR.write(90);
}
void loop() {
if (stringComplete) {
DeserializationError error = deserializeJson(doc, inputString);
if (error) {
Serial.print(F("deserializeJson() failed: "));
Serial.println(error.c_str());
return;
}
x_val = doc["X"];
y_val = doc["Y"];
earl_val = doc["EL"];
earr_val = doc["ER"];
if (x_val <0 | x_val > 180){
x_val = 90;
}
if (y_val <0 | y_val > 180){
y_val = 90;
}
bool hasLaser = doc.containsKey("laser");
if (hasLaser){
int laser = doc["laser"];
if (laser == 1 ){
digitalWrite(13, HIGH);
}
else{
digitalWrite(13, LOW);
}
}
bool disabled_servos = doc.containsKey("servos");
if (disabled_servos){
int servos = doc["servos"];
if (servos == 0 ){
disconnect_servos();
}
else{
connect_servos();
}
}
inputString = "";
stringComplete = false;
ServoEnabled = true;
Serial.println("{\"status\":\"OK\"}");
}
int x_val_ip = interpX.go(x_val,500);
int y_val_ip = interpY.go(y_val,500);
int er_val_ip = interpER.go(earr_val,1000);
int el_val_ip = interpEL.go(earl_val,1000);
if (ServoEnabled){
myservoX.write(x_val_ip);
myservoY.write(y_val_ip);
earR.write(er_val_ip);
earL.write(el_val_ip);
}
}
void serialEvent() {
while (Serial.available()) {
// get the new byte:
char inChar = (char)Serial.read();
// add it to the inputString:
inputString += inChar;
// if the incoming character is a newline, set a flag so the main loop can
// do something about it:
if (inChar == '\n') {
stringComplete = true;
}
}
}