Problems with HC SR04 and servo

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

Post Reply
B electron
Posts: 1
Joined: Mon Jan 07, 2019 3:43 pm
Contact:

Problems with HC SR04 and servo

Post by B electron »

Hello,

I'm having some troubles with programming a distance sensor and a servo.
The servo needs to turn 90 degrees when there's an object within 10 cm in front of the sensor.

Can anyone help me?
Attachments
Flowcode1.fcfx
(12.59 KiB) Downloaded 190 times

viktor_au
Posts: 342
Joined: Fri Jan 26, 2018 12:30 pm
Location: South Australia
Has thanked: 43 times
Been thanked: 60 times
Contact:

Re: Problems with HC SR04 and servo

Post by viktor_au »

Hello

To pass the 1st loop (in the Main loop) you need to create a simulating the HC-SR04 B6 input - in your situation it will be switch component.
Attachments
echo_loop-1.jpg
echo_loop-1.jpg (48.53 KiB) Viewed 2122 times

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Problems with HC SR04 and servo

Post by medelec35 »

Hi B electron,
The forum rules here state:
5. The “Tips and Tricks” sub forum is for sharing your knowledge and NOT for starting off with asking questions.
I will move the topic to V8 section as that is what I'm assuming you are using?
It looks like you are basing your flowchart on mine, but the delays are the wrong values.
Here are the flowcharts side by side:
Compare Flowcharts1.png
(93.81 KiB) Downloaded 784 times
Martin

Post Reply