Compound Operators in Arduino

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

511 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

Arduino Uno vs Arduino Due

Yash Sanghvi
Updated on 31-Jul-2021 13:18:35

2K+ Views

We will have a comparison of the specifications of Arduino Uno and the Arduino Due BoardArduino UnoArduino DueUnoDueGeneralDimensions2.7¨ x 2.1¨4¨ x 2.1¨Pricing$20-23$40-42ConnectivityI/O Pins1454PWM Pins612Analog Pins612Analog Out Pins (DAC)-2ComputingProcessorATMega328PAT91SAM3X8EFlash Memory32 kB512 kBSRAM2 kB96 kB (split in two banks of 64 kB and 32 kB)EEPROM1 kB-Clock speed16 MHz84 MHzVoltage Level5V3.3VUSB ConnectivityStandard A/B USBMicro USBCommunicationHardware Serial Ports14SPI SupportYesYesI2C SupportYesYesNote that the Due board differs from other Arduino boards in terms of voltage level. The microcontroller in Arduino due runs at 3.3 V instead of 5 V (common in most other boards). If you connect a higher voltage to the pins, you may end ... Read More

Arduino Uno vs Arduino Nano

Yash Sanghvi
Updated on 31-Jul-2021 13:13:46

984 Views

We will have a comparison of the specifications of Arduino Uno and the Arduino Nano Board.Arduino UnoArduino NanoPlease refer to the table below for the detailed comparison −UnoNanoGeneralDimensions2.7¨ x 2.1¨1.77¨ x 0.7¨Pricing$20-23$20-21ConnectivityI/O Pins1422PWM Pins66Analog Pins68ComputingProcessorATMega328PATmega328Flash Memory32 kB32 kBSRAM2 kB2 kBEEPROM1 kB1 kBClock speed16 MHz16 MHzVoltage Level5V5VUSB ConnectivityStandard A/B USBMini USBCommunicationHardware Serial Ports11SPI SupportYesYesI2C SupportYesYesAs you can see, the Nano board is very similar to Uno, but compact.

Linux Utility for Sorting Processes by Network Usage

Mukul Latiyan
Updated on 31-Jul-2021 12:32:37

385 Views

Linux provides the famous top command utility that provides us with all the information about the processes, their time, their respective IDs, how much CPU chunk they are consuming and much more. The only issue with that is the processes are not sorted in any order and the order changes frequently.There are certain cases where we would like the output to be in a sorted manner somehow, like sorted in the sense that the process which is using the most network will be at the top.One such command line program that we can use that will provide us the desired ... Read More

Difference Between nohup and & on Linux

Mukul Latiyan
Updated on 31-Jul-2021 12:30:16

467 Views

Linux provides us with different utility commands that we can make use of to print a random line from any files in the Unix command line. Mostly we make use of either the shuf command or the sort command, and in this article I’ll explain both the commands and which one is better and why.Shuf CommandThe shuf command in Linux is used to write random permutations of the input lines to the standard output. The idea of randomizing the input is the same as one does when the cards are shuffled. On most of the Linux operating systems it is ... Read More

Set Environment Variables for Crontab

Mukul Latiyan
Updated on 31-Jul-2021 12:29:08

1K+ Views

In normal cases we make use of the bash_profile or bashrc in case of Ubuntu and zshrc in case of Mac OS, to set our environment variables and then those variables are made available to us everywhere on the terminal we want.Let’s consider a simple example where we have some environment variable in bash_profile and we are making use of it in the terminal.Consider the bash_profile output shown below −immukul@192 dir1 % cat ~/.bash_profile export JAVA_HOME=$(/usr/libexec/java_home) export PATH=$PATH:/usr/local/node/bin export GOROOT=/usr/local/go export GOPATH=/Users/immukul/go_projectsAs we can see there are many variables present in the bash_profile file, we can use these variables in ... Read More

Advertisements