Shadi, The trouble is that I'm not getting any interrupt on a echo port.
- Netduino Forums
- → Viewing Profile: Posts: rubenhak
Community Stats
- Group Members
- Active Posts 10
- Profile Views 5058
- Member Title Member
- Age Age Unknown
- Birthday Birthday Unknown
-
Gender
Not Telling
User Tools
Friends
rubenhak hasn't added any friends yet.
Latest Visitors
Posts I've Made
In Topic: Troubles with sonar sensors
16 May 2013 - 12:26 AM
In Topic: Troubles with sonar sensors
15 May 2013 - 07:36 PM
Still didn't work. If I use PIN4 it gets stuck in while (lineState == false). If I connect it to PIN5 it gets stuck in while(lineState).
Also when I connect it to PIN13 every time the port Writes(true) or false, it turnes on or off netduinos blue LED.
What am i doing wrong?
Thanks,
Ruben
private int GetDistance() { // First we need to pulse the port from high to low. _port.Active = true; // Put port in write mode _port.Write(true); // Pulse pin _port.Write(false); _port.Active = false;// Put port in read mode; bool lineState = false; // Wait for the line to go high, for start of pulse. while (lineState == false) lineState = _port.Read(); long startOfPulseAt = System.DateTime.Now.Ticks; // Save start ticks. // Wait for line to go low. while (lineState) lineState = _port.Read(); long endOfPulse = System.DateTime.Now.Ticks; // Save end ticks. int ticks = (int)(endOfPulse - startOfPulseAt); return ticks / 580; }
adsf
In Topic: Troubles with sonar sensors
15 May 2013 - 01:14 AM
I modified the code from here,
http://forums.netdui...asures-jumping/
and the files are here for Netduino Plus 2 (in VB),
https://www.dropbox....0a7Geue?v=0mwng
The cheap HC-SR04 modules are spotty at best. I wasted a lot of time with a bad one. The above code works just fine. I merely added some smoothing routines. The module is powered from the Netduino 5V pin.
Thank you, I will try to use and see how it works.
Are there any limitations on the pins which I can use?
In Topic: Interrupts on TristatePort
11 February 2013 - 07:26 AM
Guys, I ran into a same issue.
I might try to burn tow ports at this point. Could you please share the code for this?
Thanks,
Ruben
In Topic: Servo power wiring to Netduino Plus 2
11 February 2013 - 06:54 AM
I prefer to use separate supplies for logic and motors.
My Netduino became erratic when it shared the same battery pack as my buggy's motors.
Paul
Yeah, i felt that too..
- Netduino Forums
- → Viewing Profile: Posts: rubenhak
- Privacy Policy