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 / 4862
4861  |  4863
Subject: 
motor code questions
Newsgroups: 
lugnet.robotics.handyboard
Date: 
Wed, 2 Dec 1998 14:54:42 GMT
Original-From: 
Shiva Sinha <sinha@wam.{StopSpam}umd.edu>
Viewed: 
2544 times
  
Hi,

I got my Handyboard up and going and was trying the following code for
driving my motors. (Figure I would try known code before forking out on my
own). The code I got from the 'Inspiration to implemntation' book. Anyways
it does not seem to drive the motors (no LEDs lighting), and I was
wondering if any one knows of any problems with the code. I've looked it
over and it seems pretty reasonable.

Thanks in advance,
Shiva Sinha
----------------------------------------------
int write_port (int port, int value, int mask)
{ poke(port,(value & mask) | (peek(port) & ~mask)); }

void motor_cmd(int l_ena, int l_dir, int r_ena, int r_dir)  {
write_port(port_a, (l_ena & m_mask_l) | (r_ena & m_mask_r), m_mask);
   write_port(port_d, (l_dir & m_mask_l) | (r_dir & m_mask_r), m_mask);  }

void move(int operation)  {
      if (operation == STOP)
motor_cmd(off_,0,off_,0);
      else if (operation == FORWARD)
         motor_cmd(on,fwd,on,fwd);
      else if (operation == BACKWARD)
motor_cmd(on,bkw,on,bkw);
      else if (operation == LEFT_TURN)
motor_cmd(on,bkw,on,fwd);
      else if (operation == RIGHT_TURN)
motor_cmd(on,fwd,on,bkw);
}



Message is in Reply To:
  Re: Re: What needs to be done to get both the Floating point fix & the Smooth PWM?
 
Hi I did the port of the smoothpwm stuff into the IC 3.x source code. The Newton Labs ftp site has the smoothpwm files available from: ftp://newtonlabs.com...mooth-pwm/ If someone can get me the code for the FP fix, I'll see if I can get a new pcode (...) (26 years ago, 1-Dec-98, to lugnet.robotics.handyboard)

2 Messages 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