<jupyter_start><jupyter_text>Led On Off Example<jupyter_code>#turn off led
board.digital[3].write(1)
#turn on led
board.digital[3].write(0)<jupyter_output><empty_output><jupyter_text>Get switch data<jupyter_code>from IPython.display import clear_output, display
board.samplingOn()
# Buttons={'S1':'A2','S2':'A3','S3':'A4','S4':'A5','S5':'A6','S6':'A7','S7':'11','S8':'10'}
Buttons={'S1':'16','S2':'17','S3':'18','S4':'19','S5':'20','S6':'21','S7':'11','S8':'10'}

# Buttons={'S7':'11','S8':'10'}

Button_obj_array=[]

for key, value in Buttons.items():
    Button_obj_array.append(board.get_pin('d:'+value+':i')) # 'd'
for elements in Button_obj_array:
    elements.enable_reporting()
    
# digital_0 = board.get_pin('d:10:i') # 'd'
# digital_0.enable_reporting()

while True:
    clear_output(wait=True)
    if (Button_obj_array[0].read()) == False:
        print("Button1 pressed")
        start_time=time.time()
        while (Button_obj_array[0].read() == False): 
            stop_time=time.time()
        
        print("Button Pressed",stop_time-start_time)
        time.sleep(3)
    if (Button_obj_array[1].read()) == False:
        print("Button2 pressed")
        start_time=time.time()
        while (Button_obj_array[1].read() == False): 
            stop_time=time.time()
        
        print("Button Pressed",stop_time-start_time)
        time.sleep(3)
        
 #   elif (Button_obj_array[0].read()) == True:
 #       print("Button Not Pressed")
    else:
        print("Button has never been pressed")
    board.pass_time(0.1)
import time

start_time=time.time()
stop_time=time.time()
while True:
    
    clear_output(wait=True)
    print(digital_0.read())
    
    if (digital_0.read()) == False:
        print("Button pressed")
        start_time=time.time()
        while (digital_0.read() == False): 
            stop_time=time.time()
        
        print("Button Pressed",stop_time-start_time)
        time.sleep(3)
        
    elif (digital_0.read()) == True:
        print("Button Not Pressed")
    else:
        print("Button has never been pressed")
    board.pass_time(0.1)<jupyter_output><empty_output><jupyter_text>Glow led correponding to Pins<jupyter_code>board.exit()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1767337807606264, 'fraction_numerical': 0.033109619686800894, 'mean_word_length': 3.6103092783505155, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '614257', 'license': 'MIT', 'n_tokens_mistral': 840, 'n_tokens_neox': 799, 'n_words': 118, 'path': 'Software/Examples/Notebooks/PhyCom Beginner Hello world.ipynb', 'repo_name': 'MrityunjaiKumar/PhySyncBridge', 'size': '2235'}