Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
For questions about the HC-SR04 ultrasonic ranging sensor.
0
votes
It is required to turn on the LED if the distance to the object is less than or equal to 200...
You have trigPin as pin 10, however your wiring diagram shows it connected to pin 9, so that won't work.
pulseIn returns an unsigned long (microseconds) - see pulseIn. You are collecting the results …
3
votes
Convert from 3 V to 5 V
You may want to use a boost converter which is a device that can step up voltage.
You can get them from eBay for around $US 2.
As Chris Stratton pointed out in a comment, the boost converter may r …
2
votes
Accepted
How come my code does not wait for a specific time before going into an if statement?
I added some more debugging, and I think I have your issues detected.
Amended code:
#include <Servo.h>
#define trig 22
#define echo 24
long duration;
boolean turned130 = false;
int cm50, cm, cm130;
…