finalize my previous project, field trip, and hacking the printer

After finalize this code, I found that to write code is also like doing graphic design(I mean the kind of graphic design that “makes sense”), and also interaction design: to make it easier to understand, we need to consider the hierarchy, the layout, and also the representational language, such us the use of “// — — — //” .

We need to follow the “ users’ ” conceptual model and patterns in their head. We need to follow the existing representational patterns, such as indentations. …


Program robot seeks light

Program robot to avoid obstacles

Program robot to seek light and avoid obstacles at the same time

I have came through a long way to figure out how to do this assignment.

1.smoothing

The first obstacle I encountered is to smooth the readings from distance sensor(HC-SR04). I created an array of 10 readings from one angle, and finally successfully achieve the right numbers with help from Michael.

here is the readings in the serial monitor.

“distance is” is the original readings from one angle, so there are 10 readings from one angle;

“the array is” is the…


To build a robot that can chasing the light

The code:

const int in1 = 2;//motor1
const int in2 = 4;//moto1
const int in3 = 7;//motor2
const int in4 = 8;//motor2
const int enable = 3; //the output of motor1's speed
const int enable2=5;//the output of motor2's speed
int motorSpeed = 200;//the motor’s speed
int sensor1Mark =780;//a number between cover and uncover the sensor1
int sensor2Mark = 950;//a number between cover and uncover the sensor2
void setup() {
Serial.begin(9600);
pinMode(in1, OUTPUT);//motor1
pinMode(in2, OUTPUT); //motor1
pinMode(in3,OUTPUT);//motor2
pinMode(in4, OUTPUT);//motor2
pinMode(enable, OUTPUT);//to set the motor speed to motor1
analogWrite(enable, motorSpeed);
pinMode(enable2,OUTPUT);//to set the…

The robot needs to go forward and backward depends on the two photoresistors: when one sensor senses more light, it goes forward, otherwise, it goes backward.

The schematics

The code:

const int in1 = 13;//motor1
const int in2 = 12;//moto1
const int in3 = 9;//motor2
const int in4 = 8;//motor2
const int enable = 11; //the output of motor1's speed
const int enable2=10;//the output of motor2's speed
int motorSpeed = 200;//the motor’s speed
int sensor1Mark =500;//a number between cover and uncover the sensor1
int sensor2Mark = 780;//a number between cover and uncover the sensor2
void setup() {
Serial.begin(9600);
pinMode(A2,OUTPUT);//the power(5V)…

1.Finish soldering H-bridge on a perforated breadboard (don’t forget socket)

2.Finish building robot

3.Test both robot wheels. Because you’ve only one H-bridge, you’ll have to test the wheels one at a time. Make sure both wheels go forwards and backwards

The schematics of the circuit. I found to draw it by hand is a very useful method. Because, first, we can mark the wires we have done; second, it can help us learn the circuit.

I am so mesmerized by the schematics, it reminds me the conceptual model in the interaction design field. There must be a way to represent the conceptual model in this way. And there must be a universal language of conceptual model, or partially universal.


Today’s class is more on the hardware, an review and refresh about voltage, current and resistor. It reminds me my high school physics teacher, and the suffering time learning it. But it is much easier and interesting now to learn by doing.

The assignment:

1.Explain voltage and current in your own words

2.Finish soldering wires to two of your motors. Attach male headers on the other end.

3.Do H-bridge on a breadboard lab

With switches

With Ardiuno

Start building your robot

Explain voltage and current in your own words:

Current: rate of flow of traffic

Voltage: pressure of how hurry…


In today’s class, the first half of the class focused on arrays and functions , and the second half of the class Michael taught us how to do soldering.

I found there are so many similarities with JavaScript: the concepts of arrays, functions. But there are also some differences, such as to create a function, in Arduino, there is no “function” word ahead. Personally, I prefer the JavaScript way of creating a function, because it is more clear that it is a function.

Connect 3 LEDs to three non-adjacent pins (e.g. 3, 12, 7) on your Arduino. Make the LEDs…


In today’s class, we combined two circuits from previous class. Today’s class is more focused on the code part: we learnt if statement and for statement.

Project 1

Build this circuit on your breadboard. It should look familiar, it’s the same combination of two circuits we used yesterday. Note that we’re using pin 3:


The assignment description is here:

http://teachmetomake.com/wordpress/arduino-robotics-summer-2015-cca

Build the photoresistor circuit that we used in class, upload the sketch, open the serial monitor, and verify that the numbers change as you allow more or less light to fall on the photoresistor. Make note of the smallest and biggest numbers you get, very roughly (say rounded to the nearest 50). Remember that the diagrams I showed in class are here

photo of the circuit

Ying Liang

I am a senior UX designer at NetDragon, focusing on educating designers with systems thinking methodologies. I graduated from CCA (California College of the Art

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store