Skip to content

Adding Courtesy Tone  #5

@kc9pos

Description

@kc9pos

Hello I am looking for ways to easily add a curtesy tone after a transmission. I was thinking of adding a function similar to this to detect when a CTCSS was detected and play the .wave file however so you have any alternative methods of adding this little feature. Thank You

` while True:

        # Check repeater in use
        count = 0
        print("[Info] :: Checking if repeater is free to ID ...")
        print("[Time] ::", end = " ")
        tim = machine.Timer(period=const.SAMPLING_PERIOD_MS * 4, callback=timer_callback)

        while True:
            count = count + 1

            # If there is some activity, start recount
            # Can be improved to be more smart then
            # a simple unique detection.
            # First approach, increase detection time
            if dr1x.ctcss_detected() == True:
                count = 0
                #print ("[Warn] :: CTCSS detected => Reset counter ...")

            utime.sleep_ms(const.SAMPLING_PERIOD_MS)

            if count % (const.SAMPLING_FREQ) == 0 and count != 0:
                print ("%d" % (int) (count / const.SAMPLING_FREQ), end=" ")
                #print ("[Time] :: Elapsed %d/%d sec." % ((int) (count / const.SAMPLING_FREQ), const.USAGE_CHECK_DURATION), end = " ")
            if count >= (const.USAGE_CHECK_DURATION * const.SAMPLING_FREQ):
                print ("")
                print ("[Info] :: Will ID Repeater ...")
                tim.deinit()
                break
                    
        # Start Tx
        dr1x.tx_start()
        utime.sleep(0.75)

        play_id()
        check_temperature_and_inform_if_above(const.TEMPERATURE_THRESHOLD)
        count_ann = check_if_its_time_to_announce(6, count_ann)

        #stop TX
        utime.sleep(0.75)
        dr1x.tx_stop()` 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions