Originally I thought of Muxing the LEDs that represents distance from wall so program is written to use two threads: One for LED display and another for the logic in reading data from sensor. Fairly simple one but useful.
Parking Sensor
Started by ZakieM, Apr 28 2011 03:13 PM
2 replies to this topic
#1
Posted 28 April 2011 - 03:13 PM
Parking Sensor.zip 12.75KB
33 downloadsGetting into my parking space is a bit of a challenge. I always fear of the gate that closes to hit the back of the car... so I decided to build a fixed parking sensor as my car has only back sensors. I used the Netuindo and MaxSonar sensor (http://www.maxbotix....r-EZ1__FAQ.html).
Originally I thought of Muxing the LEDs that represents distance from wall so program is written to use two threads: One for LED display and another for the logic in reading data from sensor. Fairly simple one but useful.
Originally I thought of Muxing the LEDs that represents distance from wall so program is written to use two threads: One for LED display and another for the logic in reading data from sensor. Fairly simple one but useful.
- codingbug likes this
Zakie Mashiah
Just a curious guy
Just a curious guy
#2
Posted 28 April 2011 - 04:03 PM
Add a yellow for the right position you want (hardcoded since no interface) and a red when you go beyond the right position. That would be a perfect solution. (human factor specialist in me had to comment)
Besides that good work and Welcome to the community
Started with C in 1985, moved to Vb3 ... to vb6 and stopped. Now started with .Net and learning C# and VB.net and wishing VB.net was on MF !
#3
Posted 28 April 2011 - 04:52 PM
I did the same thing with on of those PING ultrasonic sensors in my garage, I have 2 bright lights, one blue for when the car trips the sensor and a red that goes solid when within 2 feet of the wall and blinking within 1 foot. Mine was actually done with Arduino before I got hooked on Netduino's so good job doing it all in managed code.
I am impressed with your code, nice use of comments and I like your implementation of Main, it's structured very well. For the most part everything is very readable but I (take it for what it's worth) don't like you’re use of the variable displayLedLevels. If it were me I may have used a enum to define the Ledlevels or a simple int and matched that int to the OutputPort[] Leds with a for loop or something.
It's just constructive criticism to make the code a little more readable and scalable. Overall, good code.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users