LV-168 Motor Driver sample codes

I am using the Orangutan LV-168 to design a solar power based robot that uses capacitors to store the energy. I am having issues programing the LV_168 to just move forward, right, left, and back. All the examples given have a condition attached to them (such as potentiometer voltage). I just want to delay for a while under a light source in order to get charged, then move around a field. Could someone please help with some suggestions on the code?


If you want us to give you suggestions on your code, you need to post your code. Please surround it in when you do.

- Ryan

I am just trying code lines that I find here and there and that I used on the Orangutan X2 in another project. The commands such as this one:
/Motion functions:

void straight()
        setMotor1 (-110);
        setMotor2 (-110);

for instance to setup straight. However this does not work with the LV-168

X2 functions will not work on the LV-168. I assume you are using WinAVR with the Pololu AVR Library - is that correct? Have you successfully used any of the examples? The “motor1” example is a good starting point. You should see that the function set_motors() is used to set the speeds of both motors at the same time, and there is also a function delay_ms() that delays for a specified number of milliseconds. By deleting the stuff that you do not need and rearranging the lines, you should be able to get what you want.


Yes I have downloaded most of the examples into my robot and they work fine. So I could delete the conditions (if pot …) associated with motors1 and just make it work directly?I will try it.

I don’t know about “just”, but you have all of the basic ingredients there to do something like what you want: delays, motor settings, and an infinite loop.


Ok. Now I am not sure what is the problem. I coppied motors1 c code to a new project i called move1. But when I run in I get the following errors:

C:\Documents and Settings\tony\Desktop\libpololu-avr\move1\move1\default/../move1.c:27: undefined reference to `read_trimpot'
C:\Documents and Settings\tony\Desktop\libpololu-avr\move1\move1\default/../move1.c:31: undefined reference to `set_motors'
C:\Documents and Settings\tony\Desktop\libpololu-avr\move1\move1\default/../move1.c:38: undefined reference to `red_led'
C:\Documents and Settings\tony\Desktop\libpololu-avr\move1\move1\default/../move1.c:39: undefined reference to `delay_ms'
C:\Documents and Settings\tony\Desktop\libpololu-avr\move1\move1\default/../move1.c:41: undefined reference to `red_led'
C:\Documents and Settings\tony\Desktop\libpololu-avr\move1\move1\default/../move1.c:42: undefined reference to `delay_ms'
make: *** [move1.elf] Error 1
Build failed with 6 errors and 0 warnings...

It seems that I can run all the examples, and download them only because the hex files are already there. But when I copy the same code in my own project I cannot run it. It appears to be a library or source file issue. Could someone help. Thanks


To use the Pololu AVR library with your own AVR Studio projects, please follow the instructions in section 7 of the library’s user’s guide.

- Ben