Hello Guys !
Im new in learning C# with the Fez Hydra so please explain your steps if you have an answer .
I want to drive with my Robot Kit and if there is a Wall i want to programm him to turn around and drive back !
I have the HCSR04 Modul and the motordriverl298 and some more modules but i think this are the important modules ! I can succesfully run some Programms but i dont know how to add the HCSR04 . Im using Visual Studio 2012 and cant find the HCSR04 in the Toolbox !
Hope you can help me and explain me step by step what to do !
Thank you
Cant find it with the listet moduls !
Second Picture you can see my Configuration !
@ shia313 - Which SDK do you have installed?
Hey it worked with the latest SDK !
But connet the Sensor but i get false Values !
Every Time i get the Value 5 = ???
This is my simple Code !
GT.Timer wand = new GT.Timer(2000);
wand.Tick +=wand_Tick;
wand.Start();
void wand_Tick(GT.Timer timer)
{
int distance = distanceUS3.GetDistanceInCentimeters();
distance = distanceUS3.GetDistanceInCentimeters();
Debug.Print(distance.ToString());
}
Which is why it was discontinued. The non real time nature of netmf prevents this from being accurate. However, with some tweaking to the driver you maybe able to make it better. Hydra is very fast so it should be able to do it.
Start with the driver source code found on bitbucket
Can you explain me how to use the latest driver from Bitbucket ?
How comfortable are you coding and do you understand how the sensor works?
I´m really new !
I add the library but get the following Error
Typ or Namespacename SocketInterfaces is not available
.
I understand that the sensor give me the Information how close is something .
[quote=“shia313”]I add the library but get the following Error
Typ or Namespacename SocketInterfaces is not available[/quote]
Do you have a project reference to Gadgeteer.dll?
@ shia313 -
Go to bitbucket link, download the sources you need, make any changes if you need, compile the project, refer the dll or cs file to your project.
Here is a tip of how to add reference: How to: Add or Remove References By Using the Add Reference Dialog Box | Microsoft Learn
I compiled the driver and added the Reference but still getting values from -1 to 3.0 = ? ???
Give more info about how you try to set up the module, which socket or pins do you use, post a code and debug and so on…
Here is an Picture ! Thank you Guys for your help ! !
Im using VS2012 and here is my Debug-Log
Dont know how to interpret this values ? I get this values when the sensor is being targeted on nothing ! But also i get this values when i test it with other things !
Using mainboard GHI Electronics FEZ Hydra version 1.2
Program Started
-1
-1
-1
3.0017241379310344
2.9120689655172414
-1
2.9793103448275864
3.1120689655172415
-1
3.1327586206896552
-1
-1
3.0017241379310344
-1
-1
-1
-1
-1
-1
-1
-1
3.0224137931034485
-1
-1
-1
Any Tips how to use the HCSR04 ?
Like I explained before, this module was discontinued because it didn’t work very well due to the non real time nature of netmf. We added a new feature to help with this on our products but hydra is open and doesn’t get all the awesome features other boards have.
Still, hydra should be able to do it. However, this requires you understand how the sensor work to try to optimize the driver. You can also use rlp and build a new interop right into the open source firmware if you are up to the challenge.
I will also keep a note of this and try to improve the driver. I still think it can be done in managed code.