Time control design - 2284238y/Team-1-Fernando-Martinez-YI-YI-LianSheng-Liu- GitHub Wiki

About time control, we use the internal Raspberry Pi clock reset circuit.

The time is set to rise at 5 o'clock in the morning; and curtain drop at 7 pm.

The time control block diagram is below.

The specific control loop procedure is as follows:

(1). Firstly, on the screen shows "Time started..."

 print("Time started...")

(2). Then, it is the loop procedure:

 while(True):
    now = datetime.datetime.now()
    if(now.hour=="5" or now.hour==5 and not up): 
        go_up()
        up = True
        down = False
    elif(now.hour=="19" or now.hour==19 and not down):
        go_down()
        up = False
        down = True
    time.sleep(1200)

The complete time control program can be found in the code.

Working principle: The Raspberry Pi automatically detects the time. If the time reaches five o'clock in the morning, the curtains rise; if the time is up to seven o'clock in the evening, the curtains drop.

For information on how this section works, refer to the System Flow Chart in the README.