Users Manual
19/05/2019 Pyboard D-series reference — Pyboard D-series 1.0 documentation
https://pybd.io/hw/pybd_sfxw.html 7/8
Pins and GPIO
AllpinsareavailableviatheirWBUSname,eg
Pin('W19') .Somepinsalsohaveothernames
forconvenience,suchas
Pin('X1') .Seepinoutsforafulllistofaccessiblepinnames.See
pyb.Pinfordetailsofpinuse.
from machine import Pin
x1 = Pin('X1', Pin.OUT)
x1.value(1) # set pin digital high
x2 = Pin('X2', Pin.IN, Pin.PULL_UP)
print(x2.value()) # read digital value
I2C buses
TheI2CbusontheXposion,pinsX9andX10,hastwoindependentuserselectablepull‑up
resistorsonSCLandSDA,of5.6kOhmeach.Theyareconnectedontheirhighsideto
Pin('PULL_SCL') and Pin('PULL_SDA') andaredisabledbydefault.Toenablethemuse:
from machine import Pin
Pin('PULL_SCL', Pin.OUT, value=1) # enable 5.6kOhm X9/SCL pull-up
Pin('PULL_SDA', Pin.OUT, value=1) # enable 5.6kOhm X10/SDA pull-up
RTC (real time clock)
TheinternalRTCisdrivenbyahighprecision,pre‑calibratedoscillator.Seepyb.RTCfor
detailsofRTCuse.
from pyb import RTC
rtc = RTC()
rtc.datetime((2017, 8, 23, 1, 12, 48, 0, 0)) # set a specific date and time
rtc.datetime() # get date and time
SD card
Theboardhasabuilt‑inmicroSDcardslot.IfanSDcardisinserted,bydefaultitwillnotbe
automacallymountintheboard’sfilesystembutitwillbeexposedasamassstoragedevice
ifUSBisused.ToautomacallymounttheSDcardifitisinserted,putthefollowinginyour
boot.py :