硬件


Shell Lab S1是USB接口精简版控制器。

控制器+接线端子


接线说明


扩展模块: NPN-MOS扩展


扩展模块: 继电器扩展


软件

Shell Lab 测试台软件


USB虚拟串口驱动(Windows)


通用版固件

包含命令: gpio/led/pwm/adc/i2c/spi/ds1w/pulse

定制版固件

应用

继电器流水灯 下载
# runs in ShellLab Testbench Application
RA,RB,RC,RD='0.0','0.1','0.2','0.3'  # PA0~PA3
s = ShellLab(PORT)
s.pinOutput([RA,RB,RC,RD])
while True:
    s.pinSet(RA)
    time.sleep(0.2)
    s.pinClr(RA)
    s.pinSet(RB)
    time.sleep(0.2)
    s.pinClr(RB)
    s.pinSet(RC)
    time.sleep(0.2)
    s.pinClr(RC)
    s.pinSet(RD)
    time.sleep(0.2)
    s.pinClr(RD)


用PWM控制直流电机软启停 下载
# runs in ShellLab Testbench Application
s = ShellLab(PORT)
INA, INB = '0.4', '0.5'
s.pinOutputLow([INA, INB])
s.pwm_init(init_value=0)
forward = True
while True:
    direction_pin = INA if forward else INB
    s.pinSet(direction_pin)
    # speed up 0-->100
    s.pinSet(direction_pin)
    val = 0
    while val < 100:
        val = 100 if val > 90 else (val+10)
        s.pwm( index=0, value=val )
        info( val )
        time.sleep(0.1)
    # wait
    time.sleep(2)
    # speed down 100->0
    while val > 0:
        val = 0 if val<10 else (val-10)
        s.pwm( index=0, value=val )
        info( val )
        time.sleep(0.1)
    s.pinClr(direction_pin)
    # wait
    time.sleep(2)
    # switch direction
    forward = not forward


连接树莓派控制


连接香橙派控制