Ranger
RANGER is the Ultrasonic distance sensor support module.
Add Input Device
Item |
Description |
---|---|
Ranger |
Returns the current distance measurement from the specified ultrasonic ranger. |
CE products: from ranger import *
TI-Nspire CX II:from ti_hub import *
|
|
|
The function to create the object is pasted from the menu.
var=ranger("port")
Command: |
var=ranger("port") |
---|---|
Command |
var=ranger("port") |
Range: |
|
Describe: |
Create an object for the ranger sensor attached to the “port”. |
Result: |
|
Type or |
Control |
var.measurement()
Command: |
var.measurement() |
---|---|
Command |
var.measurement() |
Python |
TI Nspire CX II: from ti_hub import * r1 = dht("IN 2") d = r1.measurement() print("Distance is: ", d) |
|
CE products: from ranger import * r1 = dht("IN 2") d = r1.measurement() print("Distance is: ", d) |
Range: |
|
Describe: |
Returns the distance measured by the sensor in meters. |
Result: |
|
Type or |
Control |