Hi
I am trying to run an existing sample motor program in 3pi and part of it working . The green light is on and LCD is displaying both , but it does not move. Can you please help me if I need to do anything else to make it move. Here is the code.
#include <pololu/orangutan.h>
/* * motors1: for the Orangutan LV-168, Orangutan SV-xx8, Orangutan SVP, * and Baby Orangutan B * * This example uses the OrangutanMotors functions to drive * motors in response to the position of user trimmer potentiometer * and blinks the red user LED at a rate determined by the trimmer * potentiometer position. It uses the OrangutanAnalog library to measure * the trimpot position, and it uses the OrangutanLEDs library to provide * limited feedback with the red user LED. * * http://www.pololu.com/docs/0J20 * http://www.pololu.com * http://forum.pololu.com */
unsigned long prevMillis = 0;
int main()
{
while(1)
{
// note that the following line could also be accomplished with:
// int pot = analogRead(7);
int pot = read_trimpot(); // determine the trimpot position
lcd_goto_xy(0, 0);
print("pot=");
print_long(pot); // print the trim pot position (0 - 1023)
print(" "); // overwrite any left over digits
int motorSpeed = (512 - pot) / 2;
lcd_goto_xy(0, 1);
print("spd=");
print_long(motorSpeed); // print the resulting motor speed (-255 - 255)
print(" ");
set_motors(motorSpeed, motorSpeed); // set speeds of motors 1 and 2 // all LEDs off
red_led(0);
green_led(0); // turn green LED on when motors are spinning forward
if (motorSpeed > 0)
green_led(1); // turn red LED on when motors are spinning in reverse
if (motorSpeed < 0)
red_led(1);
delay_ms(100);
}
}
Thank you