To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 27426
27425  |  27427
Subject: 
Re: NXC: turning on the light
Newsgroups: 
lugnet.robotics
Date: 
Tue, 15 Apr 2008 06:59:52 GMT
Viewed: 
6443 times
  
My guess is you can turn it on using one of the powered sensor types such
as
SENSOR_TYPE_LIGHT_ACTIVE or SENSOR_TYPE_LOWSPEED_9V.  I don't have a lamp
to
test this with or any of the cables that are required to connect a lamp to
a
sensor port.  The retail set doesn't include any of these cables or the
lamp
itself.

Let me know if this works or not.

John Hansen


The lamp is relatively power hungry, so you should connect it to a motor port
for best result. OnFwd ("ports", "pwr"); will light it, with brightness
controlled by the pwr parameter. Off ("ports"); will turn it off.

I have not tested, but most probably the lamp can dimly glow on a sensor port.
Use SetSensorType ("port", IN_TYPE_LIGHT_ACTIVE); to turn it on and
SetSensorType ("port", IN_TYPE_SWITCH); to turn it off.

Philo



Message is in Reply To:
  Re: NXC: turning on the light
 
Thanks a bunch for the reply! The education set has the lamp, so my students would like to use it now... I'll keep you 'posted' about the results... Regards, Torsten Otto (...) (16 years ago, 15-Apr-08, to lugnet.robotics)

9 Messages 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