Please a little help for programming

Anything to do with programing the Arduino Platform.
asesorplaza1
Posts: 187
Joined: Mar 4th, 2018, 6:11 pm
Location: Valverde de Júcar, Cuenca, España

Please a little help for programming

Post by asesorplaza1 »

Como todos sabéis estoy construyendo un ROV, ( viewtopic.php?f=18&t=1908 ) siguiendo los pasos de ( http://www.techmonkeybusiness.com/rov-c ... ition.html ),
alguien me puede decir porque no puedo cambiar absolutamente nada del código sin que se des-configure absolutamente todo.
Quiero cambiar el sensor de temperatura y humedad para poner el DTH11, o el DTH22, y en cuanto pongo las instrucciones todo lo demás se estropea.
Me pasa lo mismo con el código del sensor de presión, y con cualquier otra cosa que quiera incluir, sin embargo, si hago un sketch, aparte si me funciona, muchas gracias.

As you all know I am building a ROV (viewtopic.php?f=18&t=1908) Following the steps of (http://www.techmonkeybusiness.com/rov-c ... ition.html),
Someone can tell me because I can not change absolutely nothing of the code without deconfiguring absolutely everything.
I want to change the temperature and humidity sensor to put the DTH11, or the DTH22, and as soon as I put the instructions everything else is ruined.
I'm the same with the pressure sensor code, and anything else I want to include, however, if I do a sketch, apart if I work, thank you very much.
User avatar
Oldsirhippy
Posts: 86
Joined: Oct 1st, 2013, 7:18 am

Re: Please a little help for programming

Post by Oldsirhippy »

Hi asesorplaza1,

Please post the code that you are trying to use - the code on the site isn't sufficient to know what you have done that is causing the problems you are having.
With the code include any errors you got when you tried to include your own.
Also - did the original code compile and work in the system you have?
asesorplaza1
Posts: 187
Joined: Mar 4th, 2018, 6:11 pm
Location: Valverde de Júcar, Cuenca, España

Re: Please a little help for programming

Post by asesorplaza1 »

el texto original se compilo bien, lo que no me admite es ningún tipo de modificación.

The original text is compile well, which does not support me is any kind of modification.

o es que hay algo que hago mal

Or is there something I do wrong

muchas gracias por su tiempo

Thank you very much for your time
Attachments
esketch_juntos2.zip
este es el mio, que hace funcionar cosas aparte, que funciona solo

This is mine, which makes things work apart, which works alone
(1.73 KiB) Downloaded 564 times
TM_MAS_MIO.zip
este es cuando intento añadir algo al original, que si se compila, pero no funciona

And this is when I try to add something to the original, that if it is compiled, but doesn't work
(5.06 KiB) Downloaded 549 times
ROVPS2Control_Masterv8.zip
este es el sketch master original

This is the original master sketch
(3.94 KiB) Downloaded 593 times
User avatar
Oldsirhippy
Posts: 86
Joined: Oct 1st, 2013, 7:18 am

Re: Please a little help for programming

Post by Oldsirhippy »

Hi asesorplaza1

What processor board are you using?
asesorplaza1
Posts: 187
Joined: Mar 4th, 2018, 6:11 pm
Location: Valverde de Júcar, Cuenca, España

Re: Please a little help for programming

Post by asesorplaza1 »

Estoy usando la placa Arduino 2560, respetando la posición de los conectores como se explica en la pagina de Technomonkey.
He usado y tambien el Arduino Uno y el Arduino Nano, con todos se comporta igual.

La única conclusión a la que he llegado es que no se programa igual para un skecth sencillo, que para un master, y no se ni encuentro como hacerlo.

Muchas gracias Oldsirhippy, por su tiempo.

I am using the Arduino 2560 board, respecting the position of the connectors as explained in the page of Technomonkey.
I have used and also the Arduino one, and the Arduino Nano, with everyone behaves the same.

The only conclusion I have come is that it does not program the same for a simple skecth, that for a master, and not even find how to do it.

Thank you very much Oldsirhippy, for your time.
User avatar
Oldsirhippy
Posts: 86
Joined: Oct 1st, 2013, 7:18 am

Re: Please a little help for programming

Post by Oldsirhippy »

Hi,

I noticed that these 4 libraries are used:

#include <PS2X_lib.h> // Bill Porter's PS2 Library
#include <EasyTransfer.h> // Bill Porter's Easy Transfer Library
#include <LiquidCrystal.h>
#include <Ultrasonic.h>
#include <DHT.h>

I don't have these - have you looked to see that these libraries are generic and work on any of the arduino variants?
asesorplaza1
Posts: 187
Joined: Mar 4th, 2018, 6:11 pm
Location: Valverde de Júcar, Cuenca, España

Re: Please a little help for programming

Post by asesorplaza1 »

Las librerías son genéricas, se las adjunto para que las tenga.
también se pueden bajar desde la pagina de technomonkey.

tengo instalado el ide de Arduino 1.6.0, que es con el que trabajo, y en otro ordenador tengo instalado el ide 1.8.7, este ide tiene una opción en la que puedes buscar las librerías desde ( https://github.com/ ), y descargarlas y actualizarlas, la mayoría de sketch antiguos no compilan ni funcionan con el, necesita el programa java para funcionar, pero esta muy bien para conseguir librerías de Arduino.

muchas gracias por su tiempo

The bookstores are generic, they are attached to have them.
You can also download them from the Technomonkey page.

I have installed the Arduino 1.6.0 IDE, which is with which I work, and another computer I have installed the IDE 1.8.7, this IDE has an option in which you can search the libraries from (https://github.com/), and download and update them, most of the old sketch does not Compile or work with it, you need the Java program to work, but this very well to get Arduino libraries.

Thank you very much for your time
Attachments
Librerias.zip
(223.77 KiB) Downloaded 553 times
User avatar
Oldsirhippy
Posts: 86
Joined: Oct 1st, 2013, 7:18 am

Re: Please a little help for programming

Post by Oldsirhippy »

Hi asesorplaza1


Does the original code work in your setup with the transmit and receive arduinos ?

The struct RECEIVE_DATA_STRUCTURE{ and struct SEND_DATA_STRUCTURE{ I believe determine the data structure to be sent to the serial interface between the 2 arduinos, presumably you want to send the humidity readings in the ROV to the surface - I didn't see how you are doing that.

Have you tested the code you wrote in stand alone mode before adding it to the original code?

When you add your code to the original I wasn't sure whether you said it compiled and downloaded OK. Is it compiling and downloading?

Can you see where the failure is occurring? i.e. put some Serial.print("I'm here"); lines to ensure that the code is running up to that point.

Unfortunately I can't test your code in a working environment.
User avatar
PhilA
Posts: 42
Joined: Oct 1st, 2017, 12:53 am
Location: Australia

Re: Please a little help for programming

Post by PhilA »

Hi there,

I have had a look at your code and it seems you have only included the 'Master Code' which is for the ROV topside controller only. Where is the DHT11 sensor? Is in topside in the control box or mounted inside the ROV?

The Techmonkey code uses 2 x arduinos communicating with each other. The 'Master code' is for the Arduino in the control box, this sends signals from the PS2 controller to the ROV and receives signals from the ROV and displays it on the LCD screen and activate LED's on/off etc.

The 'Slave code' is for the Arduino in the ROV. This arduino receives the signals from the controller and actions the motors / servo. It also receives any inputs from attached sensors (like depth/temp/voltage) and transmits that data to the topside to be displayed on the LCD screen and/or activate a LED.

If your DHT11 sensor is mounted in the ROV then I believe you need to place DHT11 code to the 'Slave Code' which then transmits the 'result' to the 'Master code' to be displayed on the LCD.

New note: I had a try at adding a basic DHT11 Arduino code to the Master and Slave. I have put '***' next to the lines where it has been added. I can't compile it to test if it works but I think it will somewhat close.
Attachments
DHT11 techmonkey attempt.7z
(6.95 KiB) Downloaded 548 times
asesorplaza1
Posts: 187
Joined: Mar 4th, 2018, 6:11 pm
Location: Valverde de Júcar, Cuenca, España

Re: Please a little help for programming

Post by asesorplaza1 »

Muchas gracias a los dos por su tiempo.
Vamos por partes
a Oldsirhippy
el código de Techmonkey, solo, si he conseguido que funcione en los dos Arduinos, tengo conectado el mando de PS2, según indica, la pantalla LCD falla de vez en cuando, pero creo que es porque no he conectado la batería al ROV, esta todo conectado a una fuente de PC, tengo conectados los led, con sus correspondientes resistencias, y desde el Arduino Maestro las tres conexiones al Arduino Esclavo, en el Esclavo tengo conectado dos motores sin escobillas con su correspondientes controles de velocidad, y sus condensadores y un servo, con su condensador, todo ello funciona cuando muevo las palancas y los botones del mando PS2, segun las instrucciones de Techmonkey.

El código que escribí yo independiente para los sensores, si funciona, se compila, se carga en el Arduino, y me da los valores tanto de los sensores de temperatura, como los movimientos de los servos, y de los motores, y se ejecuta bien, el problema viene cuando lo incluyo en el programa de Techmonkey, que entonces deja de funcionar todo, las funciones del programa de Techmonkey, y las mías.

a PhilA

lo que pasa es que como ya estoy comentando, cuando incluyo la mas mínima modificación en el programa de Techmonkey, ya no se compila, y deja de funcionar, por eso solo he puesto en el Maestro, si no funciona en este, ya no me he molestado en ponerlo en el esclavo.
probare su codigo a ver si funciona muchas gracias.


Thank you very much to both of you for your time.
We go by parties
to Oldsirhippy
Techmonkey code, only, if I have managed to work on the two Arduinos, I have connected the PS2 controller, as indicated, the LCD screen fails from time to time, but I think it is because I have not connected the battery to the ROV, this All connected to a PC source, I have connected the LEDs, with their corresponding resistors, and from the Arduino Maestro the three connections to the Arduino Slave, in the Slave I have connected two brushless motors with their corresponding speed controls, and their capacitors and a servo, with its capacitor, all this works when I move the levers and buttons of the PS2 controller, according to the instructions of Techmonkey.

The code that I wrote independently for the sensors, if it works, is compiled, loaded on the Arduino, and gives me the values ​​of both the temperature sensors, the motions of the servos, and the motors, and runs well , the problem comes when I include it in the Techmonkey program, which then stops working, the functions of the Techmonkey program, and mine.

to PhilA

what happens is that as I am already commenting, when I include the most minimal modification in the Techmonkey program, it is no longer compiled, and it stops working, that's why I only put in the Master, if it does not work in this one, I no longer I have bothered to put him in the slave.
I'll try your code to see if it works, thank you very much.
Post Reply