Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
research-plan-programming [2024/06/26 18:01] – created daniel.chen | research-plan-programming [2024/06/26 19:38] (current) – daniel.chen | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== programming ====== |
- | [[daniel-comprehensive-report| back]] | + | [[daniel-chen| Daniel Chen]] |
- | ====== car part ====== | + | ==== These are the codes for testing |
- | input.onButtonPressed(Button.A, | + | |
- | wuKong.setMotorSpeed(wuKong.MotorList.M1, | + | |
- | wuKong.setMotorSpeed(wuKong.MotorList.M2, | + | [[daniel-code-car-part| car part]] |
- | T = 1 | + | |
- | }) | + | [[daniel-code-pen-part| pen part]] |
- | input.onButtonPressed(Button.AB, | + | |
- | | + | [[daniel-code-wheel-part| wheel part]] |
- | wuKong.setMotorSpeed(wuKong.MotorList.M1, | + | |
- | wuKong.setMotorSpeed(wuKong.MotorList.M2, | + | |
- | T = 0 | + | |
- | } else { | + | |
- | wuKong.stopMotor(wuKong.MotorList.M1) | + | |
- | wuKong.stopMotor(wuKong.MotorList.M2) | + | |
- | T = 1 | + | |
- | } | + | |
- | }) | + | |
- | input.onButtonPressed(Button.B, | + | |
- | | + | |
- | | + | |
- | T = 1 | + | |
- | }) | + | |
- | let T = 0 | + | |
- | T = 1 | + | |
- | ====== pen part ====== | + | |
- | basic.forever(function () { | ||
- | if (input.buttonIsPressed(Button.A)) { | ||
- | wuKong.setServoSpeed(wuKong.ServoList.S0, | ||
- | } else { | ||
- | wuKong.setServoSpeed(wuKong.ServoList.S0, | ||
- | } | ||
- | }) | ||
- | ====== wheel part ====== | ||
- | https:// | ||
- | *This is a code written by someone else. This is not the final version, but it shows that omniscience can be use in micro bit. |