Some thoughts of the CrazyCoding Union

Union activities:

  1. “Reading Books”: Reading something fun… such as The World Is Flat. This made a difference to my opinion…
  2. “Hi, New Teacher”: In our union, almost every member has a “teacher”. In fact, this “teacher” is another union member who learns better than the “student”: By this way, we will be better, together.
  3. “Producing New Problems”:  Any of us can “produce” problems for “weekly tests”. On weekly tests, we can get something fun from the problems.
  4. “Weekly Tests”: Almost every week, we have to take some “small” tests. If we don’t pass the tests, we have to take them again… Until we AK them.
  5. “Solution Sharing”: After the tests, there are always somebody sharing their solutions. By doing this action, we can learn about the different solutions to each problem.
  6. So fun…

Above all, I think… the union will get better… (w)

Arduino Tutorials – [1] Hello World

Getting prepared for these things:

  • Arduino
  • USB Cable
  • PC
  • Internet

 

First things first, let’s install Arduino IDE so that we can upload the code to the Arduino board.

  1. Download the software from http://arduino.cc/download or http://download.mby.pw/software/arduino.exe
  2. Install it. The drivers are included. Please choose “Install” when the driver installing box appears.  AT1-Screenshot-1
  3. Well done~

 

Secondly, let’s upload a test code.

  1. Connect your Arduino to your PC with an USB Cable.
  2. Launch Arduino IDE, then select Board Model (Arduino UNO) and Port in “Tools” (depending on your PC settings)AT1-Screenshot-2
  3. Click “File” -> “Example” -> “01. Basics” -> “Blink”, then click the second button on the top bar “Upload”.AT1-Screenshot-3
  4. Wait a moment until the code is uploaded.
  5. If all things don’t get wrong, you can see a light on the board blinking.
  6. Congratulations~ You succeed.

 

At last, you should understand the code.

/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.
点亮一秒一个LED灯,然后熄灭一秒,循环。
This example code is in the public domain.
*/

// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
// 在大多数Arduino板上,引脚13连接着一个板载的LED灯。
// 然后定义一个变量叫做 led,并赋值为13。
int led = 13;

// the setup routine runs once when you press reset:
// 一个被命名为setup的子程序在你按下RESET按钮(或刚上电)后只运行花括号里的代码一次。它通常用于初始化的工作。

void setup() {
// initialize the digital pin as an output.
// 一个被命名为setup的子程序在你按下RESET按钮(或刚上电)后只运行花括号里的代码一次。它通常用于初始化的工作。

//初始化LED(13)引脚为输出引脚。然后该引脚可用于输出高电平(一般为5V)或低电平(0V)
//数字引脚可以被设定为输入(将在下节讲)或输出模式。

//设置引脚模式函数用法:

//pinMode(pin, OUTPUT 或 INPUT);
//	     |               |
//要设置引脚模式的引脚   引脚模式(输出或输入)
pinMode(led, OUTPUT);
}

// the loop routine runs over and over again forever:
// 又一个被命名为loop的子程序在执行完setup后一遍又一遍地执行花括号里的代码。
void loop() {
digitalWrite(led, HIGH);
// turn the LED on (HIGH is the voltage level)
// 设置led(13)引脚输出高电平。点亮LED。

// 设置引脚输出函数用法:
//digitalWrite(pin, HIGH 或 LOW);
//              |        |
// 要设置输出的引脚  输出电平(高电平或低电平)

delay(1000);
// wait for a second
// 延时1000毫秒(1秒)。

// 延时函数用法:
//delay(time);
//       |
//要延时的时间(毫秒)

digitalWrite(led, LOW);
// turn the LED off by making the voltage LOW
// 设置led(13)引脚输出低电平。熄灭LED。

delay(1000);
// wait for a second
// 延时1000毫秒(1秒)。
}

So fun. Try to change the time to delay. Then upload the code. What can you see?

Aside

Something about me [1]

 

[Photo by @萱子]

 

Today, I went to an after-school class. I saw a student wear the uniform of Hangzhou Foreign Language School. And I saw some photos of Spring Trip in the HZFLS. It reminded me of an exam, an important exam.

When I was a school pupil, the primary school asked some of the students to join the exam in order to choose the one who has a chance to enter Hangzhou Foreign Language School. Yes, there was only one “lucky” person.

My dad knew that and said in order to encourage me, “If you get the chance, you will get a Microsoft(R) Surface Pro.” I was full of power. But the “hardware” limited me. My grades weren’t good at that time except math.

While I was solving problems in the exam, as I expected, I found they were too difficult for me, I could answer only half of them… One of the math problems were strange, at first I answered it correctly, but soon I didn’t think that was right, so I cut it out. As soon as I finished doing that problem, the teacher asked us to hand the papers. I handed them with my trembling hands.

I left the exam room with disappointment, I tried not to think about it.

I remembered the problem clearly, it was

 

 

Day after day, the results came out. The “luck person” (The 1st student in this exam) told me, “You are the 2nd. And if you could answer one of these problems more. You would get my chance, the chance to HZFLS. ”

Oops, if I didn’t cut the answer to that math problem, I would….

Surface flied away.

The chance flied away.

The Dream flied away.

 

So, I entered Jianlan Middle School instead of HZFLS.

——

Nowadays, I didn’t get good grades in my middle school, but I was addicted to making UAVs[1], so my parents got angry. As soon as I finished my daily homework, they wanted me to do extra “homework”. My dad said, “If you entered HZFLS, you would be always allowed to making them… But… You will join the high-school-enterence exam… You have to learn hard…”

So… WTF… Why did I cut that answer out. It changed my life. How silly I was!

——

However, in some ways, I was the lucky one.

I am able to have some close friends in my current school.

I am able to see that lucky student enjoy the life in HZFLS.

I am able to enjoy something special in JL.

I am able to…

I should treasure what I have.