<jupyter_start><jupyter_text>@Copyright (C): 2010-2019, Shenzhen Yahboom Tech  @Author: Malloy.Yuan  @Date: 2019-07-17 10:10:02  @LastEditors: Malloy.Yuan  @LastEditTime: 2019-09-17 17:54:19    Turn on the buzzerTurn the buzzer on or off every 1 second<jupyter_code>import RPi.GPIO as GPIO
import time

# Pin Definitions
BEEP_pin = 6 

def main():
    # Pin Setup:
    # Board pin-numbering scheme
    GPIO.setmode(GPIO.BCM)
    # set pin as an output pin with optional initial state of HIGH
    GPIO.setup(BEEP_pin, GPIO.OUT, initial=GPIO.HIGH)

    print("Starting demo now!")
    curr_value = GPIO.HIGH
    try:
        while True:
            time.sleep(1)
            # Toggle the output every second
            print("Outputting {} to pin {}".format(curr_value, BEEP_pin))
            GPIO.output(BEEP_pin, curr_value)
            curr_value ^= GPIO.HIGH
    finally:
        GPIO.cleanup()

if __name__ == '__main__':
    main()<jupyter_output><empty_output><jupyter_text>Buzzer whistle three timesThe buzzer GPIO port is flipped 6 times (Separate from the previous cell code, this is a separate code)<jupyter_code>import RPi.GPIO as GPIO
import time

# Pin Definitions
BEEP_pin = 6 

# Pin Setup:
# Board pin-numbering scheme
GPIO.setmode(GPIO.BCM)
# set pin as an output pin with optional initial state of HIGH
GPIO.setup(BEEP_pin, GPIO.OUT, initial=GPIO.LOW)

GPIO.output(BEEP_pin, GPIO.HIGH)
time.sleep(0.1)
GPIO.output(BEEP_pin, GPIO.LOW)
time.sleep(0.2)
GPIO.output(BEEP_pin, GPIO.HIGH)
time.sleep(0.1)
GPIO.output(BEEP_pin, GPIO.LOW)
time.sleep(0.2)
GPIO.output(BEEP_pin, GPIO.HIGH)
time.sleep(0.1)
GPIO.output(BEEP_pin, GPIO.LOW)
time.sleep(0.2)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10940272028385571, 'fraction_numerical': 0.03134240094618569, 'mean_word_length': 3.752808988764045, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '577674', 'license': 'MIT', 'n_tokens_mistral': 660, 'n_tokens_neox': 612, 'n_words': 158, 'path': 'notebooks/3.Using of GPIO/3.Starting buzzer/Starting buzzer.ipynb', 'repo_name': 'Hoehlenbaer/jetbot', 'size': '1691'}