Jim Ng 15/1/2014 CENG4480 TUTORIAL 1. ABOUT ME Current MPhil Student supervised by Prof. Mak You can...

Post on 04-Jan-2016

214 views 0 download

Tags:

Transcript of Jim Ng 15/1/2014 CENG4480 TUTORIAL 1. ABOUT ME Current MPhil Student supervised by Prof. Mak You can...

Jim Ng

15/1/2014

CENG4480 TUTORIAL 1

ABOUT ME

• Current MPhil Student supervised by Prof. Mak

• You can find me at Rm116 in SHB

• Email : csng@cse.cuhk.edu.hk

WHAT WILL YOU DO?

• Learn what is a Microcontroller ()

• Familiarize with the basic setup of the Galileo Board

• Most importantly : Have FUN!!!

WHAT IS A CONTROL SYSTEM?

LET’S THINK ABOUT IT

• A control system can react to the outside world by sensing and actuation.

• The outputs are based on the inputs and the internal state of the system.

Control SystemInputs Outputs

THE FULL PICTURE

Environment

Sensor

Input

Control System

Actuator

Output

SENSORS

• To convert the outside signals into a form that the microcontroller can understand.

• Thermometer, barometer, magnetometer, gyroscope, accelerometer, light sensor, you name it

Outside Signal Sensor Voltage

(usually)

ACTUATOR

• To react to the outside, i.e. providing feedback

• Motor (mainly), heater, buzzer, LED, LCD

Internal Signal Actuator Feedback

STRUCTURE OF THE COURSE

• There will be two Labs

• Lab 1 will guide you through the usage of sensors ( Week 4 )

• Lab 2 will teach you actuate something based on sensor readings ( Week 8 )

• There will be no Lectures if there are Labs.

• Lab exercises are designed such that you can finish it within 2 hours. ( possibly less )

• There are bonus parts which you can complete to learn extra stuff ( and gain extra points ).

WHAT WILL YOU DO DURING THE LAB

• Finish the lab exercises and demonstrate the results to the tutors.

• Complete the lab report and hand in to the tutor before you leave

• These tasks are finished in group, so plan the flow with your partner to parallelize the operations.

• Each group will receive an intel Galileo® board next week and you can keep it till the end of the course. You will also use it for the project.

INITIALIZING THE GALILEO BOARD

POWER UP THE BOARD

Connect the board to the power adapter. You will see a LED immediately turned on indicating that the board is powered.

Power Port

This tiny little LED will turn on once you have connected the power

CONNECT TO YOUR COMPUTER

• There is another LED indicating the board is ready. After connected to the power, wait until this LED turns on. Then connect the board and the computer using the provided micro USB cable.

Connect the board to the computer via this port using the USB cable

This LED turns on when the board is ready

DETECT THE DEVICE

• Go to the device manager window in the computer. Ask someone sitting close to you or the tutor if you do not know how to get to this window.

DETECT THE DEVICE

• If you connect the board to the computer properly, you will notice there is an unknown device shown in the window.

UPDATE DRIVER

• Right click the unknown device and click “Update Driver Software…”

UPDATE DRIVER

• A window pops up and there are two options. Click the “Browse my computer for driver software” option. Leave this window alone for a while.

Click this

EXTRACTING THE PACKAGE

• Download the Arduino Program Package (a zip file) from the course website and extract the contents inside. (http://www.cse.cuhk.edu.hk/~stmak/ENGG4480/)

CONTINUE TO UPDATE THE DRIVER

• After the extraction, return to the previous driver installation window. Now, click the browse button and go to the directory:

• <your download destination>\arduino-1.5.3\hardware\arduino\x86\tools

• You may want to ask the tutor if you are not sure if the selected directory is correct or not.

• Once you are done, click “Next”. You confirm the installation no matter how many windows pop up to ask for your permission. After the installation, the device management window should be like this. Take note of the number following the device “Galileo”.

Make a note of this number

GO TO THE CODE

• Double click the file “sketch_aug07b.ino”. It should pops up a window like this. This is the Arduino environment to program the Galileo Board. Select the right port to locate the Galileo board. The port is the number you have noted down previously.

UPDATE THE FIRMWARE

• The board will not work properly until you update the firmware. In the menu bar, click the “Help” tap and then click “Firmware Update”.

CHECK THE BOARD

• It should take around 5~10 minutes to complete the update process. Once it is done, we can load a built in test program into the board to see if it works. To load the test program, in the menu bar, click the “File” tap. Then, go to “Example” and then “01.Basics”. Finally, click “Blink”.

YOU SEE THE CODE

• A new window with the test program code will pop up. Do not look into the code unless you are brave enough.

VERIFY

• There two circle buttons at the top left corner under the menu bar. The button with a tick inside is the verification button. Click this button and the program will translate the code to a set of instructions for the board to execute. If you want to know more about this process, ask the tutor.

UPLOAD

• After the verification process, click the circle button right next to it with an arrow inside. This is the upload button. By clicking this button, the previously built instructions will be transferred to the board. Go ahead and click this button.

IT BLINKS!

• Once the uploading process is completed, you will find a LED blinking. Congratulations! You finally get this board working!

You will find this LED blinking

WANT TO PLAY MORE? JOIN US NEXT TIME!