'n makecode pakket om sonar sensore (ping) soos HC-SR04met I2C uitbreiding PCF8574 te gebruik.
Gewysigd deur #easylab4kids
This package contains a ping
block that can return the distance to an obstacle detected by the sonar.
sonar.ping(DigitalPin.P1, DigitalPin.P2, PingUnit.Inches);
Use the plot bar graph
block to visualize the distance reported by your sensor.
basic.forever(() => {
let p = sonar.ping(DigitalPin.P1, DigitalPin.P2, PingUnit.Inches);
led.plotBarGraph(p, 0);
})
MIT
- for PXT/microbit
- for PXT/calliope
- for PXT/Circuit Playground Express
(The metadata above is needed for package search.)
## Code of Conduct
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [[email protected]](mailto:[email protected]) with any additional questions or comments.
I2C versie door Michiel Erasmus #easylab4kids