How Panda can use sensors?


#1

I often see in tutorials examples with Panda interacting with various sensors. For instance Panda can be connected with ultrasonic sensor and it can tell the distance from an obstacle. Or I guess Panda can say the temperature based on the information it receives from temperature sensor. I do not understand how it works. I mean I see no way to link in mBlock programme Panda and the sensors that installed on my Ranger. It seems there are two absolutely separate instances which cannot be connected anyway.
When I crate Panda in mBlock and look into “sensors” section I do not see any physical sensors. And if I create in mBlock Ranger I have no idea how to link it with Panda.
I have mbot Ranger and mBlock v.5
Would appreciate any help.


#2

Actually it is the main board communicate with mBlock software, panda just shows the result only when we disable upload mode and keep main board connected.


#3

Not sure I can get what you mean.
Look at the screenshot below. The Ranger is connected, upload mode off. We have Panda and we have not any phisical sensors in the “sensors” section (take my word on it).

In the second sreenshot I have added Ranger and we can see all its sensors in corresponding section. But how I can make Panda receive info from any of these sensors?


#4

Take the ultrasonic sensor as an example.

Connect USB from robot/ranger to computer with USB cable, then update firmware:

Then code like below: (you need variable)


Go to Sprite, code like this:


Note: you have disable upload mode.


#5

Thank you! It has worked.


#6

:relaxed: