EloiStree / HelloInput

Collect of information about old project on Input in aim to do a workshop on the topic
0 stars 0 forks source link

Website: https://code.circuitpython.org/ (Online IDE) #282

Open EloiStree opened 1 week ago

EloiStree commented 1 week ago

If you don't have access to your own computer and can't install the following software:

then you can edit code directly from a website.

Nowadays, Chrome-based browsers have built-in capabilities to connect to USB devices and drives with specific permissions.

By visiting this website, you can edit code on someone else's PC: https://code.circuitpython.org/


Try it

image


print("Hello World")

import time
import board
import digitalio

# Set up pin 20 as an output
pin20 = digitalio.DigitalInOut(board.GP20)
pin20.direction = digitalio.Direction.OUTPUT

# Set up pin 19 as an output
pin19 = digitalio.DigitalInOut(board.GP19)
pin19.direction = digitalio.Direction.OUTPUT

# Blink the pins in a loop
while True:    
    delay =0.1
    delay =3

    # Turn both pins on
    pin20.value = True
    pin19.value = True
    time.sleep(delay)  # Wait for 0.5 seconds

    # Turn both pins off
    pin20.value = False
    pin19.value = False
    time.sleep(delay)  # Wait for 0.5 seconds