Lecture 7: Programming for the Arduino

Size: px
Start display at page:

Download "Lecture 7: Programming for the Arduino"

Transcription

1 Lecture 7: Programming for the Arduino - The hardware - The programming environment - Binary world, from Assembler to C - - Programming C for the Arduino: more - Programming style Lect7-Page1 The hardware Lect7-Page2 1

2 Lecture 7: Programming for the Arduino - The hardware - The programming environment - Binary world, from Assembler to C - - Programming C for the Arduino: more - Programming style Lect7-Page3 Programming environment Download software and driver from: (MAC OSX FTDI-Driver: Lect7-Page4 2

3 Lecture 7: Programming for the Arduino - The hardware - The programming environment - Binary world, from Assembler to C - - Programming C for the Arduino: more - Programming style Lect7-Page5 Binary world, programming from Assembler to C Programmable, mechanical calculation machines (19th/early 20th cent. AD) Falcon (1728) Joseph-Marie Jacquard (1805) -> punchcard looms for work steps (program) Origins at China and also developed by the mathematician Leibniz (17th century AD) Positional numeral system which represents each number just with 2 symbols, 0 and 1 These values can be represented by voltage levels in electronic circuits For human use very inefficient but with electronic circuits it is possible to create very efficient arithmetic and logic units (ALUs) for the basic operations addition, subtraction, multiplication and division See: Rembold, Ulrich et. al.: Einführung in die Informatik für Naturwissenschaftler und Ingenieure. Hanser München Wien 1991 See: Download See: See: Rembold, Ulrich et. al.: Einführung in die Informatik für Naturwissenschaftler und Ingenieure. Hanser München Wien V Lect7-Page6 3

4 Binary world, programming from Assembler to C The machine instructions Assembler mnemonic: add ax, 1000 (short Assembler ) Assembler conversion Machine code (80x86): Operation code for add to accumulator high byte low byte Binary representation of number 1000 See: Download Lect7-Page7 Binary world, programming from Assembler to C Programming paradigm of the problem oriented computer language C++/C Procedural programming with structured programming as subset Code is splitted into several, reusable sections called procedures or functions with own scopes, which can be called at given code positions Logical procedure units are combined to modules Jumps (like goto) are not allowed E.g. C Case sensitive See: Download Lect7-Page8 4

5 Binary world, programming from Assembler to C From source code to machine instructions Source code in a specific computer language Assembler mnemonic (short Assembler ) Compiler translation and optimisation conversion Assembler/Disassembler Machine code (e.g. 80x86, ) The process of compilation is unidirectional. There are several representations of a solution for a specific task in problemoriented languages which results in the same representation in machine code. On the other hand the optimisation is not ideal, so that the knowledge about the results after comiplation can improve the runtime of a program. See: Download Lect7-Page9 Binary world, programming from Assembler to C Phase Programming Creation Compiler Source codes Source codes Preprocessor/ Compilation Object codes Library codes Linking Executables Runtime Load Executables Executable libraries Upload via USB Lect7-Page10 5

6 Lecture 7: Programming for the Arduino - The hardware - The programming environment - Binary world, from Assembler to C - - Programming C for the Arduino: more - Programming style Lect7-Page11 Our first program: Blink (LED) Lect7-Page12 6

7 Memory Elements int, long, float, double, char, structures, Variables Arrays (e.g. int Ar[5];) Indexes start with 0!!! Pointers Lect7-Page13 = 1 Byte bin 0 * 2 0 = 0 * 1 = 0 dec 1 * 2 1 = 1 * 2 = 2 dec 0 * 2 2 = 0 * 4 = 0 dec 0 * 2 3 = 0 * 8 = 0 dec 1 * 2 4 = 0 * 16 = 16 dec 1 * 2 5 = 0 * 32 = 32 dec 0 * 2 6 = 0 * 64 = 0 dec 1 * 2 7 = 0 * 128 = 128 dec = 178 dec Lect7-Page14 7

8 Function has no return value true or false 1 byte character Same as byte (see byte ) 1 byte integer with a value from 0 to byte integer with a value from to byte unsigned integer with a value from 0 to Same as unsigned int (see unsigned int ) 4 byte integer with a value from to byte integer with a value from 0 to byte floating point (6 decimal digits precision) 4 byte floating point (15 decimal digits precision) e.g. char carray[128]; similar to array of any type C++ string object Array of any type See: Download Lect7-Page15 Pointer: Pointer: int *a = &a; <&a> Memory element: int a = 5; 5 Memory: Address of a Location of element in Memory (address) Lect7-Page16 8

9 Functions Functiondefinition int Add (int a, int b) { return a+b; } Functioncall X = Add (5, 6); => X=11 Lect7-Page17 Operators Standard operator: Assign =, Plus +, Minus -, Multiplication *, Division /, Modulo-Div. %, AND && (Bit-AND &) OR (Bit-OR ) NOT! Additional operators: Add one, subtract one: ++,--, (e.g. i++; is i=i+1) and a lot of others: +=, -=,, [, ], ->, *, Lect7-Page18 9

10 Comments // This is a comment /* This is also a comment */ Lect7-Page19 Interaction with users Serial write void setup() { // initialize serial communication: Serial.begin(9600); } void loop() { Serial.print( On ); // Write without new line Serial.println( Off ); // Wite with new line } AB AB AB Lect7-Page20 10

11 Application workflow Conditions if (iindex < 10) { Serial.print( A ); } else { Serial.print( B ); } Conditions switch (iindex) { case 1: Serial.print( A ); break; case 2: Serial.print( B ); break;... } Lect7-Page21 Realizing a state machine using switch condition int istate; void setup () { istate = 0; } calibration move void loop () { switch (istate) { case 0: //calibration istate = 1; break; case 1: // move just forward as long // as wall closer than 10 cm istate = 2; break; case 2:... } } Lect7-Page22 11

12 Application workflow Loops int i = 0; while (i < 10) { Serial.print(i); i = i +1; } Loops int i; for (i = 1; i < 10; i++) { Serial.print(i); } Lect7-Page23 Digital Pins Output Input Lect7-Page24 12

13 External modules (Libraries) Copy library modules to here Use module with #include < > Download from: Lect7-Page25 MAC OS X: If you are using Mac OS X, the libraries folder is hidden in the Arduino application: Right-click on Arduino.app, "Show package content", then put the library folder in "Contents/Resources/Java/hardware/libraries". Include the library using the menu in the IDE, or type #include <AFMotor.h> You are now ready to use the library. Lect7-Page26 13

14 Lecture 7: Programming for the Arduino - The hardware - The programming environment - Binary world, from Assembler to C - - Programming C for the Arduino: more - Programming style Lect7-Page27 Motordriver for DC-motors: basic functionality Motor armature Commutator Carbon brush Lect7-Page28 14

15 Motordriver for DC-motors: basic functionality Motor armature Commutator Carbon brush Rotation direction GND Lect7-Page29 Motordriver for DC-motors: basic functionality (with driver IC L293 D) Motor armature Commutator Carbon brush Lect7-Page30 15

16 Motordriver for DC-motors: basic functionality (with driver IC L293 D) Rotation direction and On/Off +/- rotate forward -/+ rotate backward +/+ or -/- stop Enable = speed (PWM) GND Lect7-Page31 Motordriver for DC-motors: Adafruit Motor/Stepper/Servo Shield for Arduino kit - v1.0 #3 #1 #4 #2 Lect7-Page32 16

17 Motordriver for DC-motors: Adafruit Motor/Stepper/Servo Shield for Arduino kit - v1.0 // Use Adafruit module #include <AFMotor.h> // create motor #2, 64KHz pwm AF_DCMotor MotorRight(2, MOTOR12_64KHZ); // set the speed MotorRight.setSpeed(50); // Move forward for (int i=0;i<500;i++) { MotorRight.run(FORWARD); } MotorRight.run(RELEASE); // switch off // similar BACKWARD // MotorRight.run(BACKWARD); setup() loop() Lect7-Page33 Motordriver for step-motors (steppers): basic functionality Inductor 1 Inductor 2 2x resistance Lect7-Page34 17

18 Motordriver for step-motors (steppers): RN-Stepp297 Power Clock pulse for steps 5V GND Rotation direction Lect7-Page35 Motordriver for step-motors (steppers): RN-Stepp297 +5V or 0V Rotation direction Clock pulse for steps (PWM) 5V GND Lect7-Page36 18

19 Motordriver for step-motors (steppers): RN-Stepp297 - programming // Use stepper module #include <Stepper.h> // Create stepper class variable Stepper StepperLeft (steps, pin_direction, pin_clockpulse); e.g. StepperLeft (200, 8, 9) StepperRight (200, 7, 10) // set the speed of the motor to 200 RPMs StepperLeft.setSpeed(200); setup() // Move one step forward StepperLeft.step(1); // Move one step backward StepperLeft.step(-1); loop() Lect7-Page37 Motordriver for step-motors (steppers): Adafruit Motor/Stepper/Servo Shield for Arduino kit - v1.0 #2 #1 Lect7-Page38 19

20 Motordriver for step-motors (steppers): Adafruit Motor/Stepper/Servo Shield for Arduino kit - v1.0 // Use Adafruit module #include <AFMotor.h> // create motor stepper #2 with 48 steps AF_Stepper StepperLeft(48, 2); // set the speed StepperLeft.setSpeed(60); StepperLeft.release(); setup() // Move forward StepperLeft.step(1, FORWARD, SINGLE); // Move backward StepperLeft.step(1, BACKWARD, SINGLE); loop() Lect7-Page39 Low Cost Ultra Sonic Range Finder 5V GND Trigger pulse and signal Lect7-Page40 20

21 Low Cost Ultra Sonic Range Finder Range = usec/58=cm or usec/148=inches. Lect7-Page41 Low Cost Ultra Sonic Range Finder e.g. int ipingpin = 13; Range = usec/58=cm or usec/148=inches. Lect7-Page42 21

22 Robot Compass Modul GND Signal (PWM) 5V PWM-signal 0.1 msec == 1 degree e.g. int icompasspin = 11; Lect7-Page43 Lecture 7: Programming for the Arduino - The hardware - The programming environment - Binary world, from Assembler to C - - Programming C for the Arduino: more - Programming style Lect7-Page44 22

23 Programming style See: Download Lect7-Page45 Programming style Try to write readable and efficient code: - Add comments to explain the code - Use understandable (variable, function) names - Structure the code into logical units - Initialize variables - Search for existing code first - Lect7-Page46 23

24 And for help look at: Programming style Lect7-Page47 The goal! 30cm X 30cm Stop the robot: while (1==1) {} Thank you Lect7-Page48 24

Programming the Arduino

Programming the Arduino Summer University 2015: Programming the Arduino Alexander Neidhardt (FESG) neidhardt@fs.wettzell.de SU-Arduino-Prog-Page1 Programming the Arduino - The hardware - The programming environment - Binary world,

More information

PROGRAMMING WITH ARDUINO - 1

PROGRAMMING WITH ARDUINO - 1 PROGRAMMING WITH ARDUINO - 1 IESL RoboGames 2014 University of Moratuwa Department of Computer Science & Engineering Table of Contents Introduction... 2 Arduino Development Board... 2 How to Setup Arduino

More information

The programming language C. sws1 1

The programming language C. sws1 1 The programming language C sws1 1 The programming language C invented by Dennis Ritchie in early 1970s who used it to write the first Hello World program C was used to write UNIX Standardised as K&C (Kernighan

More information

Embedded Systems. Review of ANSI C Topics. A Review of ANSI C and Considerations for Embedded C Programming. Basic features of C

Embedded Systems. Review of ANSI C Topics. A Review of ANSI C and Considerations for Embedded C Programming. Basic features of C Embedded Systems A Review of ANSI C and Considerations for Embedded C Programming Dr. Jeff Jackson Lecture 2-1 Review of ANSI C Topics Basic features of C C fundamentals Basic data types Expressions Selection

More information

8.1 Goal of this assignment Results Primer Assignment... 62

8.1 Goal of this assignment Results Primer Assignment... 62 CHAPTER 8 Lab 8: Arduino Contents 8.1 Goal of this assignment........................... 61 8.2 Results.................................... 61 8.3 Primer.................................... 62 8.4 Assignment..................................

More information

Linksprite Arduino Motorshield. Introduction

Linksprite Arduino Motorshield. Introduction Linksprite Arduino Motorshield Introduction The Motor Shield is a perfect platform for robotics and mechanical applications. It enables the Arduino to drive two brushed DC motors or one 4-wire two-phase

More information

Arduino Motor Shield (L298) Manual

Arduino Motor Shield (L298) Manual Arduino Motor Shield (L298) Manual This DFRobot L298 DC motor driver shield uses LG high power H-bridge driver Chip L298P, which is able to drive DC motor, two-phase or four phase stepper motor with a

More information

Chapter 2: Problem Solving Using C++

Chapter 2: Problem Solving Using C++ Chapter 2: Problem Solving Using C++ 1 Objectives In this chapter, you will learn about: Modular programs Programming style Data types Arithmetic operations Variables and declaration statements Common

More information

Arduino Programming Part 2

Arduino Programming Part 2 Arduino Programming Part 2 EAS 199A Lecture 6 Fall 2011 Overview Variable types int float Loops for loops while loops (another day) 2 Arduino web site Assigning and Using Variables http://arduino.cc/en/reference/homepage

More information

Servo Info and Centering

Servo Info and Centering Info and Centering A servo is a mechanical motorized device that can be instructed to move the output shaft attached to a servo wheel or arm to a specified position. Inside the servo box is a DC motor

More information

Arduino Programming Part 1

Arduino Programming Part 1 Arduino Programming Part 1 EAS 199A, Fall 2010, Lecture 5 Gerald Recktenwald Portland State University gerry@me.pdx.edu Overview Discuss details, now that you had a taste Arduino Environment Basic code

More information

Arduino Lesson 5. The Serial Monitor

Arduino Lesson 5. The Serial Monitor Arduino Lesson 5. The Serial Monitor Created by Simon Monk Last updated on 2013-06-22 08:00:27 PM EDT Guide Contents Guide Contents Overview The Serial Monitor Arduino Code Other Things to Do 2 3 4 7 10

More information

Sources: On the Web: Slides will be available on:

Sources: On the Web: Slides will be available on: C programming Introduction The basics of algorithms Structure of a C code, compilation step Constant, variable type, variable scope Expression and operators: assignment, arithmetic operators, comparison,

More information

C Programming. for Embedded Microcontrollers. Warwick A. Smith. Postbus 11. Elektor International Media BV. 6114ZG Susteren The Netherlands

C Programming. for Embedded Microcontrollers. Warwick A. Smith. Postbus 11. Elektor International Media BV. 6114ZG Susteren The Netherlands C Programming for Embedded Microcontrollers Warwick A. Smith Elektor International Media BV Postbus 11 6114ZG Susteren The Netherlands 3 the Table of Contents Introduction 11 Target Audience 11 What is

More information

Lab 6 Introduction to Serial and Wireless Communication

Lab 6 Introduction to Serial and Wireless Communication University of Pennsylvania Department of Electrical and Systems Engineering ESE 111 Intro to Elec/Comp/Sys Engineering Lab 6 Introduction to Serial and Wireless Communication Introduction: Up to this point,

More information

Microcontroller Programming Beginning with Arduino. Charlie Mooney

Microcontroller Programming Beginning with Arduino. Charlie Mooney Microcontroller Programming Beginning with Arduino Charlie Mooney Microcontrollers Tiny, self contained computers in an IC Often contain peripherals Different packages availible Vast array of size and

More information

DS1307 Real Time Clock Breakout Board Kit

DS1307 Real Time Clock Breakout Board Kit DS1307 Real Time Clock Breakout Board Kit Created by Tyler Cooper Last updated on 2015-10-15 11:00:14 AM EDT Guide Contents Guide Contents Overview What is an RTC? Parts List Assembly Arduino Library Wiring

More information

CS 16: Assembly Language Programming for the IBM PC and Compatibles

CS 16: Assembly Language Programming for the IBM PC and Compatibles CS 16: Assembly Language Programming for the IBM PC and Compatibles First, a little about you Your name Have you ever worked with/used/played with assembly language? If so, talk about it Why are you taking

More information

Experiment #3 Programming the PLC Via Ladder logic. OBJECTIVES After successfully completing this laboratory, you should be able to:

Experiment #3 Programming the PLC Via Ladder logic. OBJECTIVES After successfully completing this laboratory, you should be able to: Experiment #3 Programming the PLC Via Ladder logic OBJECTIVES After successfully completing this laboratory, you should be able to: to convert a simple electrical ladder diagram to a PLC program. Know

More information

Adafruit TB A DC/Stepper Motor Driver Breakout Board

Adafruit TB A DC/Stepper Motor Driver Breakout Board Adafruit TB6612 1.2A DC/Stepper Motor Driver Breakout Board Created by lady ada Last updated on 2016-04-25 04:38:57 PM EDT Guide Contents Guide Contents Overview Pinouts Power Pins Signal in Pins Motor

More information

Basic Pulse Width Modulation

Basic Pulse Width Modulation EAS 199 Fall 211 Basic Pulse Width Modulation Gerald Recktenwald v: September 16, 211 gerry@me.pdx.edu 1 Basic PWM Properties Pulse Width Modulation or PWM is a technique for supplying electrical power

More information

Arduino and PLC Communication

Arduino and PLC Communication Arduino and PLC Communication Designed and written by: Jason Eddrief 1 Table of Contents System Introduction... 3 Communication Protocol... 5 Arduino... 6 Sending Data:... 6 Receiving Data:... 7 Communicating:...

More information

Arduino Lesson 16. Stepper Motors

Arduino Lesson 16. Stepper Motors Arduino Lesson 16. Stepper Motors Created by Simon Monk Last updated on 2013-11-22 07:45:14 AM EST Guide Contents Guide Contents Overview Parts Part Qty Breadboard Layout Arduino Code Stepper Motors Other

More information

Project 1: Introduction to Arduino and LED Blink (Sketch Version) Description:

Project 1: Introduction to Arduino and LED Blink (Sketch Version) Description: Project 1: Introduction to Arduino and LED Blink (Sketch Version) Description: The Arduino is a microprocessor. A Microprocessor is a compact programmable computing device with memory, processing, input,

More information

Theory and Practice of Tangible User Interfaces. Thursday Week 2: Digital Input and Output. week. Digital Input and Output. RGB LEDs fade with PWM

Theory and Practice of Tangible User Interfaces. Thursday Week 2: Digital Input and Output. week. Digital Input and Output. RGB LEDs fade with PWM week 02 Digital Input and Output RGB LEDs fade with PWM 1 Microcontrollers Output Transducers actuators (e.g., motors, buzzers) Arduino Input Transducers sensors (e.g., switches, levers, sliders, etc.)

More information

cs281: Introduction to Computer Systems Lab08 Interrupt Handling and Stepper Motor Controller

cs281: Introduction to Computer Systems Lab08 Interrupt Handling and Stepper Motor Controller cs281: Introduction to Computer Systems Lab08 Interrupt Handling and Stepper Motor Controller Overview The objective of this lab is to introduce ourselves to the Arduino interrupt capabilities and to use

More information

2.2.9 LDR (Light Dependent Resistor) 25 2.2.10 Transistors 25

2.2.9 LDR (Light Dependent Resistor) 25 2.2.10 Transistors 25 :» : :.:35152, 2013 2 5 1: 6 1.1 6 1.2 7 1.3 7 1.4 7 1.5 8 1.6 8 1.7 10 1.8 11 1.9 11 2: 14 2.1 14 2.2 14 2.2.1 14 2.2.2 16 2.2.3 19 2.2.4 20 2.2.5 21 2.2.6 Reed Relay 23 2.2.7 LCD 2x16 5VDC 23 2.2.8 RGB

More information

SIT102 Introduction to Programming

SIT102 Introduction to Programming SIT102 Introduction to Programming After working through this session you should: Understand the relationships between operating systems, their user interfaces, and programs; Understand the difference

More information

GM862 Arduino Shield

GM862 Arduino Shield User s Manual GM862 Arduino Shield Rev. 1.3 MCI-MA-0063 MCI Electronics Luis Thayer Ojeda 0115. Of. 402 Santiago, Chile Tel. +56 2 3339579 info@olimex.cl MCI Ltda. Luis Thayer Ojeda 0115. Of. 402 Santiago,

More information

Embedded Programming in C/C++: Lesson-1: Programming Elements and Programming in C

Embedded Programming in C/C++: Lesson-1: Programming Elements and Programming in C Embedded Programming in C/C++: Lesson-1: Programming Elements and Programming in C 1 An essential part of any embedded system design Programming 2 Programming in Assembly or HLL Processor and memory-sensitive

More information

Outline. hardware components programming environments. installing Python executing Python code. decimal and binary notations running Sage

Outline. hardware components programming environments. installing Python executing Python code. decimal and binary notations running Sage Outline 1 Computer Architecture hardware components programming environments 2 Getting Started with Python installing Python executing Python code 3 Number Systems decimal and binary notations running

More information

2011, The McGraw-Hill Companies, Inc. Chapter 3

2011, The McGraw-Hill Companies, Inc. Chapter 3 Chapter 3 3.1 Decimal System The radix or base of a number system determines the total number of different symbols or digits used by that system. The decimal system has a base of 10 with the digits 0 through

More information

Chapter 8. Arithmetic in C++

Chapter 8. Arithmetic in C++ Christian Jacob Chapter 8 Arithmetic in C++ 8.1 The C++ Vocabulary 8.2 Variables and Types 8.2.1 Data Objects 8.2.2 Variables 8.2.3 Declaration of Variables 8.3 Elementary C++ Data Types 8.3.1 Integers

More information

Arduino Microcontroller Guide W. Durfee, University of Minnesota ver. oct-2011 Available on-line at www.me.umn.edu/courses/me2011/arduino/

Arduino Microcontroller Guide W. Durfee, University of Minnesota ver. oct-2011 Available on-line at www.me.umn.edu/courses/me2011/arduino/ Arduino Microcontroller Guide W. Durfee, University of Minnesota ver. oct-2011 Available on-line at www.me.umn.edu/courses/me2011/arduino/ 1 Introduction 1.1 Overview The Arduino microcontroller is an

More information

C Programming Dr. Hasan Demirel

C Programming Dr. Hasan Demirel C How to Program, H. M. Deitel and P. J. Deitel, Prentice Hall, 5 th edition (3 rd edition or above is also OK). Introduction to C Programming Dr. Hasan Demirel Programming Languages There are three types

More information

Objective Type Questions

Objective Type Questions Objective Type Questions Unit- Introduction to computer and programming: Sr.No. Multiple Choice Question Paper Marks Which of the following is a part of primary memory of computer a) PROM b) CD-ROM c)

More information

Data Storage: Each time you create a variable in memory, a certain amount of memory is allocated for that variable based on its data type (or class).

Data Storage: Each time you create a variable in memory, a certain amount of memory is allocated for that variable based on its data type (or class). Data Storage: Computers are made of many small parts, including transistors, capacitors, resistors, magnetic materials, etc. Somehow they have to store information in these materials both temporarily (RAM,

More information

C++ Programming Language

C++ Programming Language C++ Programming Language Lecturer: Yuri Nefedov 7th and 8th semesters Lectures: 34 hours (7th semester); 32 hours (8th semester). Seminars: 34 hours (7th semester); 32 hours (8th semester). Course abstract

More information

MeshBee Open Source ZigBee RF Module CookBook

MeshBee Open Source ZigBee RF Module CookBook MeshBee Open Source ZigBee RF Module CookBook 2014 Seeed Technology Inc. www.seeedstudio.com 1 Doc Version Date Author Remark v0.1 2014/05/07 Created 2 Table of contents Table of contents Chapter 1: Getting

More information

Lecture 03 Bits, Bytes and Data Types

Lecture 03 Bits, Bytes and Data Types Lecture 03 Bits, Bytes and Data Types In this lecture Computer Languages Assembly Language The compiler Operating system Data and program instructions Bits, Bytes and Data Types ASCII table Data Types

More information

A First Book of C++ Chapter 2 Data Types, Declarations, and Displays

A First Book of C++ Chapter 2 Data Types, Declarations, and Displays A First Book of C++ Chapter 2 Data Types, Declarations, and Displays Objectives In this chapter, you will learn about: Data Types Arithmetic Operators Variables and Declarations Common Programming Errors

More information

Using Arduino Microcontrollers to Sense DC Motor Speed and Position

Using Arduino Microcontrollers to Sense DC Motor Speed and Position ECE480 Design Team 3 Using Arduino Microcontrollers to Sense DC Motor Speed and Position Tom Manner April 4, 2011 page 1 of 7 Table of Contents 1. Introduction ----------------------------------------------------------

More information

Eric Mitchell April 2, 2012 Application Note: Control of a 180 Servo Motor with Arduino UNO Development Board

Eric Mitchell April 2, 2012 Application Note: Control of a 180 Servo Motor with Arduino UNO Development Board Eric Mitchell April 2, 2012 Application Note: Control of a 180 Servo Motor with Arduino UNO Development Board Abstract This application note is a tutorial of how to use an Arduino UNO microcontroller to

More information

C What Happens INTRODUCTION PIC MICROCONTROLLER PRODUCT OVERVIEW SELECTING A DEVICE FOR EXPERIMENTS PIC16F818

C What Happens INTRODUCTION PIC MICROCONTROLLER PRODUCT OVERVIEW SELECTING A DEVICE FOR EXPERIMENTS PIC16F818 C What Happens INTRODUCTION PIC MICROCONTROLLER PRODUCT OVERVIEW SELECTING A DEVICE FOR EXPERIMENTS PIC16F818 Pins and functions Package Clock oscillator Reset Ports Special Features PIC microcontroller

More information

198:211 Computer Architecture

198:211 Computer Architecture 198:211 Computer Architecture Topics: Lecture 8 (W5) Fall 2012 Data representation 2.1 and 2.2 of the book Floating point 2.4 of the book 1 Computer Architecture What do computers do? Manipulate stored

More information

HI-TECH C SETUP GUIDE. Hi-Tech C - Setup Guide..

HI-TECH C SETUP GUIDE. Hi-Tech C - Setup Guide.. Hi-Tech C - Setup Guide.. 1. Introduction and overview The HI-TECH C Compiler for PIC10/12/16 MCUs (Lite mode) is a freeware compiler. It supports all PIC10, PIC12 and PIC16 series devices. The features

More information

MODULE BOUSSOLE ÉLECTRONIQUE CMPS03 Référence : 0660-3

MODULE BOUSSOLE ÉLECTRONIQUE CMPS03 Référence : 0660-3 MODULE BOUSSOLE ÉLECTRONIQUE CMPS03 Référence : 0660-3 CMPS03 Magnetic Compass. Voltage : 5v only required Current : 20mA Typ. Resolution : 0.1 Degree Accuracy : 3-4 degrees approx. after calibration Output

More information

CPU Organization and Assembly Language

CPU Organization and Assembly Language COS 140 Foundations of Computer Science School of Computing and Information Science University of Maine October 2, 2015 Outline 1 2 3 4 5 6 7 8 Homework and announcements Reading: Chapter 12 Homework:

More information

Speed Control Tutorial

Speed Control Tutorial UG108: Praxis II January 2013 Asian Institute of Technology Undergraduate Program Handout: Speed control Instructor: Chaiyaporn Silawatchananai, Matthew N. Dailey Speed Control Tutorial Introduction: Speed

More information

Writing Portable Programs COS 217

Writing Portable Programs COS 217 Writing Portable Programs COS 217 1 Goals of Today s Class Writing portable programs in C Sources of heterogeneity Data types, evaluation order, byte order, char set, Reading period and final exam Important

More information

Arduino-Based Dataloggers: Hardware and Software David R. Brooks Institute for Earth Science Research and Education V 1.2, June, 2015 2014, 2015

Arduino-Based Dataloggers: Hardware and Software David R. Brooks Institute for Earth Science Research and Education V 1.2, June, 2015 2014, 2015 Arduino-Based Dataloggers: Hardware and Software David R. Brooks Institute for Earth Science Research and Education V 1.2, June, 2015 2014, 2015 An introduction to Arduino microcontrollers and their programming

More information

Installing Java (Windows) and Writing your First Program

Installing Java (Windows) and Writing your First Program Appendix Installing Java (Windows) and Writing your First Program We will be running Java from the command line and writing Java code in Notepad++ (or similar). The first step is to ensure you have installed

More information

Informatica e Sistemi in Tempo Reale

Informatica e Sistemi in Tempo Reale Informatica e Sistemi in Tempo Reale Introduction to C programming Giuseppe Lipari http://retis.sssup.it/~lipari Scuola Superiore Sant Anna Pisa October 25, 2010 G. Lipari (Scuola Superiore Sant Anna)

More information

ASSEMBLY PROGRAMMING ON A VIRTUAL COMPUTER

ASSEMBLY PROGRAMMING ON A VIRTUAL COMPUTER ASSEMBLY PROGRAMMING ON A VIRTUAL COMPUTER Pierre A. von Kaenel Mathematics and Computer Science Department Skidmore College Saratoga Springs, NY 12866 (518) 580-5292 pvonk@skidmore.edu ABSTRACT This paper

More information

MECH 423 Mechatronic Product Design Spring 2016 Lab #2: MSP430 Microprocessor Programming

MECH 423 Mechatronic Product Design Spring 2016 Lab #2: MSP430 Microprocessor Programming MECH 423 Mechatronic Product Design Spring 2016 Lab #2: MSP430 Microprocessor Programming Objectives This lab consists in a set of exercises designed to teach you the basics of microprocessor programming

More information

Bluetooth + USB 16 Servo Controller [RKI-1005 & RKI-1205]

Bluetooth + USB 16 Servo Controller [RKI-1005 & RKI-1205] Bluetooth + USB 16 Servo Controller [RKI-1005 & RKI-1205] Users Manual Robokits India info@robokits.co.in http://www.robokitsworld.com Page 1 Bluetooth + USB 16 Servo Controller is used to control up to

More information

The Answer to the 14 Most Frequently Asked Modbus Questions

The Answer to the 14 Most Frequently Asked Modbus Questions Modbus Frequently Asked Questions WP-34-REV0-0609-1/7 The Answer to the 14 Most Frequently Asked Modbus Questions Exactly what is Modbus? Modbus is an open serial communications protocol widely used in

More information

Topics. Introduction. Java History CS 146. Introduction to Programming and Algorithms Module 1. Module Objectives

Topics. Introduction. Java History CS 146. Introduction to Programming and Algorithms Module 1. Module Objectives Introduction to Programming and Algorithms Module 1 CS 146 Sam Houston State University Dr. Tim McGuire Module Objectives To understand: the necessity of programming, differences between hardware and software,

More information

Electronic Brick of Current Sensor

Electronic Brick of Current Sensor Electronic Brick of Current Sensor Overview What is an electronic brick? An electronic brick is an electronic module which can be assembled like Lego bricks simply by plugging in and pulling out. Compared

More information

The C Programming Language course syllabus associate level

The C Programming Language course syllabus associate level TECHNOLOGIES The C Programming Language course syllabus associate level Course description The course fully covers the basics of programming in the C programming language and demonstrates fundamental programming

More information

Pololu DRV8835 Dual Motor Driver Shield for Arduino

Pololu DRV8835 Dual Motor Driver Shield for Arduino Pololu DRV8835 Dual Motor Driver Shield for Arduino Pololu DRV8835 Dual Motor Driver Shield for Arduino, bottom view with dimensions. Overview This motor driver shield and its corresponding Arduino library

More information

Arduino Lesson 13. DC Motors. Created by Simon Monk

Arduino Lesson 13. DC Motors. Created by Simon Monk Arduino Lesson 13. DC Motors Created by Simon Monk Guide Contents Guide Contents Overview Parts Part Qty Breadboard Layout Arduino Code Transistors Other Things to Do 2 3 4 4 4 6 7 9 11 Adafruit Industries

More information

Chapter 7D The Java Virtual Machine

Chapter 7D The Java Virtual Machine This sub chapter discusses another architecture, that of the JVM (Java Virtual Machine). In general, a VM (Virtual Machine) is a hypothetical machine (implemented in either hardware or software) that directly

More information

PowerBox PBX 180. Installation and Users Guide

PowerBox PBX 180. Installation and Users Guide PowerBox PBX 180 Installation and Users Guide Firmware and Tool Version 060 7/14/2015 Table of Contents Table of Contents 1 Introduction... 4 2 Hardware... 6 3 Software Installation... 7 3.1 Software Installation

More information

Freescale Semiconductor, I

Freescale Semiconductor, I nc. Application Note 6/2002 8-Bit Software Development Kit By Jiri Ryba Introduction 8-Bit SDK Overview This application note describes the features and advantages of the 8-bit SDK (software development

More information

Arduino Lesson 1. Blink

Arduino Lesson 1. Blink Arduino Lesson 1. Blink Created by Simon Monk Last updated on 2015-01-15 09:45:38 PM EST Guide Contents Guide Contents Overview Parts Part Qty The 'L' LED Loading the 'Blink' Example Saving a Copy of 'Blink'

More information

Software Manual RS232 Laser Merge Module. Document # SU-256521-09 Rev A

Software Manual RS232 Laser Merge Module. Document # SU-256521-09 Rev A Laser Merge Module Document # SU-256521-09 Rev A The information presented in this document is proprietary to Spectral Applied Research Inc. and cannot be used for any purpose other than that for which

More information

How to program a Zumo Robot with Simulink

How to program a Zumo Robot with Simulink How to program a Zumo Robot with Simulink Created by Anuja Apte Last updated on 2015-03-13 11:15:06 AM EDT Guide Contents Guide Contents Overview Hardware Software List of Software components: Simulink

More information

S7-1200 and STEP 7 Basic V10.5

S7-1200 and STEP 7 Basic V10.5 S7-1200 and STEP 7 Basic V10.5 S7-200 vs. S7-1200 Expandability S7-200 S7-1200 max. 7 Modules max. 3 Modules (CM) max. 8 Modules (SM) Page 2 Advantages of S7-1200, compared to S7-200 I/O Internal periphery

More information

Fast and Effective Embedded Systems Design

Fast and Effective Embedded Systems Design Fast and Effective Embedded Systems Design Applying the ARM mbed Rob Toulson Tim Wilmshurst AMSTERDAM BOSTON HEIDELBERG LONDON NEW YORK OXFORD чч*?? &Ш& PARIS SAN DIEGO SAN FRANCISCO SINGAPORE SYDNEY TOKYO

More information

#include Gamer gamer; void setup() { gamer.begin(); } void loop() {

#include <Gamer.h> Gamer gamer; void setup() { gamer.begin(); } void loop() { #include Gamer gamer; void setup() { gamer.begin(); void loop() { Gamer Keywords Inputs Board Pin Out Library Instead of trying to find out which input is plugged into which pin, you can use

More information

Programmable Logic Controllers Definition. Programmable Logic Controllers History

Programmable Logic Controllers Definition. Programmable Logic Controllers History Definition A digitally operated electronic apparatus which uses a programmable memory for the internal storage of instructions for implementing specific functions such as logic, sequencing, timing, counting,

More information

Table 1 Comparison of DC, Uni-Polar and Bi-polar Stepper Motors

Table 1 Comparison of DC, Uni-Polar and Bi-polar Stepper Motors Electronics Exercise 3: Uni-Polar Stepper Motor Controller / Driver Mechatronics Instructional Laboratory Woodruff School of Mechanical Engineering Georgia Institute of Technology Lab Director: I. Charles

More information

The elabtronics USB PORT Module: 2 in 1 PIC Programmer Controller

The elabtronics USB PORT Module: 2 in 1 PIC Programmer Controller The elabtronics USB PORT Module: 2 in 1 PIC Programmer Controller The compact USB PORT Module from elabtronics can be used as a PIC programmer and a controller. It programs user PIC projects using the

More information

Arduino Internet Connectivity: Maintenance Manual Julian Ryan Draft No. 7 April 24, 2015

Arduino Internet Connectivity: Maintenance Manual Julian Ryan Draft No. 7 April 24, 2015 Arduino Internet Connectivity: Maintenance Manual Julian Ryan Draft No. 7 April 24, 2015 CEN 4935 Senior Software Engineering Project Instructor: Dr. Janusz Zalewski Software Engineering Program Florida

More information

ZX-NUNCHUK (#8000339)

ZX-NUNCHUK (#8000339) ZX-NUNCHUK documentation 1 ZX-NUNCHUK (#8000339) Wii-Nunchuk interface board 1. Features l Interface with Wii Nunchuk remote control directly. Modification the remote control is not required. l Two-wire

More information

IR Communication a learn.sparkfun.com tutorial

IR Communication a learn.sparkfun.com tutorial IR Communication a learn.sparkfun.com tutorial Available online at: http://sfe.io/t33 Contents Getting Started IR Communication Basics Hardware Setup Receiving IR Example Transmitting IR Example Resources

More information

SKP16C62P Tutorial 1 Software Development Process using HEW. Renesas Technology America Inc.

SKP16C62P Tutorial 1 Software Development Process using HEW. Renesas Technology America Inc. SKP16C62P Tutorial 1 Software Development Process using HEW Renesas Technology America Inc. 1 Overview The following tutorial is a brief introduction on how to develop and debug programs using HEW (Highperformance

More information

DELLORTO. Instructions Manual. Deuss Service Tool For ECS System ECU. Dell Orto Deuss Service Tool instruction manual Page 1 of 11.

DELLORTO. Instructions Manual. Deuss Service Tool For ECS System ECU. Dell Orto Deuss Service Tool instruction manual Page 1 of 11. DELLORTO Deuss Service Tool For ECS System ECU Instructions Manual Dell Orto Deuss Service Tool instruction manual Page 1 of 11 Revision History Level Date Author Change Description and section(s) affected

More information

FTC 2015-2016 Android Based Control System

FTC 2015-2016 Android Based Control System FTC 2015-2016 Android Based Control System Agenda Control System Overview Phone Setup Generating the Robot configuration file Software Overview Autonomous vs Tele-op templates Motor/servo control Sensor

More information

INTRODUCTION TO SERIAL ARM

INTRODUCTION TO SERIAL ARM INTRODUCTION TO SERIAL ARM A robot manipulator consists of links connected by joints. The links of the manipulator can be considered to form a kinematic chain. The business end of the kinematic chain of

More information

Decimal Numbers: Base 10 Integer Numbers & Arithmetic

Decimal Numbers: Base 10 Integer Numbers & Arithmetic Decimal Numbers: Base 10 Integer Numbers & Arithmetic Digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Example: 3271 = (3x10 3 ) + (2x10 2 ) + (7x10 1 )+(1x10 0 ) Ward 1 Ward 2 Numbers: positional notation Number

More information

3 SOFTWARE AND PROGRAMMING LANGUAGES

3 SOFTWARE AND PROGRAMMING LANGUAGES 3 SOFTWARE AND PROGRAMMING LANGUAGES 3.1 INTRODUCTION In the previous lesson we discussed about the different parts and configurations of computer. It has been mentioned that programs or instructions have

More information

TECHNOLOGY Computer Programming II Grade: 9-12 Standard 2: Technology and Society Interaction

TECHNOLOGY Computer Programming II Grade: 9-12 Standard 2: Technology and Society Interaction Standard 2: Technology and Society Interaction Technology and Ethics Analyze legal technology issues and formulate solutions and strategies that foster responsible technology usage. 1. Practice responsible

More information

Pemrograman Dasar. Basic Elements Of Java

Pemrograman Dasar. Basic Elements Of Java Pemrograman Dasar Basic Elements Of Java Compiling and Running a Java Application 2 Portable Java Application 3 Java Platform Platform: hardware or software environment in which a program runs. Oracle

More information

Object Oriented Software Design

Object Oriented Software Design Object Oriented Software Design Introduction to Java - II Giuseppe Lipari http://retis.sssup.it/~lipari Scuola Superiore Sant Anna Pisa October 28, 2010 G. Lipari (Scuola Superiore Sant Anna) Introduction

More information

MICHIGAN STATE UNIVERSITY COLLEGE OF ENGINEERING. Embedded C on a PIC. Programming a Pulse Width Modulation on a PIC18F4520. Merav Nahoom 11/13/2009

MICHIGAN STATE UNIVERSITY COLLEGE OF ENGINEERING. Embedded C on a PIC. Programming a Pulse Width Modulation on a PIC18F4520. Merav Nahoom 11/13/2009 MICHIGAN STATE UNIVERSITY COLLEGE OF ENGINEERING Embedded C on a PIC Programming a Pulse Width Modulation on a PIC18F4520 Merav Nahoom 11/13/2009 Pulse Width Modulation (PWM) is the most effective mean

More information

1. Constants. 2. Variables. 3. Reserved words or key words. 4. Constants. Character set in C

1. Constants. 2. Variables. 3. Reserved words or key words. 4. Constants. Character set in C Character set in C We should use only the following characters in writing a C program. These characters can be combined to create C words. Alphabet: A, B, C, D.. Z, a, b, c, d..z Numeric digits: 0, 1,

More information

Department of Electrical and Computer Engineering Faculty of Engineering and Architecture American University of Beirut Course Information

Department of Electrical and Computer Engineering Faculty of Engineering and Architecture American University of Beirut Course Information Department of Electrical and Computer Engineering Faculty of Engineering and Architecture American University of Beirut Course Information Course title: Computer Organization Course number: EECE 321 Catalog

More information

Arduino Lesson 14. Servo Motors

Arduino Lesson 14. Servo Motors Arduino Lesson 14. Servo Motors Created by Simon Monk Last updated on 2013-06-11 08:16:06 PM EDT Guide Contents Guide Contents Overview Parts Part Qty The Breadboard Layout for 'Sweep' If the Servo Misbehaves

More information

Modern Robotics, Inc Core Device Discovery Utility. Modern Robotics Inc, 2015

Modern Robotics, Inc Core Device Discovery Utility. Modern Robotics Inc, 2015 Modern Robotics, Inc Core Device Discovery Utility Modern Robotics Inc, 2015 Version 1.0.1 October 27, 2015 Core Device Discovery Application Guide The Core Device Discovery utility allows you to retrieve

More information

Candle Plant process automation based on ABB 800xA Distributed Control Systems

Candle Plant process automation based on ABB 800xA Distributed Control Systems Candle Plant process automation based on ABB 800xA Distributed Control Systems Yousef Iskandarani and Karina Nohammer Department of Engineering University of Agder Jon Lilletuns vei 9, 4879 Grimstad Norway

More information

MDSR Additional Feature released with V2.4 Software. AFC: Arduino Frequency Counter V1.0. Introduction. Arduino Frequency Counter Windows Software:

MDSR Additional Feature released with V2.4 Software. AFC: Arduino Frequency Counter V1.0. Introduction. Arduino Frequency Counter Windows Software: MDSR Additional Feature released with V2.4 Software Alex Schwarz VE7DXW alexschwarz@telus.net Guy Roels ON6MU guy.on6mu@skynet.be Website: http://users.skynet.be/myspace/mdsr AFC: Arduino Frequency Counter

More information

Application Note: AN00141 xcore-xa - Application Development

Application Note: AN00141 xcore-xa - Application Development Application Note: AN00141 xcore-xa - Application Development This application note shows how to create a simple example which targets the XMOS xcore-xa device and demonstrates how to build and run this

More information

RB-See-211. Seeedstudio Grove 6-15V, 2A Dual I2C Motor Driver. Grove - I2C Motor Driver. Introduction

RB-See-211. Seeedstudio Grove 6-15V, 2A Dual I2C Motor Driver. Grove - I2C Motor Driver. Introduction RB-See-211 Seeedstudio Grove 6-15V, 2A Dual I2C Motor Driver Grove - I2C Motor Driver Introduction The Twig I2C motor driver is a new addition to the TWIG series with the same easy-to-use interface. Its

More information

An Introduction to MPLAB Integrated Development Environment

An Introduction to MPLAB Integrated Development Environment An Introduction to MPLAB Integrated Development Environment 2004 Microchip Technology Incorporated An introduction to MPLAB Integrated Development Environment Slide 1 This seminar is an introduction to

More information

Compilers. Introduction to Compilers. Lecture 1. Spring term. Mick O Donnell: michael.odonnell@uam.es Alfonso Ortega: alfonso.ortega@uam.

Compilers. Introduction to Compilers. Lecture 1. Spring term. Mick O Donnell: michael.odonnell@uam.es Alfonso Ortega: alfonso.ortega@uam. Compilers Spring term Mick O Donnell: michael.odonnell@uam.es Alfonso Ortega: alfonso.ortega@uam.es Lecture 1 to Compilers 1 Topic 1: What is a Compiler? 3 What is a Compiler? A compiler is a computer

More information

Faculty of Engineering Student Number:

Faculty of Engineering Student Number: Philadelphia University Student Name: Faculty of Engineering Student Number: Dept. of Computer Engineering Final Exam, First Semester: 2012/2013 Course Title: Microprocessors Date: 17/01//2013 Course No:

More information

Adafruit DS3231 Precision RTC Breakout

Adafruit DS3231 Precision RTC Breakout Adafruit DS3231 Precision RTC Breakout Created by lady ada Last updated on 2016-09-13 04:42:12 PM UTC Guide Contents Guide Contents Overview Pinouts Power Pins: I2C Logic pins: Other Pins: Assembly Prepare

More information