# Case 56: Powerful Fighter ## Introduction When we see increasingly advanced civil airliners and military fighter jets at air shows and on the Internet, we marvel at how fast technology is advancing. And, with the introduction of the fifth generation of stealth fighter jets marks a whole new level of technology in fighter jets. In this class, we will not only make a fighter of our own, but we can also program the operating procedures of the fighter. Of course, I think you may not be satisfied with the abbreviated version of the fighter model, I hope you can improve and innovate the completed work, not only in terms of appearance but also in terms of functionality and programming, so let's start. ![](./images/56_1.jpg) ### Materials Required Nezha expansion board × 1 micro:bit V2 × 1 Ultrasonic sensor × 1 RJ11 cable × 1 Bricks × n **Note: If you want all of the above components, you may purchase the [Nezha 48 IN 1 Inventor's Kit](https://shop.elecfreaks.com/products/elecfreaks-micro-bit-nezha-48-in-1-inventors-kit-without-micro-bit-board?_pos=2&_sid=ed1b6fbd2&_ss=r)**. ### Assembly Steps Component Details ![](./images/56_2.jpg) Build it as the assembly steps suggest: ![](./images/56_3.jpg) ![](./images/56_4.jpg) ![](./images/56_5.jpg) ![](./images/56_6.jpg) ![](./images/56_7.jpg) ![](./images/56_8.jpg) ![](./images/56_9.jpg) ![](./images/56_10.jpg) ![](./images/56_11.jpg) ![](./images/56_12.jpg) ![](./images/56_13.jpg) ![](./images/56_14.jpg) ![](./images/56_15.jpg) ![](./images/56_16.jpg) ![](./images/56_17.jpg) ![](./images/56_18.jpg) ![](./images/56_19.jpg) ![](./images/56_20.jpg) ![](./images/56_21.jpg) ![](./images/56_22.jpg) ![](./images/56_23.jpg) ![](./images/56_24.jpg) ![](./images/56_25.jpg) ![](./images/56_26.jpg) ![](./images/56_27.jpg) ## Connection Diagram Connect the four motors to the M1, M4, and the ultrasonic sensor to the J1 port as the picture suggests. ![](./images/56_28.jpg) ## MakeCode Programming ### Step 1 Click “Advanced” in the MakeCode drawer to see more choices. ![](./images/49_10.png) For programming the servo, we need to add a package. Click “Extensions” at the bottom of the drawer and search with “nezha” to download it. ![](./images/49_11.png) For programming the PIR sensor, we need to add a package. Search with “PlanetX” in the dialogue box and click to download it. ![](./images/49_12.png) *Notice*: If you met a tip indicating that some codebases would be deleted due to incompatibility, you may continue as the tips say or create a new project in the menu. ### Reference The program is shown in the figure below: ![](./images/56_29.jpg) Link: https://makecode.microbit.org/_AtzHu38c8Wwx You may also download it directly:
### Result We can see that the fighter turns when it encounters an obstacle and shows how many times it encounters the obstacle.