Torrent robotc for lego mindstorm9/3/2023 While (SensorValue(bumpSwitch) = 0 & SensorValue(bumpSwitch2) = 0). #pragma config(Motor, port10, rightMotor, tmotorVex269, openLoop) #pragma config(Motor, port1, leftMotor, tmotorVex269, openLoop) #pragma config(Sensor, dgtl11, ledRed, sensorLEDtoVCC) #pragma config(Sensor, dgtl10, ledGreen, sensorLEDtoVCC) #pragma config(Sensor, dgtl4, bumpSwitch2, sensorTouch) #pragma config(Sensor, dgtl3, bumpSwitch, sensorTouch) My Code is posted below: #pragma config(Sensor, in2, lightSensor, sensorReflection) While the bump switch code block is running, I need the LEDs to light up and go off seven times for one second every time the Light sensor value gets higher than 400. The problem I'm having is getting the LEDs to light up correctly. I need to get my robot to be able to use the bump switches so that either one can be pressed and the motor corresponding to that bumpswitch will run for as long as the bump switch is pressed.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |