To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.legosOpen lugnet.robotics.rcx.legos in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / legOS / 915
914  |  916
Subject: 
Newbie question : IR comms with PC.
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Wed, 8 Mar 2000 09:01:48 GMT
Viewed: 
1511 times
  
Hi all.

I'm a third year engineering student from South Africa who is trying to
complete a soccer playing robot in time for our robot intervarsity the 29th of
March.I only started using the RCX (and legOS) days ago.

I'm trying to transfer some readings from a fast vibrating (looking from side
to side) Light sensor to a computer so I can get an idea of how clearly the
robot will see the ball (ping pong ball).

I wrote the following code which outputs the readings from the sensor to the
screen as well as to the IR port. I'm just trying to output single bytes
without any packaging or protocol.

#include <conio.h>
#include <unistd.h>
#include <lnp-logical.h>
#include <dsensor.h>

int main(int argc, char **argv)

{ int i=0;
  int val=0;
  lnp_logical_init();
  ds_active (&SENSOR_3);
  for (i=0;i<1000;i++)
  {val=LIGHT_3
   lcd_int (val);
   lnp_logical_write (&val,1);
  }
  cputs ("Finis");
  ds_passive (&SENSOR_3);
  sleep (2);
  return 0;
}

I then wrote a little VB prog that just sends a character to the IR-Tower once
every two seconds to keep it active and reads characters coming into the port.

However it doesn't seem to be getting anything (except reflections of the char
it sent and a bit of random noise about every 5 seconds or so). I've set it up
for 2400,8,N,1.

If my code contains errors (whether relevant to this question or not) Please
tell me about it. My C knowledge isn't too bad but mostly theoretical. I
program JAVA mostly so all these pointers are quite confusing for me allthough
I know the theory.

Thanks in advance

Hannes



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