I have not posted for a while good 2-3 years now as feel of ladder broke back,ribssss,concussion,blood clot spinal cord long time recovering but up and about now.Night mare few years
Trying to get back robot building again,
having problems with Arduino Uno an my ultra sonic sensor HC-SRO4
The program i used before does not seem to run them any more.
I have updated my libary with Newping...
real stupid question .. Can the Arduino or ultrasonic become faulty it left in box un used for a few years as before i broke my back they worked fine with the sketch below ?????????
when conected up to progrm before would give out distance reading very well.
I am using windows 8 would this cause me problems?
i have tested the arduino uno i think !!!! to see if was reciving signal to each pin by connecting simple LED, to each pin in turn and getting it to flash which it done no problems( pins A0-A5 and 0-13)
sensors conected to arduino uno
vcc - 5v
trigger - pin 8
echo - pin 7
gnd - ground
sorry if this is very basic but having to start from scratch with what i know and remeber
cheers
#include <NewPing.h>
#define TRIGGER_PIN 8
#define ECHO_PIN 7
#define MAX_DISTANCE 200
NewPing DistanceSensor(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE);
void setup()
{
Serial.begin(9600);
}
void loop()
{
unsigned int cm = DistanceSensor.ping_cm();
Serial.print("Distance: ");
Serial.print(cm);
Serial.println("cm");
delay(1000);
}