Motors only rotate sometimes when accessed in C#-Timer
2 posters
MindSqualls :: Questions :: Using the motors :: NXT motors
Page 1 of 1
Motors only rotate sometimes when accessed in C#-Timer
Hi,
MindSqalls is exactly what I've been looking for since some time now and I already programmed a simple remote for my NXT (using Motor.Run(x, 0)), which works great.
Now I've started writing an application to control a time lapse rig for my digital camera. I wrote it so that each motor can rotate independently some degrees every interval. Unfortunately, most of the intervals seem to be skipped and I only hear one short beep from the motors.
I followed the quick start quide, but maybe I missed something?
Basically, what I did, is this:
MindSqalls is exactly what I've been looking for since some time now and I already programmed a simple remote for my NXT (using Motor.Run(x, 0)), which works great.
Now I've started writing an application to control a time lapse rig for my digital camera. I wrote it so that each motor can rotate independently some degrees every interval. Unfortunately, most of the intervals seem to be skipped and I only hear one short beep from the motors.
I followed the quick start quide, but maybe I missed something?
Basically, what I did, is this:
- Code:
NxtBrick brick;
private void Start()
{
brick = new NxtBrick(NxtCommLinkType.USB, 0);
brick.MotorA = new NxtMotor();
brick.MotorB = new NxtMotor();
brick.MotorC = new NxtMotor();
brick.Connect();
//start timers
}
private void TimerATick()
{
brick.MotorA.Run(power, /*some value > 0*/);
}
lumpiluk- Posts : 1
Join date : 2011-09-04
Re: Motors only rotate sometimes when accessed in C#-Timer
I suspect that you are attempting to send the commands to the NXT far too quickly for it process them.
If a command is sent before the previous has run to the end, the new command interrupts the previous. The commands are not queued in the NXT.
If a command is sent before the previous has run to the end, the new command interrupts the previous. The commands are not queued in the NXT.
Niels- Posts : 19
Join date : 2011-07-15
MindSqualls :: Questions :: Using the motors :: NXT motors
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|