Patrol car based on Nezha and four-route patrol

Patrol car based on Nezha and four-route patrol

The four-way survey sensor is a new sensor in the Planetary family. It has four survey probes and has survey capability on more complex maps. The operating voltage is between 5-3V.

material requested:

Patrol car based on Nezha and four-route patrol

2、Structure of the building:

2.1、Set up the fixed structure of the motor

Patrol car based on Nezha and four-route patrol

2.2、Join the two motors together

Patrol car based on Nezha and four-route patrol

Patrol car based on Nezha and four-route patrol

2.3、Splice the frame part

Patrol car based on Nezha and four-route patrol

Patrol car based on Nezha and four-route patrol

2.4、Spliced rear wheel

Patrol car based on Nezha and four-route patrol

Patrol car based on Nezha and four-route patrol

2.5、Spliced front wheel

Patrol car based on Nezha and four-route patrol

Patrol car based on Nezha and four-route patrol

2.6、The upper part of the motor is reinforced

Patrol car based on Nezha and four-route patrol

Patrol car based on Nezha and four-route patrol

2.7、Reinforce the lower part of the motor

Patrol car based on Nezha and four-route patrol

Patrol car based on Nezha and four-route patrol

2.8、Nezha fixed structure

Patrol car based on Nezha and four-route patrol

Patrol car based on Nezha and four-route patrol

2.9、Assemble a four-way patrol line

Patrol car based on Nezha and four-route patrol

Patrol car based on Nezha and four-route patrol

2.10、assemble NeZha

Patrol car based on Nezha and four-route patrol

Patrol car based on Nezha and four-route patrol

Connect micro-bit final product

Patrol car based on Nezha and four-route patrol

3、code

Patrol car based on Nezha and four-route patrol

basic.forever(function () {
    PlanetX_Basic.Trackbit_get_state_value()
    if (PlanetX_Basic.TrackbitState(PlanetX_Basic.TrackbitStateType.Tracking_State_4)) {
        neZha.setMotorSpeed(neZha.MotorList.M1, 70)
        neZha.setMotorSpeed(neZha.MotorList.M2, 70)
    }
    if (PlanetX_Basic.TrackbitState(PlanetX_Basic.TrackbitStateType.Tracking_State_6) 
	|| PlanetX_Basic.TrackbitState(PlanetX_Basic.TrackbitStateType.Tracking_State_13)) {
        neZha.setMotorSpeed(neZha.MotorList.M1, 100)
        neZha.setMotorSpeed(neZha.MotorList.M2, 0)
    }
    if (PlanetX_Basic.TrackbitState(PlanetX_Basic.TrackbitStateType.Tracking_State_7) 
	|| PlanetX_Basic.TrackbitState(PlanetX_Basic.TrackbitStateType.Tracking_State_9)) {
        neZha.setMotorSpeed(neZha.MotorList.M1, 0)
        neZha.setMotorSpeed(neZha.MotorList.M2, 100)
    }
})

4、demonstration

https://www.youtube.com/watch?v=EaVFslrEL5k