博文

week 3

 1. hardware In this week we finishied the hardware part and combine them together, after assembling components we found that the solar plane is much heavier than other part of the components so it make the whole structure imbalance, when the sevor turn to some special angle the plane will overwhelm the servo.  The solution we try to use is add a counterweight at the back to achieve overall balance and prevent leaning forward. 2. software The software outline have been finishied, the code be sumilated in TINKERCAD to make sure the code can hit the mark.   We connected the basic compoments and input code, the result of simulation is consistent with our prediction, which indicates that this code can meet our basic needs. Here is the code: #include<Servo.h> Servo lar_servo; Servo uad_servo; int lar_angle = 90;//Define Angle Parameters int uad_angle = 45; int l_state = A0;//Photosensitive resistor analog input port int r_state = A1; int u_state = A2; int d_state = A3; v...