String Comparisons in Arduino

Yash Sanghvi
Updated on 24-Jul-2021 14:11:06

533 Views

The same operators that are used for comparing integers like , >=, 'A'.ExampleTake a look at the following example.void setup() {    Serial.begin(9600);    Serial.println();    String s1 = "Hello";    String s2 = "hello";    String s3 = "100";    String s4 = "90";    if (s1 > s2) {       Serial.println("s1 is greater than s2");    } else if(s2 > s1) {       Serial.println("s2 is greater than s1");    }    if (s3 > s4) {       Serial.println("s3 is greater than s4");    } else if(s4 > s3) {     ... Read More

String to Byte Array in Arduino

Yash Sanghvi
Updated on 24-Jul-2021 14:07:44

9K+ Views

The getBytes() function helps copy the content of a String to a byte array. The syntax is −string1.getBytes(buf, len)where, string1 is the string whose content you want to copy to a byte array, buf is the byte array, andlen is the length of content to be copied.ExampleThe following example illustrates how to use this function −byte buf[10]; void setup() {    Serial.begin(9600);    Serial.println();    String s1 = "Hello World";    s1.getBytes(buf, 5);    for (int i = 0; i < 10; i++) {       Serial.println(buf[i]);    } } void loop() { }OutputThe Serial Monitor output is shown ... Read More

What is Memory Stack in Computer Architecture

Ginni
Updated on 24-Jul-2021 14:07:32

14K+ Views

A stack can be executed in the CPU by analyzing an area of the computer memory to a stack operation and utilizing a processor register as a stack pointer. In this method, it is performed in a random access memory connected to the CPU.An area of the computer memory is broken into three segments such as program, data, and stack. The address of the next instruction in the program is saved in the pointer Program Counter (PC). The Address Register (AR) points to an array of the information. SP continually influences the address of the element present at the top ... Read More

Use isControl in Arduino

Yash Sanghvi
Updated on 24-Jul-2021 14:02:04

713 Views

The isControl() function is used to determine if a character is a control character. A control character or a non-printing character (NPC) is a code point (a number) in a character set that does not represent a written symbol. All entries in the ASCII table below code 32 are of this kind. This includes characters like '', '\t', and so on.SyntaxThe syntax of the isControl function is as follows −isControl(myChar)Where myChar is the character being evaluated. If it is a control character, this function returns True, otherwise False.ExampleThe following example illustrates how to use this function −void setup() {   ... Read More

Interface Arduino with GSM Module and Ping to a Website

Yash Sanghvi
Updated on 24-Jul-2021 13:57:06

2K+ Views

In this article, we will see how to interface Arduino with a GSM Module, and ping to a website.You will need the following −An Arduino boardA GSM Module (SIM800C, SIM900A, are popular examples, but you can have any other module as well)A GSM (2G) SIM Card, or a 4G SIM Card with 2G fallback option (Jio SIM Cards won't work for this project)A GSM AntennaYou could also get a GSM Module development board, like the one below (the SIM Card Holder is on the other side of the board) −A GSM Module interacts with a microcontroller via UART (see the ... Read More

Interface Arduino with GSM Module and Delete Read SMS

Yash Sanghvi
Updated on 24-Jul-2021 13:48:08

1K+ Views

In this article, we will see how to interface Arduino with a GSM Module, and delete all the read SMSes. You will need the following −An Arduino boardA GSM Module (SIM800C, SIM900A, are popular examples, but you can have any other module as well)A GSM (2G) SIM Card, or a 4G SIM Card with 2G fallback option (Jio SIM Cards won't work for this project)A GSM AntennaYou could also get a GSM Module development board, like the one below (the SIM Card Holder is on the other side of the board) −A GSM Module interacts with a microcontroller via UART ... Read More

Interface Arduino with GSM Module to Read SMS

Yash Sanghvi
Updated on 24-Jul-2021 13:39:35

3K+ Views

In this article, we will see how to interface Arduino with a GSM Module, and read an SMS sent to the SIM card attached to the module.You will need the following −An Arduino boardA GSM Module (SIM800C, SIM900A, are popular examples, but you can have any other module as well)A GSM (2G) SIM Card, or a 4G SIM Card with 2G fallback option (Jio SIM Cards won't work for this project)A GSM AntennaYou could also get a GSM Module development board, like the one below (the SIM Card Holder is on the other side of the board) −A GSM Module ... Read More

Arduino Uno vs Arduino Micro

Yash Sanghvi
Updated on 24-Jul-2021 13:30:14

1K+ Views

We will have a comparison of the specifications of Arduino Uno and the Arduino Due BoardArduino UnoArduino MicroRefer to the table below for a detailed comparisonUnoMicroGeneralDimensionsPricing2.7'' x 2.1''$20-231.88'' x 0.7''$20-21ConnectivityI/O PinsPWM PinsAnalog Pins146620712ComputingProcessorFlash MemorySRAMEEPROMClock speedVoltage LevelUSB ConnectivityATmega328P32 kB2 kB1 kB16 MHz5VStandard A/B USBATmega32u432 kB2.5 kB1 kB16 MHz5VMicro USBCommunicationHardware Serial PortsSPI SupportI2C Support1YesYes2YesYesArduino Micro is very similar to Leonardo. The biggest difference between Micro and Leonardo, perhaps, is the form factor. Apart from the differences mentioned in the above table, one other major difference that I'd like to highlight −Micro's ATmega32u4 has in-built USB communication, thereby eliminating the need for a ... Read More

Arduino Uno vs Arduino Leonardo

Yash Sanghvi
Updated on 24-Jul-2021 13:19:49

784 Views

We will have a comparison of the specifications of Arduino Uno and the Arduino Leonardo Board.Arduino UnoArduino LeonardoRefer to the table below for a detailed comparison −UnoLeonardoGeneralDimensionsPricing2.7'' x 2.1''$20-232.7'' x 2.1''$20-21ConnectivityI/O PinsPWM PinsAnalog Pins146620712ComputingProcessorFlash MemorySRAMEEPROMClock speedVoltage LevelUSB ConnectivityATmega328P32 kB2 kB1 kB16 MHz5VStandard A/B USBATmega32u432 kB2.5 kB1 kB16 MHz5VStandard A/B USBCommunicationHardware Serial PortsSPI SupportI2C Support1YesYes2Yes (master only)YesApart from the differences mentioned in the above table, two other major differences that I'd like to highlight −The SPI pins on Leonardo are not exposed via digital pins, but via ICSP headers.And the slave select pin is not exposed at all. Therefore, the Leonardo ... Read More

Use Light Dependent Resistor (LDR) with Arduino

Yash Sanghvi
Updated on 24-Jul-2021 13:16:00

731 Views

The resistance of a Light Dependent Resistor (LDR) changes depending on the intensity of the light falling on it. Interfacing an LDR with Arduino is quite straightforward. You just create a voltage divider as shown below −One end of the LDR is connected to 5V, the other end to a resistor (whose resistance should be approx. the same order of magnitude as the max resistance of the LDR). For instance, we are using an LDR with a resistance of 90K and the resistor has the maximum resistance of 150K. The other end of the resistor is connected to GND, and ... Read More

Advertisements