Practical Electronics & Programming

Slides:



Advertisements
Similar presentations
ARDUINO FRAMEWORK.
Advertisements

What is a pointer? First of all, it is a variable, just like other variables you studied So it has type, storage etc. Difference: it can only store the.
ECE Application Programming Instructor: Dr. Michael Geiger Spring 2012 Lecture 31: PE5.
What is Arduino?  Arduino is a ATMEL 168 micro-controller kit designed specially for small projects  User friendly IDE(Integrated Development Environment)
Introduction to C++ Programming. A Simple Program: Print a Line of Text // My First C++ Program #include int main( ) { cout
PING))) Ultrasonic Distance Sensor living with the lab ultrasonic pressure waves from PING))) speaker The PING))) sensor emits short bursts of sound and.
©2004 Brooks/Cole Chapter 8 Arrays. Figures ©2004 Brooks/Cole CS 119: Intro to JavaFall 2005 Sometimes we have lists of data values that all need to be.
Screen Display Module M15.2 Sections 9.5, 13.1, 13.2.
Embedded Programming and Robotics Lesson 9 Keypad and LCD Display 1.
1 Ultrasonic Distance Sensor. 2 How it Works The distance sensor emits short bursts of sound and listens for this sound to echo off of nearby objects.
PROGRAMMING WITH ARDUINO. Arduino An open-source hardware platform based on an Atmel AVR 8-bit microcontroller and a C++ based IDE Over boards.
Autumn, 2013C.-S. Shieh, EC, KUAS, Taiwan1 智慧電子應用設計導論 (1/3) Display Chin-Shiuh Shieh ( 謝欽旭 ) Department of Electronic Engineering.
Parallax 4x20 LCD (part number 27979) with Arduino Duemilanove
Digital Outputs LCD Display
Sensors Material taken from Robotics with the Boe-Bot.
PING))) Ultrasonic Distance Sensor living with the lab ultrasonic pressure waves from PING))) speaker The PING))) sensor emits short bursts of sound and.
Recursion Examples Fundamentals of CS Case 1: Code /* Recursion: Case 1 */ #include void count (int index); main () { count (0); getchar(); } void count.
C Static Arrays Pepper. What is an array? Memory locations – same type – next to each other (contiguous) – Same name – Indexed by position number of type.
Franz Duran INTRODUCTION TO A RDUINO PROGRAMMING & INTERFACING Engr. Franz Duran, MEP-ECE RapidSignal Electronics.
JAVA 0. HAFTA Algorithms FOURTH EDITION Robert Sedgewick and Kevin Wayne Princeton University.
String Manipulation. Java String class  The String class represents character strings “Tammy Bailey”  All strings (arrays of characters) in Java programs.
Input and Output. Announcements  Exam Next Wednesday –Next Monday: Review session.  Invited talk: –7:30 PM,Tuesday, Oct 28th. –Prof. Katherine Socha.
Characters. Character Data char data type – Represents one character – char literals indicated with ' '
CHAPTER 7 arrays I NTRODUCTION T O C OMPUTER P ROGRAMMING (CSC425)
Material taken from Robotics with the Boe-Bot
Scope When we create variables and functions, they are limited in where they are visible and where they can be referenced For the most part, the identifiers.
CS161 Topic #16 1 Today in CS161 Lecture #16 Prepare for the Final Reviewing all Topics this term Variables If Statements Loops (do while, while, for)
Digital Inputs Interfacing Keypad
1 Character Strings (Cstrings) Reference: CS215 textbook pages
ARDUINO 1. Basics  Comments  /* * Blink * * The basic Arduino example. Turns on an LED on for one second, * then off for one second, and so on... We.
1 - Remove LED from 13 and GND - Bring out your breadboard from HW#4 Arduino Overview:
Basic Circuits – Lab 4 Serial and OSC (maybe some theory too) Xmedia Spring 2011.
BM-305 Mikrodenetleyiciler Güz 2015 (10. Sunu) (Yrd. Doç. Dr. Deniz Dal)
 2008 Pearson Education, Inc. All rights reserved. 1 Arrays and Vectors.
Page 1 Data Structures in C for Non-Computer Science Majors Kirs and Pflughoeft Strings Chapter 5.
Chapter 15 Strings as Character Arrays
Computer Programming for Engineers
Characters and Strings
Print Row Function void PrintRow(float x[ ][4],int i) { int j; for(j=0;j
DCT1063 Programming 2 CHAPTER 3 STRINGS Mohd Nazri Bin Ibrahim Faculty of Computer, Media & Technology TATi University College
A data type in a programming language is a set of data with values having predefined characteristics.data The language usually specifies:  the range.
Programming Fundamentals. Today’s Lecture Array Fundamentals Arrays as Class Member Data Arrays of Objects C-Strings The Standard C++ string Class.
Arrays What is an array… –A data structure that holds a set of homogenous elements (of the same type) –Associate a set of numbers with a single variable.
What is Binary Code? Computers use a special code of their own to express the digital information they process. It's called the binary code because it.
Sudeshna Sarkar, IIT Kharagpur 1 Programming and Data Structure Sudeshna Sarkar Lecture 3.
Lecture 11 Text mode video
Serial Communication RS-232. In order to make two devices communicate, whether they are desktop computers, microcontrollers, or any other form of integrated.
Programming in Arduino Materials:Arduino Board Casperelectronics Pre Pres. Notes Photos from workshop?
INTERNET OF EVERYTHING SDU 2016 Week 12. Remotely Controlling Devices  interact with almost any device that uses some form of remote control  TVs, audio.
Introduction to Programming Lecture 12. Today’s Lecture Includes Strings ( character arrays ) Strings ( character arrays ) Algorithms using arrays Algorithms.
Arduino Programming Part 6: LCD Panel Output ME 121 Portland State University.
Infrared Proximity Sensors & Liquid Crystal Display Instructor Dr Matthew Khin Yi Kyaw.
Using a SparkFun™ serial LCD with an Arduino
Assist. Prof. Rassim Suliyev - SDU 2017
ECE Application Programming
Lab 2: Arduino Sensors Topics: Arduino Sensor Reading, Display
Microcontroller basics
Using Arduinos to Teach Engineering Concepts
CS4101 Introduction to Embedded Systems Lab 10: Tasks and Scheduling
LCD.
Detailed File I/O Examples Focus on Input
Schedule 8:00-11:00 Workshop: Arduino Fundamentals
IoT Programming the Particle Photon.
Ultrasonic Distance Sensor
Programming 2: The Arduino IDE & First Sketches
CTY SAR FCPS Shawn Lupoli, Elliot Tan
LCD (LIQUID CRISTAL DISPLAY) SCREENS
Arduino程式範例.
CTY SAR FCPS Vedant mathur, Juliana schalkwyk
LCD.
Presentation transcript:

Practical Electronics & Programming with Arduino Session 3: Strings Cont.

1 2 What is an array? Arrays are data stored back-to-back: byte nums[] = { 1, 2 } 1 2 0000 0001 0000 0010

Arrays You can access individual parts based on an 'index' that starts at 0: 1 2 nums = 0000 0001 0000 0010 1 2 nums[0] = nums[1] = 0000 0001 0000 0010 index 0 index 1

"Hello." = H e l o . \0 What is a String? Strings are arrays of characters (8 bits) terminated by a special '\0' character "Hello." = H e l o . \0

Number String Parsing Takes input of 5670 Converts it to an int Prints it Add 5 to the converted input Print it

String Parsing Until the string end is reached Output: H . Get the char at the index Print it out Advance one Character

Character Display http://arduino.cc/en/Tutorial/LiquidCrystal

Example Wiring

Example Code #include <LiquidCrystal.h> // initialize the library with the numbers of the interface pins LiquidCrystal lcd(12, 11, 5, 4, 3, 2); void setup() { // set up the LCD's number of columns and rows: lcd.begin(16, 2); // Print a message to the LCD. lcd.print("hello, world!"); } void loop() { // set the cursor to column 0, line 1 // (note: line 1 is the second row, since counting begins with 0): lcd.setCursor(0, 1); // print the number of seconds since reset: lcd.print(millis()/1000);

Character Display

Ultrasonic Distance Emitter Receiver

Ultrasonic Distance 1 - Ultrasonic Pulse sent 2 - Sounds bounces off target 3 - Bounced sound returns, time taken tells distance

Interfacing

Example Code