Zigbee is a wireless communication protocol targeted for battery powered devices (it has both low power and low cost). It generally operates in the 2.4GHz range (although there are geographic variations), and supports data ranges from 20 to 250 kbits/s.The transmission distance though, is small compared to the likes of LoRa. It is 10 to 100 m, whereas LoRa can transmit over a few kilometers. Another thing to note is that Zigbee communication doesn’t work very well if there is no line of sight between transmitter and receiver.Even minor obstacles have been observed to significantly degrade the communication. Keep these ... Read More
In this article, we will see how to interface Arduino with a GSM Module, and send SMS using the module. You will need the following −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)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
Queue is a data structure that helps exchange data between different tasks or between tasks and interrupts. It holds a finite number of items (defined at the time of initialization) and operates in the FIFO mode.We will walk through an example that comes in with the FreeRTOS library, to understand queues.You can find the example in − File → Examples → FreeRTOS → StructQueue.In this code, two tasks read analog values from different analog pins, and pass these values in a queue. Another task reads the values from the queue and prints them onto the Serial Monitor. There is a ... Read More
The SoftwareSerial library was developed to ensure that any pins of Arduino can exchange Serial data with other peripherals, like GNSS receivers, using software. Arduino Uno, for example, has only one HardwareSerial port (pins 0 and 1), which is connected to the USB via the USB to UART conversion chip. Thus, if you have any other peripheral that requires serial communication, in the absence of SoftwareSerial, you’d have to do away with USB Serial communication.SoftwareSerial has some limitations −If you are using multiple SoftwareSerial ports, only one can receive data at a timeSpeeds can be up to a maximum of ... Read More
Input array is: [2, 4, 1, 6, 5]Sum = 2 + 4 + 1 + 6 + 5 => 18Average = 18/5 => 3.6 ~ 3To calculate the average of numbers in a given list, we can take following steps −Let's take an input list of numbers.Find the sum of numbers using sum() method.The sum method calculates the sum of numbers by iterating the given list.Print the average by dividing the sum with the length of the given list.Example Live Demopackage main import ( "fmt" ) func sum(arr []int) int{ result := 0 for _, i :=range arr ... Read More
To create a class that can perform basic calculator operations, we can take following StepsWe can define a Calculator class with two numbers, a and b.Define a member method to calculate the addition of two numbers.Define a member method to calculate the multiplication of two numbers.Define a member method to calculate the division of two numbers.Define a member method to calculate the subtraction of two numbers.In the main method, declare two variables, a and b.Get an instance of Calculator.Initialize a choice variable, based on which mathematical operations could be performed.Example Live Demopackage main import ( "fmt" ) type Calculator struct ... Read More
To compute the area and perimeter of a circle, we can take following steps −Define a struct with circle properties such as radius.Define a method to calculate the area of the circle.Define a method to calculate the perimeter of the circle.In the main method, take the user's input for circle's radius.Instantiate the circle with the radius.Print the area of the circle.Print the perimeter of the circle.Example Live Demopackage main import ( "fmt" "math" ) type Circle struct { radius float64 } func (r *Circle)Area() float64{ return math.Pi * r.radius * r.radius } func (r *Circle)Perimeter() float64{ ... Read More
To find the area of a rectangle using classes, we can take following StepsDefine a struct with rectangle properties such as breadth and length.Define a method to calculate the area of the rectangle.In the main method, instantiate an object of rectangle.Call the struct method, i.e., Area, to calculate the area of the rectangle.Print the area of the rectangle.Example Live Demopackage main import ( "fmt" ) type Rectangle struct { breadth int len int } func (r *Rectangle)Area() int{ return r. len * r.breadth } func main(){ rectangle := Rectangle{ breadth: 10, ... Read More
If you are starting off with Arduino, then the following 5 projects can be taken up by you −7-segment display using ArduinoInterface a 7-segment display with Arduino and count from 0 to 9 on that display. This will help you get a good understanding of GPIOsAs a next step, you can interface Arduino with a potentiometer, and display the truncated voltage value (read using ADC) on the 7 segment display.Fire Alarm SystemInterface the Arduino with a smoke detector or a flame sensor and a buzzer to give a warning as soon as the readings from the smoke detector cross a ... Read More
Here are some popular boards that can be programmed using Arduino IDE −ESP8266This board is used primarily for IoT applicationsIt has WiFi and BlueTooth capabilitiesTo make this compatible with Arduino IDE, the following JSON has to be added to File → Preferences → Additional Boards Manager URLs −Next, you need to go to Tools → Boards Manager, search for ESP8266 and install this board.ESP32This is an upgrade over ESP8266It comes with two cores (supporting dual core operation) and in general has superior specs over ESP32There are various variants of this board, some like the TTGO Board even having OLED, LoRa ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP