Asked May 17 2014

Community Question

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. :)
May 25 2016
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.

DJ Sures
May 26 2016
Yeah - it must be a wiring issue.

The Arduino and EZ-Builder code are both solid. The arduino loops for ever until it receives the command 'a' from EZ-Builder. 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 EZ-Builder of both encoder values.
May 26 2016
Arduino has a separate power source. Maybe I should give both (EZB and Arduino) a common ground?
DJ Sures
May 26 2016
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!:)
May 26 2016
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.