LEGO Mindstorms NXT - PowerPoint PPT Presentation

About This Presentation
Title:

LEGO Mindstorms NXT

Description:

LEGO Mindstorms NXT SOURCES: Carnegie Mellon Dacta Lego Timothy Friez Miha tajdohar miha.stajdohar_at_fri.uni-lj.si Sensors Sensors and Motors Four sensor ports Sonar ... – PowerPoint PPT presentation

Number of Views:263
Avg rating:3.0/5.0
Slides: 16
Provided by: Robotics88
Learn more at: http://web.cecs.pdx.edu
Category:

less

Transcript and Presenter's Notes

Title: LEGO Mindstorms NXT


1
LEGO Mindstorms NXT
SOURCES
Carnegie Mellon Dacta Lego Timothy Friez Miha
Štajdoharmiha.stajdohar_at_fri.uni-lj.si
2
Sensors
3
Sensors and Motors
  • Four sensor ports
  • Sonar
  • Sound
  • Light
  • Touch
  • Three motor ports
  • Each motor includes rotation counter

4
Touch Sensors
  • Education kit includes two sensors
  • Much more robust than old RCX touch sensors

5
Light Sensor
  • Reports light intensity as percentage
  • Two modes
  • Active
  • Passive
  • Practical uses
  • Identify intensity on paper
  • Identify lit objects in dark room
  • Detect shadows

6
Sound Sensor
  • Analogous to light sensor
  • Reports intensity
  • Reputed to identify tones
  • We have little experimented with this
  • Practical uses
  • Clap to signal robot

7
Ultrasonic (Sonar) Sensor
  • Reports distances
  • Range about 5 cm to 250 cm
  • In practice
  • Longer distances result in more missed pings
  • Mostly reliable
  • Occasionally gets stuck
  • Moving to a new location helps in receiving a
    sonar ping

8
Using Joysticks
  • To control your robot using a joystick axis or a
    button, use these functions
  • frcRFport gets the value from a joystick
    axis
  • port p1_y, p1_x, p1_wheel, p2_x,p3_x, etc.
  • frcOIJoystickButtonsport
  • port oiButtonPort1Button1 through
    oiButtonPort4Button4

9
Using Loops
  • A Loop will help a portion of your code execute
    repeatedly, until told to stop.
  • while(true true)
  • motorport1 frcRFp1_y
  • motorport2 frcRFp2_y
  • This code will cause the motors to respond to the
    joystick values forever.
  • The loop reads (while true is equal to true)

10
Analog Sensors
  • Very easy to read analog sensor values
  • SensorValueport
  • port in1,in2,in3 in16
  • while(SensorValuein1 lt 10)
  • motorport1 frcRFp1_y
  • motorport2 frcRFp2_y
  • This program will run until an analog sensor on
    port 1 sees a value of less than 10.
  • Analog sensor values can range from 0 to 1023

11
Digital Sensors
  • Digital sensors are a little more complex
  • First you have to decide if you want the sensor
    port to be an input or output
  • frcDigitalIODirectionport condition
  • port pio1, pio2, pio3, pio18
  • condition dirInput or dirOutput
  • Second you have read or assign the value
  • frcDigitalIOValueport
  • If an input, this will read the value (either a 1
    or 0)
  • If an output, you can assign the value using a 1
    or 0.
  • frcDigitalIOValueport 1 // turns on the
    digital output port

12
ROBOTC for IFI Version 1.14
  • New ROBOTC version
  • Has built in support for
  • encoders,
  • accelerometer,
  • gyro sensor,
  • OI LEDs
  • and more!
  • Make sure to upgrade!

13
IR Board Review
  • Rule Clarification from Team Update 3
  • 4 Signals Allows
  • 4 Signals 4 actions
  • Signals must repeat when the same button is
    pressed.

14
Operator Interface LEDs
  • 11 LEDs installed on Operator Interface
  • 7 Green
  • 4 Red
  • User Controllable with ROBOTC

15
Controlling the LEDs
  • New ROBOTC function
  • frcOILEDsLED true or false
  • Examples
  • frcOILEDsoiLEDPWM1_Green true
  • Turns on PWM1 Green LED
  • frcOILEDsoiLEDPWM1_Green false
  • Turns off PWM1 Green LED
Write a Comment
User Comments (0)
About PowerShow.com