Vladimirtrif / Team-949z_Pelmen_Vex_21-22

0 stars 0 forks source link

Does this code work? #12

Open TarasAbakumov opened 2 years ago

TarasAbakumov commented 2 years ago

@vladsud

I wrote these lines of code, and I'm wondering if this would work.

pros::Motor conveyor_motor(PneumaticPort); int ConveyorDirection = 0; bool ConveyorOn = false; int ConveyorSpeed = 9999

if (master.get_digital(DIGITAL_A)) { digitalWrite(PneumaticPort, HIGH); ConveyorDirection = 1 ConveyorOn = true; }

if (master.get_digital(DIGITAL_B)) { digitalWrite(PneumaticPort, HIGH); ConveyorDirection = -1 ConveyorOn = true; }

if (master.get_digital(DIGITAL_X)) { digitalWrite(PneumaticPort, LOW); ConveyorDirection = 0; ConveyorOn = false; }

conveyor_motor.move(ConveyorSpeed * ConveyorDirection);

vladsud commented 2 years ago

@TarasAbakumov, let's chat (in person) on how to get you setup to compile it on your own and raise PRs - it's hard to share code that way.

Some observations:

So, with that, I made some changes to your code to get it compiling. Did not test or validated it. See https://github.com/Vladimirtrif/Team-949z_Pelmen_Vex_21-22/pull/13

TarasAbakumov commented 2 years ago

@vladsud

Just to let you know, I will most likely not be here this Wednesday, as well as the next 6 Wednesdays (until 02/09/2022). I will however be there on Fridays.