View unanswered posts | View active topics It is currently Thu Jul 31, 2014 12:13 pm






Reply to topic  [ 7 posts ] 
Lamp 
Author Message
Rookie

Joined: Fri Nov 28, 2008 4:54 am
Posts: 2
Post Lamp
Hi everybody! I'd like to know how to switch on and off the lamp of the NXT (I mean the one like this http://www.legoengineering.com/activiti ... %20pic.JPG). Thanks :wink:


Thu Dec 04, 2008 7:39 am
Profile
Rookie

Joined: Sat Apr 12, 2008 11:09 am
Posts: 49
Location: holland
Post Re: Lamp
Hello,

I don't have lamp like this, but the cable looks like a normal motor cable to me.

You could try to connect the lamp to a motor port and run a motor. If it works, you can adjust the light "volume" with the motor speed.

You can also try to connect it to a sensor port and set the sensor to an active light sensor.


Thu Dec 04, 2008 11:34 am
Profile
Moderator
Moderator
User avatar

Joined: Wed Jan 31, 2007 3:39 am
Posts: 299
Location: San Diego, California. USA
Post Re: Lamp
Hi Willem,

The light works just like a motor, so you can plug it into a motor port and program it the exact same way B-)

motor[motorA] = 100; // full on
motor[motorA] = 0; // off

Have Fun B-)

_________________
Mmmm Legos B-)

My Robot Projects:
http://www.freewebs.com/robotprojects/


Thu Dec 04, 2008 1:09 pm
Profile WWW
Rookie

Joined: Fri Nov 28, 2008 4:54 am
Posts: 2
Post Re: Lamp
Thank you


Tue Dec 09, 2008 7:42 am
Profile
Rookie

Joined: Mon Nov 09, 2009 10:51 am
Posts: 23
Post Re: Lamp
I'm finding it's really hard to get the lamp to turn off. If I run something like this it barely blinks off even though it should stay off for four seconds. It mostly stays on. Anybody know why this might be?
Code:
task main()
{
      while(true)
     {
         motor[motorA] = 10; //this is al you need
         wait1Msec(1000);
         motor[motorA] = 0;
         wait1Msec(4000);
     }
}


Fri Dec 02, 2011 5:08 pm
Profile
Expert

Joined: Wed Jun 30, 2010 7:15 am
Posts: 181
Post Re: Lamp
You might need to turn off the PID controller for the motor. You can do that in the "Motors and Sensors Setup" wizard (go to the "Robot" menu). I'm not sure but it's something you need to do when controlling abouth kind of NXT light.

_________________
leonoverweel.com


Fri Dec 02, 2011 5:35 pm
Profile WWW
Rookie

Joined: Mon Nov 09, 2009 10:51 am
Posts: 23
Post Re: Lamp
That made it work! Thanks!


Fri Dec 02, 2011 9:57 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 7 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.