Shadi, The trouble is that I'm not getting any interrupt on a echo port.
- Netduino Forums
- → rubenhak's Content
rubenhak's Content
There have been 10 items by rubenhak (Search limited from 27-April 23)
#49476 Troubles with sonar sensors
Posted by rubenhak on 16 May 2013 - 12:26 AM in Netduino Plus 2 (and Netduino Plus 1)
#49470 Troubles with sonar sensors
Posted by rubenhak on 15 May 2013 - 07:36 PM in Netduino Plus 2 (and Netduino Plus 1)
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
#49452 Troubles with sonar sensors
Posted by rubenhak on 15 May 2013 - 01:14 AM in Netduino Plus 2 (and Netduino Plus 1)
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?
#49447 Troubles with sonar sensors
Posted by rubenhak on 14 May 2013 - 10:56 PM in Netduino Plus 2 (and Netduino Plus 1)
Hi Everybody,
I'm having troubles with making the sonar sensors work. I used both Parallax Ping and HC-SR04, but neither of those worked well.
The problem with HC-SR04 is that I'm always getting -1 as result. The code is from this library: http://forums.netdui...ic-rangefinder/
Tried connecting to different digital pins but it didnt work either. Powering from 5V pin of the netduino. Is there anything I'm missing?
The Parallax Ping works "sometimes". If it works i get correct distance result. The trouble with this one is that sometimes it gets stuck in following loop:
while (lineState)lineState = _port.Read();
Using this code:
http://forums.netdui...rasonic-sensor/
Are those sensors sensitive to the power source? Running from USB.
Any help is highly appreciated.
Thansk,
Ruben
P.S. I use Netduino Plus 2 with latest firmware 4.2.2.
#45291 Interrupts on TristatePort
Posted by rubenhak on 11 February 2013 - 07:26 AM in General Discussion
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
#45290 Servo power wiring to Netduino Plus 2
Posted by rubenhak on 11 February 2013 - 06:54 AM in General Discussion
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..
#45238 Parallax Ping))) Ultrasonic Sensor
Posted by rubenhak on 10 February 2013 - 10:20 AM in Project Showcase
#45212 Components Library
Posted by rubenhak on 09 February 2013 - 06:30 PM in General Discussion
#45209 Servo power wiring to Netduino Plus 2
Posted by rubenhak on 09 February 2013 - 06:07 PM in General Discussion
#45035 Servo power wiring to Netduino Plus 2
Posted by rubenhak on 06 February 2013 - 09:53 PM in General Discussion
Hi Everybody,
I'm new to netduino. I've seen this topic discussed in the forum but couldn't find a good answer. So decided to ask.
I want to control a regular servo used in rc toys. This would be analog or digital servo with 4.8V - 6V power range.
As i understood the netduino will provide 3.3V. I'm thinking about providing the power from an external source.
Can somebody help me how to do that? Would i need to connect the + wire to my external power source, then the - from the external to the ground of netduino, and the signal of the servo to one of the PWM pins? I'm bit worried about the ground. wouldn't this fry the board? If somebody can show me photos or schematics of the wiring I would really appreciate!
Thanks,
Ruben
- Netduino Forums
- → rubenhak's Content
- Privacy Policy