Having trouble adding a new object to an existing program and run it in a new cog
MikeS
Posts: 131
I am very new at prop programming. I have created a program the will read the Parallax "5 position switch" and display the switch positions on a 2 X 16 Parallax LCD.(5PositionSwitch_LCD.spin) I ultimately want to control a servo with the switch.I found a Servo control object in the OBEX library called"Single Servo Spin". I have tried to incorporated it into my existing program but am not having luck. The program will compile and load into RAM but the LCD never initializes and no response from the switch or the servo.
If someone could look at my programs and give me a hint it would be greatly appreciated.Starting the Single Servo Spin in a new cog has got me confused and I suspect that is where the problem lies.
thanks
MikeS
If someone could look at my programs and give me a hint it would be greatly appreciated.Starting the Single Servo Spin in a new cog has got me confused and I suspect that is where the problem lies.
thanks
MikeS
Comments
So I'd suggest increasing the stack (e.g. stack[32], you can always make it smaller later). And before you start the motor cog, give position a meaningful value.
Thank you for you suggestions. I will increase the stack and initialize the position to a value within the range given in the single servo spin program.
Thanks,
Mike
I "think" I may have found the problem. I noticed that if I did not plug the servo motor into the board that the LCD would go ahead and initialize. I increased the size of the power supply from 9.0v - 300ma to 9.0v - 500ma and the program appears to run now. There seems to still be a timing issue between the LCD displaying the switch position (doesn't always display) and the movement of the servo, but the servo is now moving in concert with the switch..
I appreciate your reply and help, it encouraged me to pursue a solution to the problem
.
Thanks,
MikeS