week 2

1. Design

Compared with the design of the plane mask in the first week, we further improved the arrangement of the shade panel in this week to make it more effective. In the last vision of the plane we found that when in some special dgree the sigle shade panel will affect several other photoresistors, which may cause light source identification error.

 

In the new vision, the number of photosensitive resistors is reduced to three, and the four shade panels have be replaced by a T shape shade panel, the photosensitive resistors below the shade panel is used for shuffling control and the photosensitive resistor under the shade panel can do the swing up and down control. When all three photosensitive resistors can come into the light, the platform will face the light.


2. Hardware

On the hardware side, we have designed the circuit  schematic diagram is the picture below.

The pin A0 to A2 is used to connect the photoresistances to get the light signal. The pin D1 to D5 is be connected to the LED which can responce the servoes action. The pin D9 and D10 are used to out put signal to control the servoes.

The hardware is still in preparation, we plan to use cardboard as the frame, because cardboard is enough hard and light.

 

 

 

3. Software

we need to use the #include <Servo.h> to control the servoes.

attach is used to connect the servo with the pin.

write is to control the angle of servo.

 

 

 By using the code below, we can control the servo rotate 180 degrees clockwise with a delay of 20 milliseconds per degree, and 180 degrees counterclockwise with the same speed.


Next week we will complete the remaining hardware parts and form a relatively complete set of software.



评论

此博客中的热门博文

week 4

Week 1