Documentation for Recitation 3
By Xiaoyi Cai (Mia) Date:3/9/2021
- CIRCUIT
During the recitation, I tried the joystick module. At first, it seems to be difficult to connect the joystick, but, with the help of the Professor, I finally got a complete understanding of it. In all, there are three outputs, one output for the x-axis, one for the y-axis, and another for the z-axis. Each of them has a SIG, a VCC, and a GND. Therefore, the following connection work was easier than I thought before, and the circuit succeeded to work in one go. As for the code, thanks to the fellow, I got full control of the map function that helped me to range the input from (0, 1023) to (1, 255).
Here’s the code I used during the recitation 🙂
int JoyStick_X = 0; //x int JoyStick_Y = 1; //y int JoyStick_Z = 3; //key void setup() { pinMode(JoyStick_Z, INPUT); Serial.begin(9600); // 9600 bps } void loop() { int x, y, z; x = analogRead(JoyStick_X); y = analogRead(JoyStick_Y); z = digitalRead(JoyStick_Z); x = map(x, 0, 1023, 0, 255); analogWrite(13 , x); y = map(y, 0, 1023, 0, 255); analogWrite(9, y); Serial.print(x , DEC); Serial.print(","); Serial.print(y , DEC); Serial.print(","); Serial.println(z , DEC); delay(100); }
- QUESTIONS:
I. At first, I intended to use this sensor to control the light of my LED. As for pragmatic purposes, I think the combination of joystick and LEDs can be used for controlling all the lights in the home. It’s really interesting and convenient for the user to use this kind of device at home. And compared with the usual switches of the lights, by turning the joystick, it can also adjust the brightness of the LEDs.
II. Recipe is a set of instructions for preparing a particular dish. As for the tutorial, it can also provide instructions to guide people to reach their academic goals. Similarly, codes are able to instruct the computer by telling it what to do. Following the sequence provided by the code, the computer can complete its task. Therefore, Code is often compared to following a recipe or tutorial.
III. In my opinion, the computer provides us both positive and negative influences on our behavior. First of all, it cannot be denied that the computer makes our life much more convenient than before. And it also enables us to get easy access to worldwide information, which grants us more opportunities to get a deeper insight into the world. However, on the other hand, it limits the capabilities of humans. According to The Language of New Media, we can find that AI has already been capable of doing many things that humans used to do, even the things we thought that only humans could do,such as designing. Also, the cost of using AI/computer technology will be cheaper than hiring employees, therefore, people will spend less time practicing this kind of abilities, which is a serious thing that we should consider.