Hey
Can you please help me, i have got this code ( at the bottom, also see attached for coding screen ) and i want to use this code but without the buzzer and just the LED but on the Arduino coding Software it says " ‘Ping’ does not have a type." PLEASE HELP?
Code:
[code]
#include <Ping.h> // Import Ping Library
const int sensor = 8; // Pin Sensor to be connected on pin 4
const int buzer = 9; // Buzzer connected on pin 6
const int led = 10; // LED connected to pin 8
int distance; // Save the Distance Detected by the sensor
int pause; // Save Waiting Time Between Flashing
Ping ping = Ping(sensor); // Create the Odject Ping
void setup(){
pinMode(buzer, OUTPUT); // Declare The Buzzer as an OutPut
pinMode(led, OUTPUT); // Declare the LED as An OutPut
}
void loop(){
ping.fire(); // Starts the Sensor
distance = ping.centimeters(); // Return the Distance In Centimetters
if(distance < 100) { // If The Objec is Less than 100 Cm
pause = distance * 10; // Calculate the Distance
digitalWrite (buzer, HIGH);// Turn ON Buzzer
digitalWrite (led, HIGH); // Turn ON LED
delay (pause); // Wait Time To Stop
}
digitalWrite(buzer, LOW); // Turn Off Buzzer
digitalWrite(led, LOW); // Turn Off LED
delay (pause); // wait Time To Stop
}[/code]