Arduino Articles

Page 4 of 18

How to Use Word() Function in Arduino?

Yash Sanghvi
Yash Sanghvi
Updated on 30-Jul-2021 1K+ Views

The word() function converts a variable of any data type to the word data type. It is essentially a cast function.SyntaxThe 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.SyntaxThe 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.

Read More

What is a Word in Arduino?

Yash Sanghvi
Yash Sanghvi
Updated on 30-Jul-2021 521 Views

A word, very simply put, is an unsigned number of 2 bytes (or 16 bits). Thus, it can take in values from 0 to 65535.Note that this definition is very microcontroller specific. In pure terms, a word is the amount of data a machine can process at a time, and it depends on the specifications of the machine.For example, instead of Arduino Uno, if you use the ESP32 board, the word becomes a 32-bit unsigned int instead of 16-bit. This is because ESP32 has different specifications compared to Arduino Uno. int sizes on ESP32 are also larger than Arduino.So, the ...

Read More

Overview of Arduino IoT Cloud

Yash Sanghvi
Yash Sanghvi
Updated on 30-Jul-2021 745 Views

Arduino IoT Cloud is a service that tries to make it seamless to convert your Arduino devices into IoT devices.Any IoT device typically gathers data from sensors, does some processing onboard, and transmits either the raw or the processed data to a server. Arduino IoT Cloud allows you to generate a digital twin of your device (called as a thing), add variables and settings to that digital twin, and then generates the Arduino Sketch automatically which you can upload to the device. Thus, you essentially don’t need to write the Arduino Sketch yourself.What’s more, it also provides dashboards and widgets ...

Read More

WiFi with Arduino – Connect to a Network

Yash Sanghvi
Yash Sanghvi
Updated on 30-Jul-2021 2K+ Views

In order to use WiFi with Arduino Uno, or any other board, you may need to get a WiFi shield(unless you are using a board with built-in WiFi capabilities, like Arduino Uno WiFi). The WiFi shield, like any other shield, stacks up on your board, and provides access to the pins of Arduino on the shield itself.You can read more about the WiFi shield here −www.arduino.cc/en/pmwiki.php?n=Main/ArduinoWiFiShieldhttps://www.arduino.cc/en/Guide/ArduinoWiFiShieldAssuming you have a WiFi shield with you, you will need the WiFi library to get started. You don’t need to download it separately; it will be built-in in your IDE. If you don’t get ...

Read More

Specifications of the microcontroller used in Arduino Uno

Yash Sanghvi
Yash Sanghvi
Updated on 30-Jul-2021 633 Views

Arduino Uno uses ATmega328P as the microcontroller. Its specifications are given below −Operating Voltage2.7-5.5VTemperature Range( C)-40 to 85Number of Pins32Programmable I/O pins23Number of PWM Pins6ADC8 channel, 10-bit resolutionFlash Memory32 kBSRAM2 kBEEPROM1 kBFlash Read/Write Cycles10000EEPROM Read/Write Cycles100000UART1SPI2I2C1Timers2 8-bit timers and 1 16-bit timerReal Time CounterYesThroughputUp to 16 MIPS at 16 MHz

Read More

How to Use isGraph() in Arduino?

Yash Sanghvi
Yash Sanghvi
Updated on 30-Jul-2021 340 Views

The isGraph() function is very similar to the isPrintable() function in Arduino. The only difference is that isGraph() returns true only if the character being printed has some content.So, blank space gets excluded by isGraph() but included by isPrintable(). All normal characters, numbers, special characters, which have some content will return true when passed through isGraph().SyntaxThe syntax is −isGraph(myChar)Where myChar is the character being checked. A quick question. Will the tab and new line characters return true with isGraph().ExampleValidate your answer with a simple code like below −void setup() {    // put your setup code here, to run once: ...

Read More

shiftIn() and shiftOut() in Arduino

Yash Sanghvi
Yash Sanghvi
Updated on 30-Jul-2021 2K+ Views

shiftIn() and shiftOut() commands in Arduino are, very loosely speaking, software implementations of SPI. Of course, SPI is much faster, but SPI can work only on some specific pins of Arduino. shiftIn() and shiftOut() can use any two GPIOs of Arduino (not some specific pins like SPI).Both shiftIn() and shiftOut() require two digital pins, one dataPin and one clockPin.The dataPin will shift in or shift out a byte (8 bits) of data, 1 bit at a time. The clockPin synchronizes the data transfer. It is generally kept low, and for each bit transfer, it goes HIGH and then back to ...

Read More

pulseIn() and pulseInLong() in Arduino

Yash Sanghvi
Yash Sanghvi
Updated on 30-Jul-2021 3K+ Views

If there is an incoming pulse on a pin, and you need to measure the duration of the pulse then the pulseIn() function comes in handy.SyntaxThe syntax is −pulseIn(pin, value)Where pin is the number of the pin on which you wish to measure the pulse. The value is the level of the pulse. It can be HIGH or LOW.For example, if you set the value to HIGH, it means that as soon as the voltage on the pin goes from LOW to HIGH, the measurement of the time will start. It will stop when the voltage on the pin goes ...

Read More

tone() and noTone() in Arduino

Yash Sanghvi
Yash Sanghvi
Updated on 30-Jul-2021 6K+ Views

The tone function can be used to generate a square wave (50% duty cycle) of a specific frequency on a pin.SyntaxThe syntax is −tone(pin, frequency)pin is the pin number on which to generate the tone. The frequency is specified in Hz.This function can also take in a third optional argument − the millisecond duration for which the tone should be generated on the pin.tone(pin, frequency, duration)If you don’t specify the duration, the tone will continue till the noTone() function is called on the same pin. The syntax of the noTone() function is −noTone(pin)where pin is the pin number on which ...

Read More

How to Perform Basic Linear Algebra on Arduino?

Yash Sanghvi
Yash Sanghvi
Updated on 26-Jul-2021 2K+ Views

The BasicLinearAlgebra library helps represent matrices and perform matrix math on Arduino. To install it, search for 'BasicLinearAlgebra' in the Library Manager.Once installed, go to: File → Examples → BasicLinearAlgebra → HowToUseAs the name suggests, this example shows how to use this library. While the comments in this example do much of the explanation, here are a few pointers that help illustrate the use of this library −You need to include the library and define the BLA namespace before getting started, as all the functions are wrapped up inside the BLA namespace.#include using namespace BLA;A matrix is defined using ...

Read More
Showing 31–40 of 179 articles
« Prev 1 2 3 4 5 6 18 Next »
Advertisements