🗊Презентация Serial Communications

Категория: Технология
Нажмите для полного просмотра!
Serial Communications, слайд №1Serial Communications, слайд №2Serial Communications, слайд №3Serial Communications, слайд №4Serial Communications, слайд №5Serial Communications, слайд №6Serial Communications, слайд №7Serial Communications, слайд №8Serial Communications, слайд №9Serial Communications, слайд №10Serial Communications, слайд №11Serial Communications, слайд №12Serial Communications, слайд №13Serial Communications, слайд №14Serial Communications, слайд №15Serial Communications, слайд №16Serial Communications, слайд №17Serial Communications, слайд №18Serial Communications, слайд №19Serial Communications, слайд №20Serial Communications, слайд №21Serial Communications, слайд №22Serial Communications, слайд №23Serial Communications, слайд №24Serial Communications, слайд №25Serial Communications, слайд №26Serial Communications, слайд №27Serial Communications, слайд №28Serial Communications, слайд №29

Вы можете ознакомиться и скачать презентацию на тему Serial Communications. Доклад-сообщение содержит 29 слайдов. Презентации для любого класса можно скачать бесплатно. Если материал и наш сайт презентаций Mypresentation Вам понравились – поделитесь им с друзьями с помощью социальных кнопок и добавьте в закладки в своем браузере.

Слайды и текст этой презентации


Слайд 1





IMPLEMENTING IOE
Assist. Prof. Rassim Suliyev - SDU 2017
Описание слайда:
IMPLEMENTING IOE Assist. Prof. Rassim Suliyev - SDU 2017

Слайд 2





Communicating with Others
Arduino can use same USB cable for programming and to talk with computers
Talking to other devices uses the “Serial” commands
TX – sending to PC
RX – receiving from PC
Описание слайда:
Communicating with Others Arduino can use same USB cable for programming and to talk with computers Talking to other devices uses the “Serial” commands TX – sending to PC RX – receiving from PC

Слайд 3





Serial Communications
Sends “Hello world!” to your computer
Click on “Serial Monitor” button to see output
Описание слайда:
Serial Communications Sends “Hello world!” to your computer Click on “Serial Monitor” button to see output

Слайд 4





Arduino Communications
Is just serial communications
Arduino doesn’t really do USB
It really is “serial”, like old RS-232 serial
All microcontrollers can do serial
Not many can do USB
Serial is easy, USB is hard
Описание слайда:
Arduino Communications Is just serial communications Arduino doesn’t really do USB It really is “serial”, like old RS-232 serial All microcontrollers can do serial Not many can do USB Serial is easy, USB is hard

Слайд 5





Serial Communications
“Serial” because data is broken down into bits, each sent one after the other down a single wire.
The single ASCII character ‘B’ is sent as:
Описание слайда:
Serial Communications “Serial” because data is broken down into bits, each sent one after the other down a single wire. The single ASCII character ‘B’ is sent as:

Слайд 6





Arduino & USB-to-serial
A standard Arduino has a single hardware serial port
But serial communication is also possible using software libraries to emulate additional ports
Описание слайда:
Arduino & USB-to-serial A standard Arduino has a single hardware serial port But serial communication is also possible using software libraries to emulate additional ports

Слайд 7





Arduino Mini
Arduino Mini separates the two circuits
Описание слайда:
Arduino Mini Arduino Mini separates the two circuits

Слайд 8





Arduino Mega
The Arduino Mega has four hardware serial ports
Only one of these has a USB adapter built in
Описание слайда:
Arduino Mega The Arduino Mega has four hardware serial ports Only one of these has a USB adapter built in

Слайд 9





Arduino to Computer
USB is totally optional for Arduino, but it makes things easier
Original Arduino boards were RS-232 serial, not USB
All programs that talk to Arduino (even the Arduino IDE) think that they’re talking via a serial port
Описание слайда:
Arduino to Computer USB is totally optional for Arduino, but it makes things easier Original Arduino boards were RS-232 serial, not USB All programs that talk to Arduino (even the Arduino IDE) think that they’re talking via a serial port

Слайд 10





Arduino & USB
Since Arduino is all about serial, and not USB, Interfacing to things like USB flash drives, USB hard disks, USB webcams, etc. is not possible
Also, USB is a host/peripheral protocol. Being a USB “host” means needing a lot of processing power and software, not something for a tiny 8kB microcontroller. It can be a peripheral. In fact, there is an open project called “AVR-USB” that allows AVR chips like used in Arduino to be proper USB peripherals
Описание слайда:
Arduino & USB Since Arduino is all about serial, and not USB, Interfacing to things like USB flash drives, USB hard disks, USB webcams, etc. is not possible Also, USB is a host/peripheral protocol. Being a USB “host” means needing a lot of processing power and software, not something for a tiny 8kB microcontroller. It can be a peripheral. In fact, there is an open project called “AVR-USB” that allows AVR chips like used in Arduino to be proper USB peripherals

Слайд 11





Serial Message Protocol
Where each message begins and ends?
Sides must agree how information is organized in the message (communications protocol)
Header - one or more special characters that identify the start of message
Footer - one or more special characters that identify the end of message
Описание слайда:
Serial Message Protocol Where each message begins and ends? Sides must agree how information is organized in the message (communications protocol) Header - one or more special characters that identify the start of message Footer - one or more special characters that identify the end of message

Слайд 12





Sending Debug Information from Arduino to Your Computer
This sketch prints sequential numbers on the Serial Monitor:
Описание слайда:
Sending Debug Information from Arduino to Your Computer This sketch prints sequential numbers on the Serial Monitor:

Слайд 13





Baud rate
Описание слайда:
Baud rate

Слайд 14





Sending information
You can display text using the Serial.print()or Serial.println() function
Описание слайда:
Sending information You can display text using the Serial.print()or Serial.println() function

Слайд 15





Strings
String message = "This string"; //C++ type strings
message.length() 
//provides thenumber of characters) in the string
message.concat(anotherMessage) 
//appends the contents of anotheMessage to message (also + operator)
message.substring(s, e); 
//returns a substring starting from s till e
You can use the indexOf and lastIndexOf functions to find an instance of a particular character in a string

char message[8] = "Arduino"; //C type string
int length = strlen(message); 
// return the number of characters in the string
strcpy(destination, source); 
// copy string source to destination
strcat(destination, source); 
// append source string to the end of the destination string
if(strcmp(str, "Arduino") == 0) 
// do something if the variable str is equal to "Arduino"
Описание слайда:
Strings String message = "This string"; //C++ type strings message.length() //provides thenumber of characters) in the string message.concat(anotherMessage) //appends the contents of anotheMessage to message (also + operator) message.substring(s, e); //returns a substring starting from s till e You can use the indexOf and lastIndexOf functions to find an instance of a particular character in a string char message[8] = "Arduino"; //C type string int length = strlen(message); // return the number of characters in the string strcpy(destination, source); // copy string source to destination strcat(destination, source); // append source string to the end of the destination string if(strcmp(str, "Arduino") == 0) // do something if the variable str is equal to "Arduino"

Слайд 16





Comparing C type Strings
Описание слайда:
Comparing C type Strings

Слайд 17





String Object
charAt(n) or [n] - Access a particular character of the String
concat(parameter) or + - Appends the parameter to a String 
endsWith(string2) - Tests whether or not a String ends with string2
equals(string2) or == - Compares two strings for equality (case sensitive)
indexOf(val, [strt]) – locates val in a String by searching forward starting from strt index. To search backward use lastIndexOf(val,[strt])
length() - Returns the length of the String, in characters 
remove(index,[count]) – remove all characters (or count caracters if given) from a String starting from index
replace(substring1, substring2) – Replace all instances of substring1 in a String to substring2
setCharAt(index, c) - Sets a character to c at index of the String 
startsWith(string2) - Tests whether or not a String starts with the string2
substring(from, [to]) - Get a substring of a String, from - inclusive, to – exclusive
toInt() or toFloat() - Converts a valid String to an integer or float
toLowerCase() or toUpperCase() - Get a lower-case or upper-case version of a String 
trim() - Get a version of the String with any leading and trailing whitespace removed
Описание слайда:
String Object charAt(n) or [n] - Access a particular character of the String concat(parameter) or + - Appends the parameter to a String endsWith(string2) - Tests whether or not a String ends with string2 equals(string2) or == - Compares two strings for equality (case sensitive) indexOf(val, [strt]) – locates val in a String by searching forward starting from strt index. To search backward use lastIndexOf(val,[strt]) length() - Returns the length of the String, in characters remove(index,[count]) – remove all characters (or count caracters if given) from a String starting from index replace(substring1, substring2) – Replace all instances of substring1 in a String to substring2 setCharAt(index, c) - Sets a character to c at index of the String startsWith(string2) - Tests whether or not a String starts with the string2 substring(from, [to]) - Get a substring of a String, from - inclusive, to – exclusive toInt() or toFloat() - Converts a valid String to an integer or float toLowerCase() or toUpperCase() - Get a lower-case or upper-case version of a String trim() - Get a version of the String with any leading and trailing whitespace removed

Слайд 18





Mathematical Operators
Описание слайда:
Mathematical Operators

Слайд 19





Comparing Character and Numeric Values
Описание слайда:
Comparing Character and Numeric Values

Слайд 20





Logical and Bitwise operators

Logical operators






Bitwise operators
Описание слайда:
Logical and Bitwise operators Logical operators Bitwise operators

Слайд 21





Combining Operations and Assignment
Описание слайда:
Combining Operations and Assignment

Слайд 22





Advanced Mathematical Operators
Описание слайда:
Advanced Mathematical Operators

Слайд 23





Other Useful Operators
Описание слайда:
Other Useful Operators

Слайд 24





Functions
	Functions are declared by first declaring the function type. This is the type of value to be returned by the function such as 'int' for an integer type function. If no value is to be returned the function type would be void. After type, declare the name given to the function and in parenthesis any parameters being passed to the function.
Описание слайда:
Functions Functions are declared by first declaring the function type. This is the type of value to be returned by the function such as 'int' for an integer type function. If no value is to be returned the function type would be void. After type, declare the name given to the function and in parenthesis any parameters being passed to the function.

Слайд 25





Receiving Serial Data in Arduino
Serial.available() - Get the number of bytes (characters) available for reading from the serial port. 
This is data that's already arrived and stored in the serial receive buffer (which holds 64 bytes)
Serial.read() - Reads incoming serial data 
Serial.readBytes(buffer, length)  - reads characters from the serial port into a buffer. The function terminates if the determined length has been read, or it times out
Описание слайда:
Receiving Serial Data in Arduino Serial.available() - Get the number of bytes (characters) available for reading from the serial port. This is data that's already arrived and stored in the serial receive buffer (which holds 64 bytes) Serial.read() - Reads incoming serial data Serial.readBytes(buffer, length) - reads characters from the serial port into a buffer. The function terminates if the determined length has been read, or it times out

Слайд 26





Controlling Arduino
Описание слайда:
Controlling Arduino

Слайд 27





Tasks Part 1
Concatenate two strings (Name, Surname) with space between them and output to serial monitor
Find a number of spaces in a given text
Given a string “Name Surname Age”, divide it to 3 strings
Convert a String containing a number to a number
Write function that compares 2 numbers and returns -1 if a<b, 0 if a=b, 1 if a>b
Write function that returns minimum number from an array of integers
Описание слайда:
Tasks Part 1 Concatenate two strings (Name, Surname) with space between them and output to serial monitor Find a number of spaces in a given text Given a string “Name Surname Age”, divide it to 3 strings Convert a String containing a number to a number Write function that compares 2 numbers and returns -1 if a<b, 0 if a=b, 1 if a>b Write function that returns minimum number from an array of integers

Слайд 28





Tasks Part 2
Write function that sorts array of integers
Read the number N from Serial port and make LED blink N times
Read numbers N and M and return N to the power of M
Описание слайда:
Tasks Part 2 Write function that sorts array of integers Read the number N from Serial port and make LED blink N times Read numbers N and M and return N to the power of M

Слайд 29





Home Work
Given 2 strings A and B. A contains some text and B contains a number. Print B times A.
Write function that compares two c type strings
Write function that returns both minimum and maximum number from an array of integers
Read N from Serial port and return N’th Fibonacci number
Read N from Serial port then read N numbers into array, print sorted array
Read a character from Serial port and print its ASCII value
Read a String from Serial port then append “-OK” to it and print the resulting string
Описание слайда:
Home Work Given 2 strings A and B. A contains some text and B contains a number. Print B times A. Write function that compares two c type strings Write function that returns both minimum and maximum number from an array of integers Read N from Serial port and return N’th Fibonacci number Read N from Serial port then read N numbers into array, print sorted array Read a character from Serial port and print its ASCII value Read a String from Serial port then append “-OK” to it and print the resulting string



Похожие презентации
Mypresentation.ru
Загрузить презентацию