Basics of programming # Welcome to Robotic Workshop by Sunway University, School of Engineering and Technology --- # Basics of programming --- ## Contents 1. What is Programming? 2. Introduction to Computational Thinking 3. Why should I learn Programming? --- # What is Programming? --- ## What is Programming? * Some may call it Coding (interchangeable), but some may disagree... * In layman terms: > Programming allows you to "instruct" a "computer" to perform a task --- > Programming allows you to "instruct" a "computer" to perform a task ### Instruct Computers are good followers. It will do everything you provide as instructions... --- > Programming allows you to "instruct" a "computer" to perform a task ### Instruct Computers are good followers. It will do everything you provide as instructions... ...even the wrong ones... --- > Programming allows you to "instruct" a "computer" to perform a task ### Computer A computer is not just your PC or notebook. Even your smartphone, your smart TV and your fitbit are some kind of computers. --- ### Actually.... Programming is like "talking" to a computer - you want the computer to understand your words or instructions. --- ### Actually.... Programming is like "talking" to a computer - you want the computer to understand your words or instructions. and that's why we use a "programming langauge" to instruct the computers... --- ## Why do I want to instruct a computer a.k.a programming? --- ### Programming allows us to solve (complex) problems using a computer adding a few numbers may be easy to you and me, but adding a few hundred random numbers may already sound overwhelming... --- ### Programming allows us to solve (complex) problems using a computer How about creating a website to sell things online? --- ### Programming allows us to solve (complex) problems using a computer How about making a robot able to move and avoid obstacles? --- ### Programming allows us to solve (complex) problems using a computer How about teaching a computer to differentiate a dog from a cat? --- ### But it sounds difficult.... There is a technique one can use to help solving complex problem and instruct a computer accordingly... --- ## Computational Thinking Image taken from https://www.bbc.co.uk/bitesize/guides/zp92mp3/revision/1 --- ### Computational Thinking: Decomposition breaking down a complex problem or system into smaller, more manageable parts --- ### Computational Thinking: Pattern Recognition looking for similarities among and within problems --- ### Computational Thinking: Abstraction focusing on the important information only, ignoring irrelevant detail --- ### Computational Thinking: Algorithms developing a step-by-step solution to the problem, or the rules to follow to solve the problem --- ### Putting altogether Computational thinking allows us to take a complex problem, understand what the problem is and develop possible solutions. We can then present these solutions in a way that a computer, a human, or both, can understand. --- ### What can you find in a programming language? * ability to acquire data (input) * ability to do soemthing (output) * ability to repeat instructions when desired (loop) * ability to make decisions (operation) --- ### In today's workshop We will learn how to instruct a mini-computer using simple instructions you and I can pick up quickly --- ## Introducing - Arduino --- ## Arduino * Arduino is made up of both hardware and software. * The Arduino board is a printed circuit board (PCB) designed to use a microcontroller chip as well as other input and outputs. --- ## Microcontroller * You can think it as the brain of your device * it is responsible to execute the instructions you have written to complete a task * Examples will be shown later in the tutorials --- ### Programming on an Arduino device You will need to * learn some common language understood by the Arduino platform * learn to write down the instructions in the right sequence * test the written code to see whether the code works --- ### Getting prepared to program on an Arduino device * Get familiar with the Arduino IDE (Integrated Development Environment) * Understand the features of the Arduino board * Be ready to make mistakes and start all over again * Stay curious and explore! --- # Are you READY? F for fullscreen · O for overview