Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Solve problem: When crane is initially powered up tracks move robot backwards for a few seconds. When using the left joystick to move the robot

Solve problem:

  1. When crane is initially powered up tracks move robot backwards for a few seconds.
  2. When using the left joystick to move the robot in the left or right the robot does not move.

int in1=8; // motor one

int in3=9; // motor two

pinMode(in1,OUTPUT);

pinMode(in3,OUTPUT);

tempLH=Xbox.getAnalogHat(LeftHatY,0); //track

if(tempLH>deadZone||tempLH<(-deadZone))

{

if(tempLH>deadZone)

{

digitalWrite(in1,HIGH);

delay(25);

digitalWrite(in1,LOW); //LOW is CW

}

else

{

digitalWrite(in1,100);

delay(25);

digitalWrite(in1,LOW); //HIGH is CCW

}

}

tempRH=Xbox.getAnalogHat(LeftHatX,0); //track

if(tempRH>deadZone||tempRH<(-deadZone))

{

if(tempRH>deadZone)

{

digitalWrite(in1,HIGH);

delay(25);

digitalWrite(in1,LOW); //LOW is CW

//tempSpeed=tempRH-5;

}

else

{

digitalWrite(in3,100);

delay(25);

digitalWrite(in3,LOW);

//tempSpeed=abs(tempRH+5);

} //HIGH is CCW

//digitalWrite(in3,HIGH);

//towerSpeed=map(tempSpeed,10000,32763,50,2000);

//delayMicroseconds(10050-towerSpeed); //milli sec delay //Higher Number is slower speed

//digitalWrite(in1,LOW);

}

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data And Information Quality Dimensions, Principles And Techniques

Authors: Carlo Batini, Monica Scannapieco

1st Edition

3319241060, 9783319241067

More Books

Students also viewed these Databases questions

Question

Explain in detail how the Mughal Empire was established in India

Answered: 1 week ago

Question

Problem: Evaluate the integral: I - -[ze dx

Answered: 1 week ago

Question

Problem: Evaluate the integral: I = 1- 1 dx 9

Answered: 1 week ago