Un ROV de agua dulce / A sweet water ROV

Buenas tardes.

Lo primero que tengo que hacer es darle las gracias por su tiempo y por sus indicaciones, que sin duda, son de gran valor para mí.

Resulta muy difícil pedir ayuda sobre un proyecto, si no se explica de alguna manera, y también resulta muy difícil explicar un proyecto de más de 4 años de investigación, en muy pocas líneas. Por lo que le pido disculpas por la extensión de mis comentarios. Pero si necesito su ayuda, también necesito explicarle todos mis problemas desde el principio.

Le cuento un poco mi historia, para ponerle en antecedentes, y aclararle varias cosas sobre mí, y sobre mi proyecto.

Estoy metido en este proyecto desde el 2.016, que me surgió la idea después de leer varias páginas de Internet, donde explicaban cómo hacer proyectos de vehículos con Arduino, donde explicaban más o menos, tanto el proceso de construcción de la parte exterior del vehículo, como el programa de control con Arduino, pero a todas las paginas les falta algo por explicar, quizás esa última y definitiva, actualización del proyecto.

Pero yo no sabía, que a todas las paginas les faltaba la última actualización para que el proyecto funcionase como es debido, a esa conclusión he llegado a base de iniciar proyectos y no poder terminarlos, por falta de un ultimo empujón, aclarando los pormenores de los “errores”, o problemas de programación.

Lo primero que he hecho siempre, es informarme como funciona cualquier sensor, o parte del proyecto utilizado, por separado, y después de tener éxito en el funcionamiento de ese código solo para el funcionamiento de ese componente en concreto, lo he juntado al código de control del ROV, con el resto de instrucciones que funcionaban juntas.

Le cuento todo esto, para explicarle, que no he iniciado un código de 700 líneas, de inicio, si no que he llegado a esas 700 líneas poco a poco, sumando códigos que funcionaban.

Hasta que he llegado al punto, en que no entiendo, porque si el código solo funciona, y he adjuntado todas las líneas al código de control, este código de control, no funciona tan bien como funciona solo. He llegado a la conclusión de que estaba forzando las posibilidades del Arduino Mega 2560, pero esta conclusión se queda sin consistencia, cuando descubrí los códigos de las impresoras 3D, con más de 5.000 líneas de código, eso sí es llegar al límite de las posibilidades de Arduino, y no lo que yo estoy haciendo.

Otro de los problemas más importantes que he tenido, es que me he registrado en varios foros de construcción de modelos similares a mi proyecto, en los que hay verdaderos artistas y “manitas”, en la construcción de modelos, pero no he encontrado a ningún programador experimentado que de verdad, que supiera realmente lo que estaba aconsejándome, y en vez de ayudarme a arreglar el código, lo hemos terminado de estropear.

Por ejemplo hay una línea que me han dicho de quitar varias veces, porque estaba leyendo la estructura del programa 5 veces, y estorbaba en el código, es esta:

for (int i = 0; i < 5; i++) {}

Cuando de verdad lo que hace esta línea, es ayudar a la librería EasyTransfer, en la comunicación de los dos Arduinos, alternando cada 5 segundos, el estado de Arduino, entre la Lectura de datos, y el envió de datos.

Hasta ahora la explicación que tiene más sentido, es la suya, no la que me han dado otros con la intención de ayudar. Y posiblemente ese sea unos de los errores de programación, que impiden que el programa funcione bien.

En cuanto a los problemas de PIO con Atom, ya he leído en este foro, que casi nadie utiliza Atom, todos utilizan otro entorno, lo que me ha llevado a pensar en cambiar de plataforma en este momento, antes de aprender a utilizar algo que no me va a ser de utilidad, por lo tanto voy a cambiar inmediatamente Atom, por VSCode.

Y en cuanto a los problemas de Arduino con PIO, también he leído en este foro que causa bastantes quebraderos de cabeza solucionar algunos problemas de programación, y hay que utilizar parches o comandos de compatibilidad, que no entiendo, y no soy capaz de adoptar.

Ya he comprado y estoy esperando que me lleguen próximamente, unas placas ESP32, con las que será más fácil depurar los programas, sin perder la compatibilidad con Arduino.

Algo que verdaderamente me preocupa, es su comentario sobre el mando de PS2, que no sé cómo debo interpretar esto

“también tendría que simular la entrada de PSX, lo cual no es realmente factible en su caso específico.”

Usted me quiere decir que no voy a poder usar el mando de PS2 con PIO, de ninguna manera, aunque use otro tipo de placa.

O me quiere decir que no puedo usar el mando con Arduino en PIO, con la configuración que tengo ahora mismo.

De no poder usar este tipo de mando PSX, ¿Qué otro tipo de mando para control puedo utilizar para sustituirlo?

Por supuesto que tengo cruzados los pines TX y RX de un Arduino con el otro, es uno de los primeros errores que se cometen, y que ya solucione hace tiempo, pero gracias por su observación al respecto.

En su último párrafo no sé lo que me quiere decir, entiendo que me está diciendo que se realizan demasiadas tareas en el programa, y que tendría que dividirlo en varias funciones o archivos.

¿Cómo?

Mientras usted me contesta, voy a intentar averiguar algo sobre esto en Internet, pero dado mi experiencia en otras dudas, creo que solo voy a conseguir confundirme más de lo que ya estoy, pero aun así, voy a intentarlo, aunque solo voy a adoptar los consejos que usted me diga.

Muchas gracias por sus consejos y observaciones.

Espero que no se desanime con mis comentarios tan extensos, y siga ayudándome, muchas gracias.

Un saludo

Good afternoon.

The first thing I have to do is thank you for your time and for your directions, which are undoubtedly of great value to me.

It is very difficult to ask for help on a project, if not explained in any way, and it is also very difficult to explain a project of more than 4 years of research, in very few lines. So I apologize for the extension of my comments. But if I need your help, I also need to explain all my problems from the beginning.

I tell you a little bit about my story, to put you in the background, and clarify several things about me, and about my project.

I have been involved in this project since 2.016, which came up with the idea after reading several pages of the Internet, where they explained how to do vehicle projects with Arduino, where they explained more or less, both the process of construction of the outside of the vehicle, and the control program with Arduino, but all the pages are missing something to explain , perhaps that last and definitive, project update.

But I did not know, that all the pages lacked the last update for the project to work as it should, that conclusion I have come to start projects and not be able to finish them, for lack of a last push, clarifying the details of the “errors”, or programming problems.

The first thing I have always done is to inform myself how any sensor, or part of the project used, works, separately, and after succeeding in the operation of that code just for the operation of that particular component, I have put it together to the ROV control code, with the rest of instructions that worked together.

I tell you all this, to explain, that I have not started a code of 700 lines, starting, but that I have reached those 700 lines gradually, adding codes that worked.

Until I’ve reached the point, where I don’t understand, because if the code only works, and I’ve attached all the lines to the control code, this control code, doesn’t work as well as it works alone. I have come to the conclusion that I was forcing the possibilities of the Arduino Mega 2560, but this conclusion runs out of consistency, when I discovered the codes of 3D printers, with more than 5,000 lines of code, that is to reach the limit of Arduino’s possibilities, and not what I am doing.

Another of the most important problems that I have had, is that I have registered in several forums of construction of models similar to my project, in which there are real artists and “handymen”, in the construction of models, but I have not found any experienced programmers who really, who really knew what was advising me, and instead of helping me fix the code, we have finished spoiling it.

For example there is a line that I have been told to remove several times, because I was reading the structure of the program 5 times, and I was in the way in the code, it is this:

for (int i = 0; i < 5; i++) {}

When what this line really does, is to help the EasyTransfer library, in the communication of the two Arduinos, alternating every 5 seconds, the state of Arduino, between Data Reading, and data sending.

So far the explanation that makes the most sense is yours, not the one given to me by others with the intention of helping. And possibly that’s some of the programming errors, which prevent the program from working well.

As for the problems of PIO with Atom, I have already read in this forum, that almost no one uses Atom, everyone uses another environment, which has led me to think about changing platforms at this time, before learning to use something that will not be useful to me, therefore I will immediately change Atom, by VSCode.

And as for the problems of Arduino with PIO, I have also read in this forum that causes quite a few headaches to fix some programming problems, and you have to use patches or compatibility commands, which I do not understand, and I am not able to adopt.

I have already purchased and am waiting for to arrive soon, ESP32 boards, with which it will be easier to debug the programs, without losing compatibility with Arduino.

One thing that really worries me is your comment on the PS2 command, which I don’t know how I should interpret this

“you would also have to simulate PSX input, which is not really feasible in your specific case.”

You want to tell me that I won’t be able to use the PS2 controller with PIO, in any way, even if I use another type of board.

Or it means that I can’t use the controller with Arduino in PIO, with the settings I have right now.

If I can’t use this type of PSX controller, what other type of control controller can I use to replace it?

Of course I have crossed the TX and RX pins of one Arduino with the other, it is one of the first mistakes that are made, and that already solved a long time ago, but thank you for your observation about it.

In your last paragraph I don’t know what you mean, I understand that you’re telling me that too many tasks are done in the program, and that I would have to divide it into various functions or files.

How?

While you answer me, I’m going to try to find out something about this on the Internet, but given my experience in other doubts, I think I’m only going to get more confused than I already am, but I’m still going to try, even though I’m just going to adopt the advice you tell me.

Thank you very much for your advice and observations.

I hope you will not be discouraged by my very extensive comments, and continue to help me, thank you very much.

A greeting

Buenas noches.

Ya he desinstalado todo el paquete de Atom, y he instalado todo el entorno Visual Studio Code.

Me resulta mucho más difícil trabajar con este entorno, que con Atom.

Con Atom, no me daba problemas de la placa, y con VSC, no me deja compilar los programas, me da el siguiente error, cuando pulso Run > Start debugging

Could not find the specified task

Y las opciones son estas

Configure task, Open launch.json, Cancel

Con Arduino, los programas compilan

Good night.

I’ve already uninstalled the entire Atom package, and I’ve installed the entire Visual Studio Code environment.

I find it much harder to work with this environment than with Atom.

With Atom, it gave me no board problems, and with VSC, it won’t let me compile the programs, it gives me the following error, when I hit Run > Start debugging

Could not find the specified task

And the options are these

Configure task, Open launch.json, Cancel

With Arduino, programs compile

Arreglado con esta publicación
Fixed with this post.

Aunque en las opciones he podido poner en alguna parte, que utilice las Librerías de Arduino, me ha tocado instalarlas de nuevo, y no encuentro la librería Easy Transfer.

Hay una opción, que es instalar una extensión, que es un paquete compatible con Arduino, entonces cuando le doy a Run > Start debugging, si hace algo, pero me sale este otro mensaje de error

Conflicted extensions with IntelliSense service were detected (Arduino). Code-completion, linting and navigation will not work properly. Please disable or uninstall them (Menu > View > Extensions).

Por lo tanto estoy en las mismas, no puedo comprobar el funcionamiento del programa, por lo menos con Atom, me confirmaba que los programas compilaban, con VSC, no puedo saber si compilan o no.

Although in the options I have been able to put somewhere, that I use the Arduino Libraries, I have had to install them again, and I can’t find the Easy Transfer library. .
There is an option, which is to install an extension, which is a package compatible with Arduino, then when I hit Run > Start debugging, if you do something, but I get this other error message

Conflicted extensions with IntelliSense service were detected (Arduino). Code-completion, linting and navigation will not work properly. Please disable or uninstall them (Menu > View > Extensions).

Therefore I am in them, I can not check the operation of the program, at least with Atom, confirmed to me that the programs compiled, with VSC, I can not know if they compile or not.

Buenas noches.

Ya puedo ver el funcionamiento del programa en VSC, pero me da el siguiente error de biblioteca.

Good night.

I can already see how the program works in VSC, but it gives me the following library error.

DEBUG: Current (simavr) On-board (simavr)
PACKAGES:
 - framework-arduino-avr 5.0.0
 - toolchain-atmelavr 1.50400.190710 (5.4.0)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 14 compatible libraries
Scanning dependencies...
No dependencies
Building in debug mode
Compiling .pio\build\megaatmega2560\src\main.cpp.o
Compiling .pio\build\megaatmega2560\FrameworkArduino\abi.cpp.o
src\main.cpp:154:54: fatal error: PS2X_lib.h: No such file or directory

******************************************************************
* Looking for PS2X_lib.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:PS2X_lib.h"
* Web  > https://platformio.org/lib/search?query=header:PS2X_lib.h
*
******************************************************************

compilation terminated.
*** [.pio\build\megaatmega2560\src\main.cpp.o] Error 1
===================================================== [FAILED] Took 6.84 seconds =====================================================
The terminal process terminated with exit code: 1

Terminal will be reused by tasks, press any key to close it.

The PS2X library is not yet registered with PlatformIO – I suggest you go to GitHub - simondlevy/PS2X_lib: Arduino Playstation2 library with compiler warnings fixed, download the ZIP file (https://github.com/simondlevy/PS2X_lib/archive/master.zip), then create a new folder in lib/ called PS2X_lib where you put in the files from the ZIP file so that the structure is …

lib/
   PS2X_lib/ 
      PS2X_lib.cpp
      PS2X_lib.h
      ...

then add the line

lib_deps = 
   PS2X_lib

into the platformio.ini so that the library is looked for by PlatformIO.

1 Like

The PlatformIO and Arduino extension are not compatible with each other – remove one of them.

1 Like

Same procedure as above – this is not registered in the PIO library registry (PlatformIO Registry) so you’d need to manually add it in the lib/ folder – downloads are available at the library’s github page which I linked above: GitHub - madsci1016/Arduino-EasyTransfer: An Easy way to Transfer data between Arduinos.

1 Like

Todas mis preguntas y problemas se han solucionado con estas 3 respuestas de Maxgerhardt, muchas gracias.

All my questions and problems have been solved with these 3 maxgerhardt answers, thank you very much.

Buenas noches.
Lo primero que yo tengo que hacer es darle a usted las gracias por su tiempo y sus comentarios, y por haberse leído las 50.000 líneas de mis explicaciones del proyecto y mis problemas.
Sus respuestas me están siendo de gran ayuda, muchas gracias, de verdad.
Ahora mis preguntas como puede ver, son mucho más cortas y concretas. Espero que no se canse de contestarme, realmente usted me está siendo de gran ayuda.

Un saludo, y muchas gracias

Good night.
The first thing I have to do is thank you for your time and feedback, and for reading the 50,000 lines of my explanations of the project and my problems.
Your answers are being of great help to me, thank you very much, really.
Now my questions as you can see, are much shorter and more concrete. I hope you don’t get tired of answering me, you’re really being very helpful to me.

Greetings, and thank you very much.

Creo que sería buena idea, decirles a los administradores, que deberían dejar subir los códigos como ficheros adjuntos comprimidos, para que se pudieran ver al otro lado de mi pantalla, y ustedes pudieran ver los errores de código como los veo yo.

I think it would be a good idea to tell the administrators, that they should let the codes go up as compressed attachments, so that they could be seen on the other side of my screen, and you could see the code errors as I see them.

Bueno, ahora que los programas ya no me dan errores de compilación, gracias a las respuestas de Maxgerhardt, debería de pasar al siguiente paso, que el VSC, me dijese de alguna manera, como se comporta el programa, que hay que mejorar, cuánto tiempo se tarda en ejecutar el programa, que instrucciones están retrasando la ejecución del programa, por que otras órdenes las debería de cambiar, etc.
No sé cómo explicarlo, que VSC, me diga algo mas a cerca de los códigos. Para que me diga VSC, algo más que el programa compila, que eso ya lo sabía antes con el IDE de Arduino.
Pero no veo que otros botones de opciones ni de ejecución hay, el botón más interesante que he visto es el de RUN, con el que se construye y se compila el programa, pero en mi caso, eso ya lo traía hecho desde el IDE de Arduino.
Un saludo.

Well, now that the programs no longer give me compilation errors, thanks to Maxgerhardt’s responses, I should move on to the next step, that the VSC, I would say somehow, how the program behaves, that it has to improve, how long it takes to run the program, that instructions are delaying the execution of the program, because other commands should change them Etc.
I don’t know how to explain it, that VSC, tell me something else about the codes. To tell me VSC, more than just the program compiles, that I already knew that before with the Arduino IDE.
But I do not see that other options or execution buttons there, the most interesting button I have seen is that of RUN, with which the program is built and compiled, but in my case, that already brought it done from the Arduino IDE.
Greetings.

I’m not quiet sure if I read this correctly, but there are a lot more features in PlatformIO than the “Build” and “Upload” button. See the documentation at Your Gateway to Embedded Software Development Excellence — PlatformIO latest documentation. A main feature is the easy project configuration with which one can create multiple environments for different target boards or source code files.

I know that in your particular case you’d like extended debugging on the AVR, but as said above that’s not there yet for the AVR. Although we might want to revisit VSCode PIO debugger for AVR which may be a working AVR debugger using a serial adapter…

Either directly copy-paste code in Markdown formatted text (Markdown Cheatsheet · adam-p/markdown-here Wiki · GitHub) or upload it on popular platforms such github.com as e.g. a gist (https://gist.github.com/) and post the link to, like e.g.

Anyways if there are code compilation problems or question on general programming or “why does this code fail” question, I can answer them.

1 Like

Buenas noches.

Muchísimas gracias por su tiempo y sus respuestas, quiero que sepa que le estoy muy agradecido, y me estoy tomando sus respuestas muy enserio, y me están ayudando mucho a resolver mis problemas de novato.

Si usted está leyendo bien, precisamente a eso me refiero, a hacer algo más que “Construir” y “Cargar” un programa.

Lo de subir los programas, entiendo que es falta de costumbre de utilizar el foro, y no saber cómo hacerlo, al no ver un botón para adjuntar los archivos del programa, digamos que ha sido un pensamiento en voz alta, porque entendía que tenía que haber una manera de hacerlo, y a demás tiene que ser fácil, pero yo no entendía ni encontraba cómo hacerlo.

Muchas gracias por los enlaces.

Todavía no estoy registrado en Github, porque entiendo que es una página lo bastante seria, como para publicar mis programas que no funcionan, y no estoy orgulloso de ellos para nada, y lo mas que puedo conseguir es que alguien los encuentre y me llame la atención, con razón, por publicar una cosa que no funciona.

Voy a leer los enlaces que me ha puesto, para comprobar si se puede hacer algo más con VSC y PIO, sobre la placa Arduino Mega 2560, pero por lo que usted me dice, intuyo que voy a poder hacer poco más de lo que ya he hecho, con su ayuda.

Ya hace unos días que compre unas placas ESP32, y están de camino, no deben de tardar en llegarme, supongo que con estas placas si voy a poder hacer más cosas con los programas, y luego, devolver los programas a Arduino, o quedarme con los ESP32, ya puestos me daría igual usar unas placas u otras en mi proyecto, lo que me interesa, es que los programas funcionen correctamente.

Adelantándome bastante a los acontecimientos, ya que no tengo todavía los ESP32, supongo que se podrán utilizar los programas con la estructura que tienen, aunque haya que hacer alguna VARIACIÓN MÍNIMA del programa y de los pines utilizados. Ya he leído en varios sitios, que hay algunos pines que no se pueden utilizar para conectar componentes externos, puesto que esos pines son utilizados para el propio sistema y funcionamiento del ESP32.

Me refiero a que haya un ESP32 dentro del vehículo, que controle los ESC o BEC de los motores, y que controle los sensores así como sus datos, y los envié a otro ESP32 que esté en el puesto de control, y mediante EasyTransfer, por un cable CAT6, y que reciba esos datos. Y que esos datos los pueda ver en una pantalla Nextion de 5 pulgadas. Que con el ESP32 de control, pueda manejar el mando de PS2, y el otro ESP32, reciba esos datos del mando y los interprete. Pudiendo aprovechar al máximo los programas que ya tengo hechos.

Entiendo que la mejor manera de aprovechar las placas ESP32 es con la comunicación wifi, pero mi proyecto tiene el problema añadido de que el ROV, cuando trabaja, está sumergido en el agua, por lo tanto la opción de usar la wifi, queda descartada, por eso es que utilizo EasyTransfer y el cable.

Muchas gracias de nuevo, por ofrecerme su ayuda en la programación, pero creo que ahora mismo podemos hacer poco más de lo que ya hemos hecho, sin las pacas ESP32.

No estoy rechazando su ayuda, ni mucho menos, pero en este momento, como comenta usted en su respuesta, no podemos hacer una depuración extendida de los códigos. De todas formas, voy a leer los enlaces, a ver si se pudiera hacer algo más.

Voy a subir los códigos, siguiendo sus instrucciones, para que los vea, por curiosidad, por si usted ve algo que le pueda resultar “incomodo de procesar” por cualquiera de las placas, y como entrenamiento de adjuntar los ficheros.

Le vuelvo a dar las gracias por su tiempo y sus comentarios, es un lujo poder contar con sus respuestas, está siendo un tutor magnifico, muchas gracias.

Y no se preocupe, que voy a seguir publicando cualquier mas mínima duda que tenga.

Un saludo.

Good night.

Thank you very much for your time and your answers, I want you to know that I am very grateful to you, and I am taking your answers very seriously, and are helping me a lot to solve my rookie problems.

If you are reading well, that’s exactly what I mean, to do more than “Build” and “Load” a program.

I understand that it is unusual to use the forum, and not knowing how to do it, by not seeing a button to attach the program files, let’s say it was a thought out loud, because I understood that there had to be a way to do it, and others it has to be easy, but I did not understand or find how to do it.

Thank you very much for the links.

I’m not registered on Github yet, because I understand that it’s a serious enough page, to publish my programs that don’t work, and I’m not proud of them at all, and the most I can get is for someone to find them and get my attention, rightly, for posting a thing that doesn’t work.

I will read the links you have put me, to check if you can do something else with VSC and PIO, on the Arduino Mega 2560 board, but from what you tell me, I intuit that I will be able to do little more than I have already done, with your help.

Already a few days ago I bought some ESP32 plates, and they are on their way, they should not take long to arrive, I suppose with these plates if I will be able to do more things with the programs, and then, return the programs to Arduino, or stay with the ESP32, already put I would not mind using some plates or others in my project, which I am interested in , is that the programs work properly.

Getting in the way of the events, since I don’t have the ESP32 yet, I suppose you will be able to use the programs with the structure that they have, even if you have to do some MINIMUM VARIATION of the program and the pins used. I have already read in several sites, that there are some pins that cannot be used to connect external components, since those pins are used for the system itself and operation of the ESP32.

I mean that there is an ESP32 inside the vehicle, that controls the ESC or BECs of the engines, and that controls the sensors as well as their data, and I sent them to another ESP32 that is at the checkpoint, and via EasyTransfer, by a CAT6 cable, and that receives that data. And let that data be seen on a 5-inch Nextion screen. That with the ESP32 control, you can operate the PS2 command, and the other ESP32, receive that data from the controller and interpret it. Being able to make the most of the programs that I already have made.

I understand that the best way to take advantage of ESP32 boards is with wifi communication, but my project has the added problem that the ROV, when working, is submerged in water, therefore the option to use the wifi, is discarded, that is why I use EasyTransfer and the cable.

Thank you very much again, for offering me your help in programming, but I think right now we can do little more than we have already done, without the ESP32 bales.

I’m not refusing your help, much less, but at this time, as you say in your response, we can’t do an extended debugging of the codes. Anyway, I’m going to read the links, see if anything else could be done.

I will upload the codes, following your instructions, so that you see them, out of curiosity, in case you see anything that you may find “uncomfortable to process” by any of the plates, and as a training to attach the files.

I thank you again for your time and your comments, it is a luxury to have your answers, you are being a magnificent tutor, thank you very much.

And don’t worry, I’m going to keep posting any more doubts I have.

Greetings.

Bueno, pues ya me he registrado en Github, más que nada, porque como los programas tienen tantas líneas de código, no los puedo publicar como texto en el foro de Platform IO.

Los he llamado “Programas ROV en evolución”, y en el nombre de cada programa, he puesto la advertencia “no funcionan aun”, para que nadie que pueda verlos se confunda con programas listos para utilizar, cuando estén terminados, editare los títulos y los cambiare por “ya funcionan”, u otra cosa que se me ocurra cuando llegue el momento.

Este es el enlace a los programas.

Un saludo.

Well, I’ve already registered on Github, mostly, because since programs have so many lines of code, I can’t post them as text on the Platform IO forum.

I’ve called them “EVOLVING ROV Programs,” and in the name of each program, I’ve put the “not work yet” warning, so that no one who can see them is mistaken for ready-to-use programs, when they’re finished, edit the titles and change them to “they already work”, or something else I can think of when the time comes.

This is the link to the programs.

Greetings.

Maxgerhardt, quiero pedirte un favor.

Quieres abrir el enlace de Github, y mirar si puedes trabajar con él, me refiero a descargar los programas y las librerías, y comprobar que lo puedes pasar al programa con el que tu trabajes, quiero comprobar que lo he hecho bien.

Muchas gracias, un saludo

Maxgerhardt, I want to ask you a favor.

You want to open the Github link, and see if you can work with it, I mean download the programs and libraries, and check that you can pass it to the program you work with, I want to check that I have done well.

Thank you very much, a greeting

Buenos días.
Maxgerhardt, ya he leído los enlaces sobre la depuración extendida

Pero lamento comentarle que son demasiado complicados para mi, y se escapan a mis conocimientos, por lo tanto me toca esperar a que me lleguen las placas ESP32.

Muchas gracias, un saludo.

Good morning.
Maxgerhardt, I’ve already read the links about extended debugging

But I regret to tell you that they are too complicated for me, and they are beyond my knowledge, so it is my turn to wait for the ESP32 plates to arrive.

Thank you very much, a greeting.

Buenas noches.

Leyendo el tema

Donde se comenta, Como crear un proyecto Arduino de múltiples archivos cpp, y leyendo los enlaces a los que hace referencia de cómo dividir un programa, he entendido como hacerlo, y creo que no es tan difícil.

Aplicándolo a mi proyecto, y a posibles proyectos futuros, donde tenga que utilizar los mismos sensores.

Si yo me hago un programa donde solo haga funcionar un sensor, por ejemplo el giroscopio GY-MPU6050, cuando lo tenga que volver a utilizar el giroscopio, solo tengo que decirle al programa nuevo, que me incluya ese programa que ya hace trabajar al MPU6050, y no tendría que volver a escribir todas las líneas del código, que hacen trabajar al giroscopio.

Por ejemplo

Nombre del programa que yo he hecho para que funcione el giroscopio

MPU6050.cpp

Que está dentro de la carpeta

C:\mis_sensores\MPU60550.cpp

La orden seria

#Include “mis_sensores“ // carpeta donde están los códigos de los distintos sensores

Void set up

Init MPU6050 // inicia el giroscopio

Void loop

Int MPU6050.cpp (); // utiliza todas las ordenes del programa de trabajo de giroscopio

Y no tendría que escribir nada más para que el giroscopio funcionase.

Un saludo.

Good night.

Reading the topic

Where we comment, How to create an Arduino project of multiple cpp files, and reading the links to which it refers to how to split a program, I understood how to do it, and I think it is not that difficult.

Applying it to my project, and to possible future projects, where I have to use the same sensors.

If I do a program where I only run a sensor, for example the GY-MPU6050 gyroscope, when I have to use it again the gyroscope, I just have to tell the new program, to include that program that already makes the MPU6050 work, and I would not have to rewrite all the lines of the code, which make the gyroscope work.

For example

Name of the program I’ve done to make the gyroscope work

MPU6050.cpp

That’s inside the folder

C:\mis_sensores\MPU60550.cpp

The order would be

#Include “mis_sensores” // folder where the codes of the different sensors are

Void set up

Init MPU6050 // starts the gyroscope

Void loop

Int MPU6050.cpp (); // uses all the orders of the gyroscope work program

And I wouldn’t have to write anything else for the gyroscope to work.

Greetings.

Hola, no me he leído tus 50k lineas tal como le agradeces a maxgerhardt, hay otros modos de usar tus librerías y es precisamente creando una Clase que incluya los procedimientos que necesites.
Lo que haces es usar una especie de extensión de tus procedimientos, variables, constantes para poder incluirlas en un código nuevo y esta mas que bien. El siguiente nivel es justamente lo que te aconsejo, una clase. Creas procedimientos publicos y otros de caracter privado, al igual que con las variables.

Como nadie te ha llamado la atención, yo no traduciré al inglés.

PD: luego leeré tu detalle del ROV que es lo que me interesó.

Gracias Surbyte por contestar, estudiare tu propuesta.

Mi nivel de Ingles es casi nulo, y tengo que traducir con San Google, y al copiar el texto aqui en la publicación correspondiente, resulta que me lo vuelve a traducir, y al final no se en que idioma se ha publicado, a lo mejor por eso tengo tan poca ayuda.

Oye tu nombre me suena de otro foro, no serás el mismo Surbyte del foro SpainLabs - Comunidad 3D, Arduino, Raspberry, CNC, y más

El programa ha cambiado bastante desde que publique aquí la ultima vez, ahora esta compuesto por una serie de “pestañas” donde esta incluido el void loop de cada sensor, funciona igual, pero ahora esta algo mas claro de leer.

Voy a intentar adjuntarlo de alguna manera, y si no puedo subirlo, en spainlab esta también.

Como no puedo adjuntar los códigos, pongo el enlace a la página de Github

Un saludo.

Hola, soy novato en platformio. Me he bajado este archivo BME280-to-MySQL-logger-master.
Viene configurado para la tarjeta d1_mini pero necesito configurarlo para la Nodemcu v1 y configurar la velocidad a 115200 en vez de 9600.

¿Me podeis hacer el favor de decirme como configurar platformio.ini y si hay que hacer alguna modificacion mas en el codigo?

Gracias