Found 381 Articles for Hardware

Arduino Time Library Introduction

Yash Sanghvi
Updated on 02-Aug-2021 06:40:33

9K+ Views

The Time library provides you with timekeeping functionality on the Arduino. The latest version of the library is documented here.To install it, search for Time in the Library Manager and install the library by Michael Margolis.You’ll have to scroll a bit to find this library.Once the library is installed, if you go to File → Examples → Time, you will be able to see several examples of integrating this library with various sources: GPS, NTP, RTC, etc.The basic idea is that you can set time using the functions −setTime(hours, minutes, seconds, days, months, years);OR, setTime(t);where t is the special time_t ... Read More

Real Time Clock (RTC) with Arduino

Yash Sanghvi
Updated on 31-Jul-2021 13:48:36

2K+ Views

An RTC module keeps track of time once an initial time input is provided to it. This input can come from several sources (NTP, GPS, etc.). The RTC module usually comes with its own crystal oscillator, and even its own battery, so that the timekeeping continues, even if there is a power disturbance on the Arduino.Circuit Diagram −We will use the DS3231 module. It uses I2C for communication (SDA and SCL lines). The circuit diagram is shown below −As you can see, the Vcc pin of DS3231 is connected to 5V, GND to GND, SDA to A4 (SDA) and SCL ... Read More

Browse Arduino libraries by Category on Arduino Website

Yash Sanghvi
Updated on 02-Aug-2021 06:36:54

207 Views

Follow the steps given below to browse Arduino libraries by category on Arduino website −Go to http://arduino.cc/Click Documentation → ReferenceClick Libraries from the left menu.The libraries can now be found in the categorized form on this pageClick the category of your interest and explore the available libraries.

Goto in Arduino

Yash Sanghvi
Updated on 02-Aug-2021 06:34:22

7K+ Views

goto is a control structure in Arduino, like in C, and it is used to transfer the program flow to another point in the program. It is highly discouraged, as many programmers agree that you can write every algorithm you want without the use of goto.Excessive use of goto makes it very difficult to debug programs, or, in some cases, creates program flows which are impossible to debug. It is assumed that you will read further only if you absolutely have to use goto.SyntaxThe syntax for using goto is −goto label; label:    //statementsExampleThe following example demonstrates this −void ... Read More

Reference and dereference operator in Arduino

Yash Sanghvi
Updated on 02-Aug-2021 06:32:39

2K+ Views

The reference (&) and dereference operators (*) in Arduino are similar to C. Referencing and dereferencing are used with pointers.If x is a variable, then its address is represented by &x.Similarly, if p is a pointer, then the value contained in the address pointed to by p is represented by &p.Examplevoid setup() {    // put your setup code here, to run once:    Serial.begin(9600);    Serial.println();    int x = 10;    int *p;    p = &x; //p now contains the address of x    Serial.print("The value stored in the address pointed by p is: ");Serial.println(*p); } ... Read More

Compound operators in Arduino

Yash Sanghvi
Updated on 31-Jul-2021 13:34:22

487 Views

Compound operators in Arduino work just like in C, and they help save you some writing time, and also reduce the number of lines in your code. As the name seems to suggest, compound operators combine multiple operators.The following table lists the compound operators in Arduino.Assume that a and b are integers having values a = 5 and b = 2 in all the following examples −OperatorDescriptionExampleOutput++Incrementa++a=6--Decrementa--a=4+=Compound Additiona+=ba=7-=Compound subtractiona-=ba=3*=Compound multiplicationa*=ba=10/=Compound divisiona/=ba=2%=Compound remaindera%=ba=1&=Compound bitwise ANDa&=ba=0|=Compound bitwise ORa|=ba=7^=Compound bitwise XORa^=ba=7

Convert variables from one type to another in Arduino

Yash Sanghvi
Updated on 31-Jul-2021 13:32:41

4K+ Views

In order to convert variables from one type to another, you use the CAST operator. The syntax is −(type) var;Where var is the variable to be casted, and type is the new type to which you wish to convert it. For example, if you have a variable of type float, and wish to cast it as an int.ExampleHere’s how you can do it −float f; int i; void setup() {    // put your setup code here, to run once:    f = 5.6;    i = (int) f;    Serial.println(f);    Serial.println(i); } void loop() {   ... Read More

Arduino Uno vs STM32duino (Blue Pill)

Yash Sanghvi
Updated on 31-Jul-2021 13:29:57

4K+ Views

We will have a comparison of the specifications of Arduino Uno and the STM32 Blue Pill Board.Arduino UnoSTM32duino (Blue Pill)UnoSTM32 Blue PillGeneralDimensions2.08¨ x 0.9¨4¨ x 2.1¨Pricing$20-23$3-5ConnectivityI/O Pins1437PWM Pins615Analog In Pins610Analog Out Pins (DAC)--ComputingProcessorATMega328PSTM32F103C8T6Flash Memory32 kB64 kBSRAM2 kB20 kBEEPROM1 kB-Clock speed16 MHz72 MHzVoltage Level5V3.3VUSB ConnectivityStandard A/B USBMicro-USBCommunicationHardware Serial Ports13SPI SupportYes (1x)Yes (2x)CAN SupportNoYesI2C SupportYes (1x)Yes (2x)Apart from the details mentioned above, please note that STM32duino’s microcontroller is ARM Cortex M3 based. It is one of the most cost-effective boards out there, having better specs than Arduino Uno. It is growing in popularity, and for many, it is their first introduction to ... Read More

Arduino Uno vs Teensy

Yash Sanghvi
Updated on 31-Jul-2021 13:26:47

2K+ Views

We will have a comparison of the specifications of Arduino Uno and the Teensy 3.5 board.Arduino UnoTeensyPlease refer to the table below for the detailed comparison −UnoTeensy3.5GeneralDimensions2.7¨ x 2.1¨2.5¨ x 0.7¨Pricing$20-23$25-28ConnectivityI/O Pins1442PWM Pins620Analog Pins625ComputingProcessorATMega328PMK64FX512VMD12Flash Memory32 kB512 kBSRAM2 kB256 kBEEPROM1 kB4 kBClock speed16 MHz120 MHzVoltage Level5V3.3V (though all pins are 5V tolerant)USB ConnectivityStandard A/B USBMicro-USBCommunicationHardware Serial Ports16SPI SupportYes (1x)Yes (3x)CAN SupportNoYesI2C SupportYes (1x)Yes (3x)Apart from the points mentioned above, as you can see from Teensy 3.5’s visual, it has a builtin SD Card Holder. It also has a Cryptographic Acceleration Unit, Real Time Clock and CRC Computation Unit. Its microcontroller is ... Read More

Arduino Uno vs ESP32

Yash Sanghvi
Updated on 31-Jul-2021 13:22:10

2K+ Views

We will have a comparison of the specifications of Arduino Uno and the ESP32 DevKit v1 DOIT BoardArduino UnoESP32Please refer to the table below for the detailed comparison −UnoESP32GeneralDimensions2.7¨ x 2.1¨2¨ x 1.1¨Pricing$20-23$10-12ConnectivityI/O Pins1436PWM Pins616Analog Pins6Up to 18 *Analog Out Pins (DAC)2ComputingProcessorATMega328PXtensa Dual Core 32-bit LX6 microprocessorFlash Memory32 kB4 MBSRAM2 kB520 kBEEPROM1 kB-Clock speed16 MHzUpto 240 MHzVoltage Level5V3.3VUSB ConnectivityStandard A/B USBMicro-USBCommunicationHardware Serial Ports13SPI SupportYes (1x)Yes (4x)CAN SupportNoYesI2C SupportYes (1x)Yes (2x)Additional FeaturesWiFi-802.11 b/g/nBlueTooth-v4.2 BR/EDR and BLETouch Sensors-10CAM* Only 8 can be used along with WiFiThe above table itself would have driven home the point that ESP32 is hands-down much better than ... Read More

Advertisements