To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.spyboticsOpen lugnet.robotics.spybotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / Spybotics / 34
33  |  35
Subject: 
Spybot speed motor control
Newsgroups: 
lugnet.robotics.spybotics
Date: 
Sat, 3 Aug 2002 12:26:04 GMT
Viewed: 
4722 times
  
I really love spybot speed motor control ! A little NQC test program :

task main()
{
  int x;
  SetLED(LED_MODE_BLINK, 0);
  OnFwd (OUT_A+OUT_B);

  //Progressive acceleration
  for (x=0; x<8; x++)
  {
    SetPower (OUT_A+OUT_B,x);
    SetLED(LED_MODE_ON, x);
    Wait(100);
  }
  //Progressive deceleration
  for (x=7; x>=0; x--)
  {
    SetPower (OUT_A+OUT_B,x);
    SetLED(LED_MODE_ON, x);
    Wait(50);
  }
  //shallow turn right
  SetLED(LED_MODE_ON, 0x18);
  SetPower (OUT_A,3);
  SetPower (OUT_B,5);
  Wait(300);

  //shallow turn left
  SetLED(LED_MODE_ON, 0x3);
  SetPower (OUT_A,5);
  SetPower (OUT_B,3);
  Wait(300);

  //Stop all
  SetLED(LED_MODE_ON, 0);
  Off (OUT_A+OUT_B);
}

Philo
www.philohome.com



1 Message in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR