Linker mezzanine card starter kit for 96Boards Python experiments

The following examples demonstrate some of the capabilities of the libsoc_zero library. Please note that all examples are written assuming Python 3. Examples may work under Python 2 (but they may not!)

Red LED Module [118101001-5]

Turn an LED on and off repeatedly

Linker Red LED Module
from libsoc_zero.GPIO import LED
from time import sleep

led = LED('GPIO-E')

while True:
    led.on()
    sleep(1)
    led.off()
    sleep(1)

Button Module [118101002]

Detect if the button has been pressed

Linker Button Module
from libsoc_zero.GPIO import Button
from time import sleep

btn = Button('GPIO-G')

while True:
    sleep(0.25)
    if btn.is_pressed():
        print('Button is pressed!')
    else:
        print('Button is not pressed!')

Wait for button to be pressed and then switch LED on (or off)

from libsoc_zero.GPIO import Button
from libsoc_zero.GPIO import LED
from time import sleep

btn = Button('GPIO-G')
led = LED('GPIO-E')


while True:

    btn.wait_for_press()
    if led.is_lit:
        led.off()
    else:
        led.off()

    sleep(1)

Touch Sensor Module [118101007]

Detect when the sensor is touched

Linker Touch Sensor Module
from libsoc_zero.GPIO import Button

touch = Button('GPIO-C')

while True:
    if touch.is_pressed():
        print("Button is pressed")
    else:
        print("Button is not pressed")

Don’t finish program until sensor is touched

from libsoc_zero.GPIO import Button

touch = Button('GPIO-C')

print('Waiting for press event...')
touch.wait_for_press()
print('Button was pressed!')

Tilt Module [118101004]

Detect when the sensor has been tilted

Linker Tilt Module
from libsoc_zero.GPIO import Tilt

tilt = Tilt('GPIO-G')

tilt.wait_for_tilt()

print('Tilt happened')

Relay Module [118101008]

Linker Relay Module

Linear/Slide Potentiometer Module [118101006]

Linker Potentiometer Module

Light Sensor Module [118101003]

Linker Light Sensor Module

Thermal Module [118101005]

Linker Thermal Module

Joystick Sensor Module []

Linker Joystick Module