Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Programming IR sensor (http://www.chiefdelphi.com/forums/showthread.php?t=61642)

d25inferno 14-01-2008 12:37

Programming IR sensor
 
how do you program the IR sensor to alter the way the robot moves in EasyC?
I dont see an IR sensor block! Can you make blocks?

Also one other question: Is it possible to convert the 2007 default code into blocks?

Thanks in advance.

SamC 14-01-2008 14:28

Re: Programming IR sensor
 
I got this from someone else, but this is how you would use the IR board to tell the robot to do something.

Code:

if (GetDigitalInput(1)){
doWhatever();
}
else if (GetDigitalInput(2)){
doSomethingElse();
}

change the number in GetDigitalInput to whatever to fit your needs. Good Luck!

Kingofl337 14-01-2008 15:22

Re: Programming IR sensor
 
Correct you use the digital input block.

The idea behind easyC is you don't need default code you can make your own default code with like 3 blocks.
I would recommend going through the "Getting Started" section of the help file buy the time you finish you should
be an easyC Jedi ! :)

Do you have a VEX robot you can practice on?

Chris_Elston 16-01-2008 13:05

Re: Programming IR sensor
 
1 Attachment(s)
We threw our IR board on our VEX and wrote a really, really dirty fast program.

Look at this for a sample.

elvin23 17-01-2008 19:37

Re: Programming IR sensor
 
i love IR sensers i made a simple program take a look i dont have pics but ill write one
BEGIN
autonomous
Variables
PrintToScreen("BEGIN\n");
SetPMW(1,0);
SetPMW(2,0);
PrintToScreen("END\n");
END
:] :ahh: :yikes: :rolleyes:


All times are GMT -5. The time now is 23:21.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi