/usr/share/doc/python-nxt/examples/mary.py is in python-nxt 2.2.2-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | #!/usr/bin/env python
#
# Converted from mary.rb found in ruby_nxt package
# Plays "Mary Had A Little Lamb"
# Author: Christopher Continanza <christopher.continanza@villanova.edu>
from time import sleep
import nxt.locator
FREQ_C = 523
FREQ_D = 587
FREQ_E = 659
FREQ_G = 784
b = nxt.locator.find_one_brick()
b.play_tone_and_wait(FREQ_E, 500)
b.play_tone_and_wait(FREQ_D, 500)
b.play_tone_and_wait(FREQ_C, 500)
b.play_tone_and_wait(FREQ_D, 500)
b.play_tone_and_wait(FREQ_E, 500)
b.play_tone_and_wait(FREQ_E, 500)
b.play_tone_and_wait(FREQ_E, 500)
sleep(0.5)
b.play_tone_and_wait(FREQ_D, 500)
b.play_tone_and_wait(FREQ_D, 500)
b.play_tone_and_wait(FREQ_D, 500)
sleep(0.5)
b.play_tone_and_wait(FREQ_E, 500)
b.play_tone_and_wait(FREQ_G, 500)
b.play_tone_and_wait(FREQ_G, 500)
sleep(0.5)
b.play_tone_and_wait(FREQ_E, 500)
b.play_tone_and_wait(FREQ_D, 500)
b.play_tone_and_wait(FREQ_C, 500)
b.play_tone_and_wait(FREQ_D, 500)
b.play_tone_and_wait(FREQ_E, 500)
b.play_tone_and_wait(FREQ_E, 500)
b.play_tone_and_wait(FREQ_E, 500)
b.play_tone_and_wait(FREQ_E, 500)
b.play_tone_and_wait(FREQ_D, 500)
b.play_tone_and_wait(FREQ_D, 500)
b.play_tone_and_wait(FREQ_E, 500)
b.play_tone_and_wait(FREQ_D, 500)
b.play_tone_and_wait(FREQ_C, 750)
|