Yash Sanghvi has Published 192 Articles
Yash Sanghvi
8K+ Views
If you wish to disable interrupts (when executing some critical piece of code, especially one which should be completed within a given time period), you can do that with the help of the noInterrupts() function.Once your critical code has executed and you wish to re-enable the interrupts, you can do ... Read More
Yash Sanghvi
1K+ Views
We have seen that in order to attach interrupts to a source, we use the .attachInterrupt() function, with the required arguments.For example, for attaching the interrupts to a specific pin, we useattachInterrupt(digitalPinToInterrupt(pin), ISR, mode);In the same way, to detach the interrupt from a source, we can call the detachInterrupt() function. ... Read More
Yash Sanghvi
1K+ Views
In this tutorial, we will interface Arduino with a GNSS Receiver and obtain the current location. Any GNSS receiver generally uses UART for communication. We will be using the ublox Neo6M GNSS module for thisCircuit DiagramAs you can see, we connect Vcc to 5V, GND to GND, RX of the ... Read More
Yash Sanghvi
706 Views
A DC Motor is the simplest kind of motor. It has two terminals or leads. When connected with a battery the motor will rotate, and if the connections are reversed, the motor will rotate in the opposite direction. If the voltage across the terminals is reduced, the motor speed will ... Read More
Yash Sanghvi
1K+ Views
When you delve into advanced firmware, you deal with a lot of registers, whose specific bits need to be set or cleared depending on your use case. Arduino has inbuild functions to do that.SyntaxbitSet(x, index)and, bitClear(x, index)Where x is the number whose bit has to be set/ cleared and index ... Read More
Yash Sanghvi
6K+ Views
The constrain() function in Arduino helps to, as the name suggests, constrain a number between an upper bound and a lower bound.Syntaxconstrain(val, min, max)where, val is the number to be constrained, min is the lower bound value, and max is the upper bound valueIf val is less than min, this ... Read More
Yash Sanghvi
2K+ Views
If you are a firmware developer, then shifting numbers, or registers by certain number of bits may be quite common for you. In Arduino as well, the same bit shift operators can be used, that are used in the C language, namely > for right shift.Syntaxx >> n or x ... Read More
Yash Sanghvi
9K+ Views
The modulo operator in Arduino is exactly the same as in C language, or most other languages for that matter. The operator is %. The syntax is: a % b and it returns the remainder when a is divided by b.ExampleThe following example illustrates the use of this operator −void ... Read More
Yash Sanghvi
853 Views
The isSpace() and isWhitespace() functions can be used to check if a character is a space or, more specifically, a whitespace. Whitespace is a subset of space. While whitespace includes only space and horizontal tab (‘\t’), space includes form feed (‘\f’), new line (‘’), carriage return (‘\r’) and even vertical ... Read More
Yash Sanghvi
330 Views
Just like there is a function to check if a character is alphanumeric or not, there is another one to check if a character is a punctuation mark or not. The name of the function is isPunct(). It takes a character as an input and returns a Boolean: true if the ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP