Marble sorter Activity 3.1.1

preview_player
Показать описание

Рекомендации по теме
Комментарии
Автор

The‎ treads‎ and‎ their‎ code‎ are‎ done.‎ I‎ have‎ them‎ on‎ a‎ separate‎ code‎ sheet‎ because‎ having‎ one‎ circuit‎ kills‎ the‎ battery‎ very‎ quickly.‎ As‎ for‎ the‎ last‎ part‎ with‎ the‎ “aimcount”‎ variable, ‎ don’t‎ worry‎ about‎ that, ‎ I’m‎ still‎ working‎ on‎ it.‎ I‎ may switch‎ the‎ aiming‎ servo‎ to‎ a‎ motor.‎ And‎ I‎ may‎ need‎ to‎ add‎ a‎ potentiometer‎ to‎ the‎ rotational‎ motor‎ on‎ the‎ shooter‎ mount‎ so‎ it‎ doesn’t‎ exceed‎ a‎ certain‎ point‎ breaking‎ the‎ connecting‎ wire‎ to‎ the‎ cortex.‎ Text‎ me‎ if‎ you‎ have‎ any‎ questions‎ or‎ things‎ you‎ disagree with.‎ Ill‎ be‎ at‎ practice‎ from‎ 6-8‎ so‎ if‎ I‎ don’t‎ answer‎ in‎ that‎ time‎ period, ‎ you‎ know‎ why.

 

#pragma‎ config(Motor, ‎ port2, ‎ angleBase, ‎ tmotorServoStandard, ‎ openLoop)

#pragma‎ config(Motor, ‎ port3, ‎ rotArmMotor, ‎ tmotorVex393_MC29, ‎ openLoop)

#pragma‎ config(Motor, ‎ port4, ‎ magServo, ‎ tmotorServoStandard, ‎ openLoop)

#pragma‎ config(Motor, ‎ port5, ‎ leftShtMotor, ‎ tmotorVex393_MC29, ‎ openLoop)

#pragma‎ config(Motor, ‎ port6, ‎ rightShtMotor, ‎ tmotorVex393_MC29, ‎ openLoop)

task‎ main()

{

//Shooter (turns‎ on‎ motors)

{

int‎ count;

count=0;

if(vexRT[Btn8D]‎ ==‎ 1)

count=‎ count+1;

 

while(count==1)‎  

{

motor[port7]=127;

motor[port8]=127;

}

}‎  

 

//SHOOT (Magazine‎ Servo)

while(1==1)‎  

{

if(vexRT[Btn6D]‎ ==‎ 1)

{

setServo(port6, ‎ -28); //magServo (Values‎ are‎ not‎ yet‎ defined)

wait(.5);

setServo(port6, ‎ -90); //magServo (Values‎ are‎ not‎ yet‎ defined)

wait(.5);

}‎  

}

 

//Turning Shooter

while(1==1)

{

if(vexRT[Btn7L]‎ ==‎ 1)

{

motor[port5]‎ =‎ 1/4;

}

if(vexRT[Btn7R]‎ ==‎ 1)

{

motor[port5]‎ =‎ 1/4;

}

}

 

 

//Aiming Shooter

{

int‎ aimcount;

aimcount=0; //Initialy aimed‎ position‎ for‎ u/d‎ shooter

if(vexRT[Btn7D]‎ ==‎ 1)

aimcount=‎ aimcount-1; //Set value‎ for‎ decrease

if(vexRT[Btn7U]‎ ==1)‎  

aimcount=‎ aimcount+1; //set value‎ for‎ increase

while(aimcount==-1)

{

setServo(port4, ‎ +20);

}

while(aimcount==1)

{

setS
ervo(port4, ‎ -20);

}

}

 

 

}

 

Sent‎ from Mail for‎ Windows‎ 10

bribri
Автор

Can some one help me write my code my teacher is new and is no help

EasyE