To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.javaOpen lugnet.robotics.rcx.java in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / Java / 107
106  |  108
Subject: 
Re: rotation sensor question
Newsgroups: 
lugnet.robotics.rcx.java
Date: 
Tue, 4 Sep 2001 17:22:49 GMT
Viewed: 
2533 times
  
Hi there,

I installed leJOS, got it up and running, then read on the sourceforge site
a support question about the rotation sensor, so I decided to test it out.
I wrote a first cut at it and it didn't work, just like the support question
suggested:

import josx.platform.rcx.*;
public class Bot
implements SensorConstants
{
  public static void main (String[] arg)
  throws Exception
  {
    Sensor.S2.setTypeAndMode (SENSOR_TYPE_ROT, SENSOR_MODE_ANGLE);
    Sensor.S2.activate();

    for(;;) {
      LCD.showNumber(Sensor.S2.readValue());
    }
  }
}
And it worked just fine.  Good.  But why did the first attempt fail?

What happened? nothing appeared in the LCD?
This looks 99% like the example I did yesterday - except
that I put in a "LCD.refresh()" after the #showNumber call.
I run 1.0.2 RC4 under Linux...

// Martin



Message has 1 Reply:
  Re: rotation sensor question
 
Hej Martin, (...) probably nobody will ever know. A lot has changed in the last month. (...) That's not necessary, it is already done in showNumber (but not in setNumber). (...) So it's working for you, I hope? Jürgen (23 years ago, 4-Sep-01, to lugnet.robotics.rcx.java)

Message is in Reply To:
  rotation sensor question
 
I installed leJOS, got it up and running, then read on the sourceforge site a support question about the rotation sensor, so I decided to test it out. I wrote a first cut at it and it didn't work, just like the support question suggested: import (...) (23 years ago, 20-Jul-01, to lugnet.robotics.rcx.java)

5 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