To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.nxtOpen lugnet.robotics.nxt in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / NXT / 990
989  |  991
Subject: 
Re: Nxc and Mindsensors stuff
Newsgroups: 
lugnet.robotics.nxt
Date: 
Tue, 27 Nov 2007 05:08:54 GMT
Viewed: 
29587 times
  
In lugnet.robotics.nxt, Gian Piero Puccioni wrote:
Actually, I have them. But it didn't help, I tried to use the I2C
functions and the usual  SetSensorType but I cannot get a meaningful
number, maybe I am doing something wrong. Does anyone have an example of
a NXC program that read a Mindsensors DROD (for example)?


I do not have the mindsensors DROD-Nx sensor but I have read the documentation
from their website.  It says that the sensor is an analog sensor which you can
read using the standard NXT-G light sensor block.  That means you need to
configure the sensor port as an active light sensor and then simply read its
value.

I also compiled a simple NXT-G program containing one DROD sensor block and
examined the decompiled .rxe file using BricxCC.  It shows that the
mindsensors.com block uses the NormalizedValue sensor reading.  So in NXC you
can simply do this:

task main() {
  SetSensorType(S1, SENSOR_TYPE_LIGHT_ACTIVE);
  SetSensorMode(S1, SENSOR_MODE_PERCENT);
  ResetSensor(S1);
  while (true) {
    NumOut(0, LCD_LINE1, SensorNormalized(S1), true);
    Wait(100);
  }
}


Hope this helps,

John Hansen



Message has 1 Reply:
  Re: Nxc and Mindsensors stuff
 
(...) Well, I use Linux so I completely skipped the part about NXT-G in the docs and I missed the reference to the light sensor. Anyway, that is sort of what I tried (I changed the original program so many times I am not sure). But probably I missed (...) (17 years ago, 27-Nov-07, to lugnet.robotics.nxt)

Message is in Reply To:
  Re: Nxc and Mindsensors stuff
 
(...) Actually, I have them. But it didn't help, I tried to use the I2C functions and the usual SetSensorType but I cannot get a meaningful number, maybe I am doing something wrong. Does anyone have an example of a NXC program that read a (...) (17 years ago, 19-Nov-07, to lugnet.robotics.nxt)

8 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