0% found this document useful (0 votes)
25 views2 pages

#Pragma #Pragma #Pragma #Pragma #Pragma #Pragma #Pragma #Pragma #Pragma #Pragma #Pragma #Pragma

This document contains configuration settings for sensors and motors used on a robot. It defines seven sensors - a line follower sensor, potentiometer, light sensor, two touch sensors, quad encoder, and sonar sensor. It also defines four motors - a flashlight, right motor, left motor, and servo. The code controls the left and right motors to run for 2 seconds if the bump or limit sensors are activated while in a continuous loop.

Uploaded by

ronald
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
0% found this document useful (0 votes)
25 views2 pages

#Pragma #Pragma #Pragma #Pragma #Pragma #Pragma #Pragma #Pragma #Pragma #Pragma #Pragma #Pragma

This document contains configuration settings for sensors and motors used on a robot. It defines seven sensors - a line follower sensor, potentiometer, light sensor, two touch sensors, quad encoder, and sonar sensor. It also defines four motors - a flashlight, right motor, left motor, and servo. The code controls the left and right motors to run for 2 seconds if the bump or limit sensors are activated while in a continuous loop.

Uploaded by

ronald
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
You are on page 1/ 2

File: C:\Users\597406\Documents\try2.

c
#pragma config(Sensor, in1, linefollower, sensorLineFollower)
#pragma config(Sensor, in2, pot, sensorPotentiometer)
#pragma config(Sensor, in3, light, sensorReflection)
#pragma config(Sensor, dgtl1, limit, sensorTouch)
#pragma config(Sensor, dgtl2, bump, sensorTouch)
#pragma config(Sensor, dgtl3, op, sensorQuadEncoder)
#pragma config(Sensor, dgtl5, ultra, sensorSONAR_inch)
#pragma config(Sensor, dgtl12, greenled, sensorLEDtoVCC)
#pragma config(Motor, port10, flash, tmotorVexFlashlight, ope
#pragma config(Motor, port2, rightmotor, tmotorVex393_MC29, openLo
#pragma config(Motor, port3, leftmotor, tmotorVex393_MC29, openLo
#pragma config(Motor, port9, servo, tmotorServoStandard, open
//*!!Code automatically generated by 'ROBOTC' configuration wizard

/*
Project Title:A3_1_2_Part1
Team Members:Ronald Khong, Darren Lin, Victoria Chen
Date: 2/4/2019
Section:

Task Description:

*/
task main()
{
while(1 ==1)
{
if(SensorValue(bump)==1)//if bumpon
{
startMotor(leftmotor, 127); //motor starts at full
wait(2); //goes for 2 sec
stopMotor(leftmotor); //left motor off
}
if(SensorValue(limit)==1) //if limit on
{
startMotor(rightmotor, 127); //right motor starts un fill
wait(2); //waits 2
stopMotor(rightmotor); //STOPS RIGH MOTOR
}
}
}

Page 1 of 1

You might also like