To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.handyboardOpen lugnet.robotics.handyboard in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / Handy Board / 5194
5193  |  5195
Subject: 
PVM output
Newsgroups: 
lugnet.robotics.handyboard
Date: 
Thu, 21 Jan 1999 01:50:50 GMT
Original-From: 
Keith - Lui <LUIKEITH@EGR.nospamMSU.EDU>
Viewed: 
1223 times
  
Dear all,

I looked at the lib_hb file and found the portion for motor outputs.

void motor(int m, int speed)
{
  if (speed>100) speed=100;
  if (speed<-100) speed=-100;
  if (speed >= 0)
    _set_motor(m, 0, (255*speed)/100);
  else
    _set_motor(m, 1, (-255*speed)/100);
}


void _set_motor(int motor, int dir, int speed)
{
    bit_set(0x0e, 1 << (4 + motor));    /* turn motor on */
    if (dir)
    bit_set(0x0e, 1 << motor);  /* set direction for backward */
    else
    bit_clear(0x0e, 1 << motor);    /* set dir for forward */
    _motor_speed[motor]= speed;
    _set_motor_speeds();
}

void _set_motor_speeds()
{
    int speed01= (_motor_speed[0] << 8)
      + _motor_speed[1];
    int speed23= (_motor_speed[2] << 8)
      + _motor_speed[3];

    pokeword(0x22, speed01);
    pokeword(0x24, speed23);
}

Did anyone tried modified it from PVM to constant DC outputs?

Advice please.

Keith



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