Our Lady of Fatima University: Pampanga Campus College of Computer Studies
Our Lady of Fatima University: Pampanga Campus College of Computer Studies
PAMPANGA CAMPUS
COLLEGE OF COMPUTER STUDIES
Submitted By:
De Leon, Timothy Abner A.
Guimaras, Leonard F.
Nakashima, Katsuyoshi S.
Umangay, Joanne F.
Submitted To:
Kenichiru L. Morioka
PURPOSE OF THIS RESEARCH:
Our Group have conducted a research on how helpful the anti-collision sensor is
on our modern-day vehicles and how it prevents vehicular accidents since these
events have become more prevalent nowadays.
To be able to help with our Community, we have Built a Simulation of an Anti-
Collision Sensor on a remote controlled vehicle to see how the sensor works, and
to be able to provide the said device to the people who are in need of this and to
be able to contribute in the I.T community.
2
CODES:
#define trigPin 12
#define echoPin 13
#define buzz 11
#define trigPin1 10
#define echoPin1 9
void setup() {
Serial.begin (9600);
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
pinMode(buzz,OUTPUT);
void loop() {
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin,HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
3
duration = pulseIn(echoPin, HIGH);
distance = (duration/2)/29.1;
delay (1000);
noTone(buzz);
delay (750);
noTone(buzz);
delay (750);
delay (500);
noTone(buzz);
delay (500);
4
tone (buzz, 2000);
delay (250);
noTone(buzz);
delay (250);
delay (50);
noTone(buzz);
delay (50);