ofdl-robotics-tw / SPIKE-PD_Line_Follow

SPIKE Prime PD Line Follow Program
MIT License
11 stars 4 forks source link

Sensor Mode #1

Open TheEvandroLuis opened 2 weeks ago

TheEvandroLuis commented 2 weeks ago
from hub import port

S1d = port.F.device
S2d = port.D.device
S1d.mode(4) #RREFL
S2d.mode(4) #RREFL

while True:
    print(str(S1d.get()[0]) + " , " +str(S2d.get()[0]))

This part doesn't work here. Do I have to install anything before?

a10036gt commented 2 weeks ago

What version of software you using with?

TheEvandroLuis commented 1 week ago

I'm using the lastest version of the spike app and my hub updated

a10036gt commented 1 week ago

If using python, we suggest using pybricks instead of it. Pybricks can use class PUPDevice to read RRFEL data.