|
Page 1 of 1
|
[ 3 posts ] |
|
Ir beacon to light sensor
Author |
Message |
Casey890
Rookie
Joined: Mon Feb 27, 2012 5:26 pm Posts: 20
|
 Ir beacon to light sensor
The goal is to use a standard Ir seeker code to then as soon as the light sensor reads the white tape. There will be two one in front and back to straighten out the robot and then use of a lego servo motor to act as a touch sensor any ideas or suggestions? Just the ir part of the code is here.
 |
 |
 |
 |
Attachments:
File comment: #pragma config(Hubs, S1, HTMotor, HTMotor, none, none) #pragma config(Sensor, S1, , sensorI2CMuxController) #pragma config(Sensor, S2, Irseeker, sensorHiTechnicIRSeeker1200) #pragma config(Sensor, S3, light, sensorNone) #pragma config(Sensor, S4, sonar, sensorNone) #pragma config(Motor, mtr_S1_C1_1, right1, tmotorTetrix, openLoop, reversed) #pragma config(Motor, mtr_S1_C1_2, right2, tmotorTetrix, openLoop, reversed) #pragma config(Motor, mtr_S1_C2_1, left1, tmotorTetrix, openLoop) #pragma config(Motor, mtr_S1_C2_2, left2, tmotorTetrix, openLoop) //*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
#include "JoystickDriver.c"
task main() { while (1 == 1) { if(SensorValue[Irseeker] == 5) { motor[left1] = 15; motor[left2] = 15; motor[right1] = 15; motor[right2] = 15;
}
if(SensorValue[Irseeker] > 5) { motor[left1] = -15; motor[left2] = -15; motor[right1]= 15; motor[right2]= 15; } if(SensorValue[Irseeker] < 5) { motor[left1] = 15; motor[left2] = 15; motor[right1] = -15; motor[right2] = -15; } }}
Ir seeker .c [896 Bytes]
Downloaded 473 times
|
 |
 |
 |
 |
|
Wed Nov 21, 2012 11:25 am |
|
 |
MHTS
Guru
Joined: Sun Nov 15, 2009 5:46 am Posts: 1523
|
 Re: Ir beacon to light sensor
Don't really understand your scenario nor your question. You need to give us more details on what you want to achieve and what are the current problems.
|
Wed Nov 21, 2012 3:31 pm |
|
 |
Casey890
Rookie
Joined: Mon Feb 27, 2012 5:26 pm Posts: 20
|
 Re: Ir beacon to light sensor
Actually used the ir seeker as a program chooser instead but thanks though anyways.
|
Thu Nov 22, 2012 9:55 pm |
|
|
|
Page 1 of 1
|
[ 3 posts ] |
|
Who is online |
Users browsing this forum: No registered users and 2 guests |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|
|