
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Use Word Function in Arduino
The word() function converts a variable of any data type to the word data type. It is essentially a cast function.
Syntax
The syntax is −
word(var)
Where var is a variable of any datatype.
Alternatively, you can also construct a word by specifying two bytes, the higher byte and the lower byte.
Syntax
The syntax is −
word(highByte, lowByte)
For instance, word(2,5) will return 517 (2 is 0b00000010 and 5 is 0b00000101; word(2,5) will return 0b0000001000000101, which equals 517).
You can try out other combinations of characters and data types. You can read more about the word function from Arduino’s official documentation here.
Advertisements