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 / 4111
4110  |  4112
Subject: 
help needed for ir sensors & memory addressing latch
Newsgroups: 
lugnet.robotics.handyboard
Date: 
Tue, 7 Jul 1998 00:34:56 GMT
Original-From: 
Lim Jew Hwang <limjh@^stopspammers^pacific.net.sg>
Viewed: 
1224 times
  
Hi all,
    I am new to robotics and have great difficulty trying to get the
near-infra emmiter and
detector on the HB to work properly. After studying the schematics, I
figured out to
activate J7, I should do a bit_set(0x1000,0b01000000) which appears to
be successful,
indicated by the LED lighting up. Since, it already has 40kHz modulation
,all I need to do
is to turn the output on & off at 600us for the detector to pick up the
signal,isn't it?
However when I put a Sharp IS1U60 on digital port 13 and did the
following:

void emit(){
    int on,off,obstacle;
while(1){ {
            bit_set(0x1000,0b01000000);
             sleep(0.0006);
            obstacle=digital(13);
          bit_clear(0x1000,0b01000000);
             sleep(0.0006);
         obstacle=digital(13);

if(off && ~on)
             obstacle=1;
else
             obstacle=0;}
printf("obstacle is %d\n",obstacle);
        }}

void main(){
start_process(emit());}

I couldn't get the HB to indicate the presence of an obstacle.

Next, I decided to get the readings from the detector on the HB instead
as follows:

void main(){
    start_process(emit());}

void emit() {
        int on, off, obstacle;
while (1){
       {    bit_set(0x1000,0b01000000); /*PA6 output*/
             sleep(0.0006);
            on = peek(0x1000);

          bit_clear(0x1000,0b01000000);
             sleep(0.0006);
            off = peek(0x1000); }

    {if(on & 0b00000100 == 0b00000100) /*PA2 input*/
                 on=1;
     else
                 on=0;
    if(off & 0b00000100 == 0b00000100)
                 off=1;
     else
                 off=0;}

    if(off && ~on)
                 obstacle=1;
    else
                 obstacle=0;}
     printf("obstacle is %d\n",obstacle);
        }}

Unfortunately, this doesn't seems to work. Where did I go wrong?

Also, I have another HB which was working fine until one day, it
decided not to boot any more. After the initial and sucessful
downloading is over in the bootstrap mode, the LCD does not have the
words interactive C display on it after the reset although LCD  is on.
The charger LED is also ON all the times even though there are no
rechargeable batteries connected to the HB when I connect the power jack
to J12. After checking the data sheet, I suspect U2,U3 and U7 are
damaged because they got very hot after switching on the HB for a while.
Is there anything else that might be damaged and how should I proceed
from here.

Thanks for the attention.



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