Asked — Edited
Resolved Resolved by Steve1DH!

V4 Two Way Serial Communication - Where Do I Connect To Read?

Hi all,

I'm trying to get serial feedback from a device. Does anyone know where on the V4 I should attach to read back serial information from device? I know I send a serial command to through one of V4's digital signal pins but where do I read it back from?

I thought it would be read from the same digital pin I sent the command. However @Toymaker made a comment in another thread that it may have to be read through one of the i2c ports.

Any insight is welcomed. :)


ARC Pro

Upgrade to ARC Pro

With Synthiam ARC Pro, you're not just programming a robot; you're shaping the future of automation, one innovative idea at a time.

PRO
Synthiam
#41  

You can't connect the terminal and the ezb and the arduino together at the same time.

#42  

almost there, almost there... indeed, terminal must not be running for it opens the port.

Now... The only reading I get back in EZB is 97... which is char "a"...

What am I missing?

PRO
Synthiam
#43  

sounds like the ezb is writing to itself. check the wiring...

  • EZB UART 1 TX connected to ARDUINO RX
  • EZB UART 1 RX connected to ARDUINO TX
#44  

I triple Check that part. Tomorrow thursday il be able to work on It but only remotely. I'll check again just to make sure.

There's a loop back happening somewhere indeed.

But, really, thank you so much. I knew all the operations and functions but really I'm not yet trained enough to think of them when I'd need them, although I started thinking of serial write right before I read ur advice in that matter which is a start of a beginning of understanding. Let's stay positive! Haha.

Cheers.

PRO
Synthiam
#45  

Yeah - it must be a wiring issue.

The Arduino and ARC code are both solid. The arduino loops for ever until it receives the command 'a' from ARC. Once it receives the command, it transmits the A and B trigger values and resets the counter.

It's an incredibly simple process - so the wiring will be the focus.

Resetting the counter after each query is the right way to monitor encoders. This is because it allows you to see which wheel is rotating quicker/slower since the last query. And if your sample time is ever 1,000 ms, then you can correct the speed with pwm.

If you wish to know the distance traveled, simply keep a running total in ARC of both encoder values.

#46  

Arduino has a separate power source. Maybe I should give both (EZB and Arduino) a common ground?

PRO
Synthiam
#47  

Oh most definitely yes and yes! Always always common ground:). Apologies for not mentioning that before as I assumed they were the same power source.

Always need a common ground. First rule!:)

#48  

that was the issue. Needed a common ground...:) It seems to work now.

thanks a lot Dj!

Now, it took me so long to figure this out thanks to your help that this thread should be referred as a great tutorial for future users who would wish to establish similar com.

Best, Elfège.