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 / 7611
7610  |  7612
Subject: 
Re: Non-polaroid Sonar
Newsgroups: 
lugnet.robotics.handyboard
Date: 
Thu, 16 Mar 2000 18:30:41 GMT
Original-From: 
Will Bain <willb@selway.#NoSpam#umt.edu>
Viewed: 
1616 times
  
Adam Oliver wrote:
Just so I'm clear, ref pink book page 10-17.
Does the "bit_set( 0x1021, 1 );" refer to bit 0 -EDG3B, and
bit_clear( 0x1021, 2 ); " refer to bit 1 -EDG3A.
This is what was throwing me, I always thought bits started at zero and
ended at 7, not 1 to 8 as appears to be the case here. Is this what the
"zero-indexed " means?

sorry if it's a basic question, but if you don't ask you never learn :-)

No, that's a very good question. It had me confused, too. The second argument to bit_set and bit_clear is not actually the index of a bit at all; it's a bit mask.

For example, when you do bit_set( 0x1021, 3 ), the 3 becomes 0000 0011 in binary, so it will set the last two bits of the address. Hope this helps!

-- Will



Message has 1 Reply:
  Re: Non-polaroid Sonar
 
Hi all, I'm now building the ultrasonic sensor from kam leang's page, did anyone interface it with handyboard?? Can anyone give me some advice on driving it? thanks Frankie Lai 97139371d@polyu.edu.hk (...) to bit_set and bit_clear is not actually (...) (25 years ago, 16-Mar-00, to lugnet.robotics.handyboard)

Message is in Reply To:
  Re: Non-polaroid Sonar
 
Thanks for your help :-D Just so I'm clear, ref pink book page 10-17. Does the "bit_set( 0x1021, 1 );" refer to bit 0 -EDG3B, and bit_clear( 0x1021, 2 ); " refer to bit 1 -EDG3A. This is what was throwing me, I always thought bits started at zero (...) (25 years ago, 16-Mar-00, to lugnet.robotics.handyboard)

7 Messages in This Thread:

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

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

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