Me micro switch A


I am looking for a sample program using the mkicro switch A with mBot2… it looks like the value is continuously changing from 0.0 to 0.1 when the switch is not pressed and stay at 0.1 when it is pressed… I don’t really understand… any help please !


Could you maybe give a picture of the sensor you’re using and what port it is in?


this is the sensor I am using… I am using the port s1.
Thank you for your help


On the switch, I am using the common port © with the black/white cable and the second cable on the NC port.


Is the limit switch supposed to be compatible with mBot 2?


I don’t know… I have the possibility of using the mBot instead… but I would prefer the mBot2.
Any help !!


Do you know what wires do what on your sensor?


Yes I know… The black/white wire is supposed to be connected to the C(common) and the white goes to the NC… but I tried all combinations without any result… I am thinking may be it is not compatible with mbot2 or mbot !! I


Likely it isn’t. You can contact makeblock and see if they have a limit switch that is, though.