# Important things about Internal competition - Software
## How to use the IR sensor array with 5 GPIO input

* Configure GPIO for these 5 pins
* Please read [**RT-Thread GPIO**](https://hackmd.io/@ATKTC/S1vO3eXco)
::: warning
**Warning Don't Open LCD devices at the same time**
* **Don't** `rt_device_open(lcd, NULL);` if you those pins are connected with IR Sensor Array
:::
---
## How to control the motor using PWM
* Please read [**PWM Device**](https://www.rt-thread.io/document/site/programming-manual/device/pwm/pwm/) and test with shell command first
## How to control the servo

* Connect the servo to channel 0, innermost one
* Also, connect the motor because of the **V** of these 3 pwm2 channels are connnected as below:
* 
* Rememeber to Turn on switch next to the motor
* Install `pwm_servo` libraries below and test it
## RT-Thread perperials Libraries
* [**pwm_servo**](https://github.com/CheTangAK/pwm_servo.git)
* To control the angle of the servo device
* Please read and follow the documentation, `README.md`
* For the motor, You could either use servo device to control as well. Since the motor and servo is controlled by PWM signal
* [**mt9v034_camera_rtt**](https://github.com/LeeChunHei/mt9v034_camera_rtt.git)
* [**xpt2046_touch_rtt**](https://github.com/LeeChunHei/xpt2046_touch_rtt.git)
* [**st7735r_tft_rtt**](https://github.com/LeeChunHei/st7735r_tft_rtt.git)
* [**soft_i2c_rtt**](https://github.com/LeeChunHei/soft_i2c_rtt.git)
---
## Linear gradient
<div style="border: 5px solid lightblue; background: linear-gradient(180deg,black, white); height: 320px; width: 240px">
</div>
## Useless thing
<div style="border: 10px;background: linear-gradient(45deg,red, blue); height: 500px; width: 500px padding-buttom: 45px; display: flex; justify-content: center; border-radius: 80px">
<div class="orb"><div>
</div>
<style>
.orb {
position: absolute;
animation:spin 4s linear infinite;
width: 300px;
height: 300px;
margin: auto;
margin-top: 100px;
border-radius: 50%;
box-shadow:
inset 0 0 50px #fff,
inset 20px 0 60px violet,
inset -20px 0 60px blue,
inset 20px 0 300px violet,
inset -20px 0 300px blue,
0 0 50px #fff,
-10px 0 60px violet,
10px 0 60px blue;
}
@keyframes spin { 100% { -webkit-transform: rotate(360deg); transform:rotate(360deg); } }
</style>