Serial communication between Mac and micro:bit

please format code with </> button * homework policy * asking questions

can someone pls guide me to do something similar to this…

It seems the highlighted one program is ok for window’s laptop but not for Mac. What should change so as to facilitate communication between [p5.js] running in your browser and a micro:bit?

line 33 should give you a list of serial ports for the Mac. Choose the correct one and insert that text for the portName in line 12.

thank you for your reply, but where can I find the list of serial ports for the Mac?

I was hoping p5 would list them for you with the code on line 33. But if that doesn’t work, try typing ls /dev/cu.* on the command line in Terminal. There is a space after ls.