*/
unsigned long pulse_width;
void setup()
{
pinMode( 2, OUTPUT ); // Set pin 2 as trigger pin
digitalWrite( 2, LOW ); // Set trigger LOW for continuous read
pinMode( 3, INPUT ); // Set pin 3 as monitor pin
pinMode( 9, OUTPUT ); // Vibe motor output
pinMode( 5, OUTPUT ); // Using this pin as the buzzer ground
digitalWrite( 5, LOW ); // Using this pin as the buzzer ground
}
void loop()
{
pulse_width = pulseIn ( 3, HIGH ); // Count how long the pulse is high in microseconds
if ( pulse_width != 0 ) {
pulse_width = pulse_width / 10; // 10usec = 1 cm of distance for LIDAR-Lite
if ( pulse_width < 80 ) { digitalWrite( 9, HIGH ); // Signal the user w/ vibe motor
} else { digitalWrite( 9, LOW ); }
tone( 8, map( pulse_width, 0, 500, 1000, 0 ), 10 ); // Generate Proximity Tone
}
delay(20);
}
if ( pulse_width < 80 ) { digitalWrite( 9, HIGH ); // Signal the user w/ vibe motor
--
You received this message because you are subscribed to the Google Groups "HomeBrew Robotics Club" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hbrobotics+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hbrobotics/2788FA2B-7186-4654-9D54-9CE97807CAA2%40gmail.com.
On Sep 4, 2021, at 5:34 PM, Chris Albertson <alberts...@gmail.com> wrote:
To view this discussion on the web visit https://groups.google.com/d/msgid/hbrobotics/CABbxVHu7J5fSh9cHcYGPN_sKaEvai7JyXumRTd%2BAVHXEDaEdgw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hbrobotics/899AB44A-315C-44E6-9433-C6452DDBCC66%40comcast.net.
On Sep 4, 2021, at 8:45 PM, Chris Albertson <alberts...@gmail.com> wrote:
To view this discussion on the web visit https://groups.google.com/d/msgid/hbrobotics/CABbxVHs6EbKg-q_CBytXNTp_Kh%3DVqskW_a5dxEPCuHs-k8VLHw%40mail.gmail.com.
There is a pizeo speaker and a vibrator motor. The speaker appears to work around 10 feet. Not sure what code controls that.Has any one developed an obstacle course for robots?
To view this discussion on the web visit https://groups.google.com/d/msgid/hbrobotics/CA7353BC-7D56-4C10-ADD8-04A40C6F2661%40gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to hbrobotics+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hbrobotics/b6e7e659-cab8-21bd-a482-7344aef7be99%40gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hbrobotics/CABbxVHugHbCGi48Af7sT%3DmJvOCvuF4c4Qw3sQXUVG6Dbf1WJ3Q%40mail.gmail.com.
Here are some specs:
To view this discussion on the web visit https://groups.google.com/d/msgid/hbrobotics/CA%2BKVXVNh3HAbnHX%2B%3DC%2BQL5LKx-bXnsO2kBTTwR7Lp-TL9wAfbQ%40mail.gmail.com.
On Sep 6, 2021, at 8:39 AM, Sergei Grichine <vital...@gmail.com> wrote:
To view this discussion on the web visit https://groups.google.com/d/msgid/hbrobotics/CA%2BKVXVPXoBEbkmc3N41gdizRhq30a8pr%2B%3D%3DTbLGteuAw8uUJSg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hbrobotics/9FB90D50-DFD6-415C-82C8-430719297BE5%40gmail.com.
On Sep 6, 2021, at 12:56 PM, Chris Albertson <alberts...@gmail.com> wrote:
To view this discussion on the web visit https://groups.google.com/d/msgid/hbrobotics/CABbxVHsK7WgNDQBs8zvOHaLBKjz8pQBpz9tA3WpoNeS%2BOZWN4A%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hbrobotics/0EC6AC70-F886-4946-996F-7FF8D0254227%40gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hbrobotics/CABbxVHsK7WgNDQBs8zvOHaLBKjz8pQBpz9tA3WpoNeS%2BOZWN4A%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hbrobotics/45a2be87-afd9-5647-8446-b12a9493862b%40gmail.com.