Snap4Arduino icon indicating copy to clipboard operation
Snap4Arduino copied to clipboard

Block combinations causing bluetooth issues

Open chrisclaynz opened this issue 7 years ago • 2 comments

Hey all. Today I had created a simple rc style robot with x2 dc motors controlled with keystrokes (simple if/then blocks within a forever loop). To ensure the motors stopped when no key was pressed we used the "not" block from the operator section and added a "any key pressed" block from the sensing section. When we have this stop script the bluetooth connection is real bad and the robot quickly disconnects. However, when this is removed bluetooth is absolutely fine. I think this problem may exist with other combinations but I'm baffled as to why this would be the case.

Any ideas most appreciated.

Chris

chrisclaynz avatar Sep 24 '17 04:09 chrisclaynz

Hi Chris! Is not useful for you the comments of this other issue ?

As we said, power source and electronics configuration is important and you can do changes to improve your operation... but I think is better to try to minimize board requests. It does not make sense to be communicating continuously to the board (motors) that does not have to do anything!

Many code options... You can use repeat until blocks or wait until blocks. Then, the communications to the board will be momentary and the rest of the time the code will be into the wait block

I hope you find this useful....

Joan

jguille2 avatar Sep 24 '17 15:09 jguille2

Hi chrisclaynz ,

I had the same issue with my robot. Initially I was using a power bank (5v) which could not provide enough power, so when motors started the bluetooth loosed the connectivity. After added 7.4v (2x3.7v ) or even 6v (4x1.5V), the BT connectivity remains stable. By the way I'm using either the arduino uno VIN power input or arduino uno shield which require higher voltage due to the regulator.

Hope that works for you.

Kind regards, Adrian

adryannn avatar Dec 01 '18 22:12 adryannn