Hi, I tried running a simple test on the motors with a brief program, but for some reason the servos do not respond.
Here is the program: |  |  |
 | Code: #pragma config(Hubs, S1, HTMotor, HTServo, none, none) #pragma config(Motor, mtr_S1_C1_1, motorD, tmotorNormal, PIDControl) #pragma config(Motor, mtr_S1_C1_2, motorE, tmotorNormal, PIDControl) //*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
#include "JoystickDriver.c"
task main() { while (true) { getJoystickSettings(joystick); motor[motorD] = joystick.joy1_y1; motor[motorE] = joystick.joy1_y2; if (joy1Btn(1)) { servoTarget[servo1] = 50; } } }
|  |
 |  |  |
My wiring is as exactly shown on the TestBed below, however the 'Sonar' and 'NXT Motor' were not connected:
When I used the analogs on the controller, the two DC Motors functioned perfectly. However, when I pressed button # 1, the servo did not respond.
Any suggestions? Any help would be very appreciated.
-----------------------
Do the 'pragma configurations' definitions have anything to do with it?
For example, the two motors are mentioned in the following codes:
Should I have a 'pragma config' code for the servos as well?
Thanks,
Marco