Go Down

Topic: 2 arduino's over serial (Read 568 times) previous topic - next topic

ADG26

Hello ,

I hav a small isue with i want to have some help with.
I have 2 arduino's , one is driving a dc motor with pwm , enable and directions .Also is there a encoder and a potmeter.
The other one is a remote control witch drives the motor using serial communication and there is also a I2C display attach to this arduino.
The motorarduino has 2 modes: mode one is a normal mode in witch you can drive the motor anyway you want. The second mode is the recordmode with is when you turn the potmeter from 0 to max the upc sets on certain values this value from the encoder in its memory.
When you go back to the normal mode and you turn the pot , the motor goes to these in memory values.
So far everything works well, but now i trie to do this all from the remote.There a have a problem , i use a switch case , with i recieve from the remote , this sets te motorcontroller in the nromal mode or in the record mode.This works wel but now i can't control the motor anymore .The program goes into his correct case , controled with a led , but i can't get any motor commands when the program is in the switch case.
When i use a serial print command afther the serial read, i see that the commands are getting there but not in het case part.

Can somebody help me with this?

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy