PComp_03_MouseControl

Just have to say… Intro to Physical Computation is the most confusing and yet the most rewarding class I have in ITP so far. Problems and questions appear like bubbles from the boiling water, and when Tom Igoe explained the INPUT and INPUT_PULLUP to me in class, I felt my brain was stirred like a sticky mud. But once problems were sold, I felt I was in heaven.

Lab_02 before week_03_class

First_Arduino!!

It’s a bitter(FXCK!)-yet-sweet(YAH!) feeling when you found out that the whole problem was actually arose from a super simple reason! Frustrating about my first attempt to program Arduino and then finding LEDs failing to light up because of wrong direction. Anyway, YAH for the light!!!

During the self-labs, in the beginning I was really confused about the different wiring ways showed in the instructions, and I pondered deeply about it.

 

 

 

 

 

 

 

 

 

As pics show above, resistors were put in the different places. And then I just thought that, hey! why don’t I just try to wire it in different ways and see if it gives same result? And I tried and it did. Silly and happy.

Arduino_Lab_Test

Week_03_MouseControl

Billy and I used Joystick to control x and y. And quoting from Tom:

“… The joystick select button is a digital input, but it’s wired differently than the buttons you saw in the Digital Lab or the Mouse Control With Pushbuttons Lab. It’s wired to connect to ground when you press it. To read it, then, you’d still use digitalWrite(), but you’d expect it to go low when pressed instead of high. And instead of a pulldown resistor like you’ve used in those other two labs, you’d use a pullup resistor, so that it’s connected to 5V when the switch is not open…. … The Arduino has built-in pullup resistors that you can use on the digital inputs. When you set the pin to be an input using the pinMode() command, use the parameter INPUT_PULLUP instead of INPUT.”

So at first we wrote the press of Joystick as pinMode(3, INPUT_PULLUP), but then we found that it’s actually difficult to control x, y and press in one single stick, so we decided to add another button as the right-click-mouse. We changed back the code about digitalInput as pinMode(3, INPUT) and adjusted the related code below as well. Also, we used map() to control the speed of the mouse movement since delay() will change the entire loop speed and it’s not necessary.

inClass_MouseControl

One thing I also want to mention is that, in class classmates came out a lot of ideas about how to control the mouse. With string sensors, force sensors, tilt sensors, buttons connected with different resistors, etc. Very creative!!! I was kind of shocked yet inspired at the same time. Maybe I should stop playing safe. Just let go my imagination first, and then try to catch its tail and fly with it carelessly after???

Very interesting 🙂

Leave a Comment.