Welcome to Synthiam!

The easiest way to program the most powerful robots. Use technologies by leading industry experts. ARC is a free-to-use robot programming software that makes servo automation, computer vision, autonomous navigation, and artificial intelligence easy.

Get Started
Italy
Asked — Edited

Hc-Sr04

Can someone please teach me how to use it in visual basic?

I need to have sensor sending me a value when i push a button.

How can i do?


ARC Pro

Upgrade to ARC Pro

ARC Early Access will give you immediate updates and new features needed to unleash your robot's potential!

AI Support Bot
Related Content
Synthiam
Italy
#1  
I have connected D0 as 'trigger' and D1 as 'echo'.
I have a label1.
I have a 'Button1' and when i press this, i have written:

Private Sub Button1 click
Dim distance as integer
dist= EzB.Connect2.EZB.HC_SR04.GetValue(Digital.DigitalPortEnum.D0, Digital.DigitalPortEnum.D1)
label1.text=dist
End sub

No distance is reported in label1 when i press the button.
Where am i wronging?
Italy
#2  
The result is always "20".