As computing becomes more ubiquitous in our objects, designers need to be more aware of how to design meaningful interactions into electronically enhanced objects. At the University of Washington, a class of junior Interaction Design majors is exploring this question. These pages chronicle their efforts.

Thursday, June 9, 2016

5) Dillon and Dwight - Logic Description

To recap, we have four infra-red sensors and two motors working together in order to point our lamp device at the greatest IR source in the room. In order to do this our Arduino has to take in the information from the IR sensors perform logic and respond with output to the servos motors to make them spin in one direction or the other.

The IR sensors work very simply, if they detect IR light they increase in resistance and the number the Arduino reads from the sensor decreases. So if one sensor is reading lower than it's partner then the amount of IR light is greater in that direction.

Servo motors work on degrees. The Arduino sends a specific number correlating to a degree. This range can vary depending on your servo motors, some servos go from 0-180, some from 0-360, and some are continuous. If your servo motor is continuous then it actually takes a value from the Arduino and spins in that velocity in either a clockwise or counter clockwise direction. For us we have one servo that spins from 0-180 degrees (Y axis or Up vs Down) and one that is continuous (X axis or Left vs Right).

So the Input are the IR sensors. The Logic is the translation of the value the IR sensors are sending to the Arduino and then the corresponding value that the Arduino sends to the servos. And the Output is the servos spinning to point the lamp.

Here is our pseudo code:

No comments:

Post a Comment