File: find.py

package info (click to toggle)
nxt-python 3.5.1-1~bpo12%2B1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm-backports
  • size: 816 kB
  • sloc: python: 6,857; xml: 22; makefile: 20; sh: 4
file content (10 lines) | stat: -rw-r--r-- 274 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
#!/usr/bin/python3
"""NXT-Python tutorial: find the brick."""
import nxt.locator

# Find a brick.
with nxt.locator.find() as b:
    # Once found, print its name.
    print("Found brick:", b.get_device_info()[0])
    # And play a recognizable note.
    b.play_tone(440, 250)