Introduction to Nucleo Development Board
To become familiar with the world of microcontrollers it is necessary to have a development board (also known as a kit), which generally allows you to start working on it easily. Fortunately, the ST provides a wide portfolio of development boards. In this guide, we will describe and use the Nucleo board.
The Nucleo has been introduced a few years ago and its line is divided into three main groups:
- Nucleo-32;
- Nucleo-64;
- Nucleo-144.
Where To Buy? |
---|
No. | Components | Distributor | Link To Buy |
1 | STM32 Nucleo | Amazon | Buy Now |
Nucleo-32 Development Board
The number of pins available, so the package, gives the name to the board: Nucleo-32 uses an LQFP-32 package; Nucleo-64 and LQFP-64; Nucleo-144 an LQFP-144. The Nucleo-64 was the first line introduced and counts 16 different boards.
The Nucleo boards have interesting advantages compared to the Discovery. First, is the cheaper cost, you can buy it for around 15-25 dollars. Now in 2021 due to the lack of processed semiconductors, it is very difficult to find them on the normal distribution channels and costs are rising. A return to normal is expected from 2023. Furthermore, Nucleo boards are designed to be pin-to-pin compatible with each other. It is a very important advantage, in fact, if I start to develop my firmware on generic Nucleo later then I can adapt my code to another one.
In the next paragraphs, we will see the main structure of STM32-64
STM32 Nucleo-64 parts
The Nucleo-64 is composed of two parts:
The part with the mini-USB connector is an ST-LINK 2.1 integrated debugger. It needs to upload the firmware on the target MCU and run the debugging. Furthermore, the ST-LINK interface provides a Virtual COM Port (VCP), which can be used to exchange data and messages with the host PC. The ST-LINK interface can be used as a stand-alone ST-LINK programmer, in fac,t can be easily cuttable to reduce board size.
To program the STM32 on board, simply plug in the two jumpers on CN4, as shown in the figure below in pink, but do not use the CN11 connector as that may disturb communication with the STM32 microcontroller of the Nucleo.
However, the ST-LINK provides an optional SWD interface which can be used to program another board without detaching the ST-LINK interface from the Nucleo by removing the two jumpers labeled ST-LINK (CN4).
The rest of the board, MCU part, contains the target MCU (the microcontroller we will use to develop our applications), a RESET button, a user-programmable push button (switch), and an LED. It is possible to mount an external high-speed crystal (HSE) through X3 pads (see figure below). Generally, the Nucleo boards, especially the most recent ones, provide a low-speed crystal (LSE).
Finally, the board has several pin headers we will look at in the next paragraph.
STM32 Nucleo-64 connectors
The STM32 Nucleo-64 board has 8 connectors:
- CN2: ST-LINK USB connector on ST-LINK (already described in the previous paragraph);
- CN11: SWD connector in ST-LINK part (already described in the previous paragraph);
- CN7 and CN10: ST morpho connectors;
- CN5, CN6, CN8, and CN9: ARDUINO® Uno V3 connectors;
The CN7 and CN10 ST morpho connectors are male pin headers (2x19, 2.54mm male pin headers) accessible on both sides of the STM32 Nucleo-64 board (see the figure below). All signals and power pins can be probed by an oscilloscope, logical analyzer, or voltmeter through the ST morpho connectors. They are two. They are called Morpho connectors and are a convenient way to access most of the MCU pins.
- The figure below is shown the CN7 pinout (the STM32 peripherals and GPIOs associated with the Morpho connector) for NUCLEO-L053R8.
- In the next figure, is shown the CN10 pinout for NUCLEO-L053R8.
- The previous figure showed the pinout for NUCLEO STM32L053R8, but I remember you the Nucleo is pinout compatible with each other.
- Another important feature of the Nucleo board is the compatibility with ARDUINO® Uno V3 through the CN5, CN6, CN8, and CN9 connectors (see figure below).
- CN6 and CN8 are directly connected to CN7 and CN5 and CN9 to CN10.
Setting-Up the Tool-Chain
The first step in developing an application on the STM32 platform is to fully set up the tool-chain. A tool-chain is a set of programs, compilers, and tools that allows us:
- to write our code and to browse the source files of our application;
- to browse inside the application code, in order to examine variables, definitions, function declarations, and etc;
- to compile our code using a cross-platform compiler;
- to upload and debug our application on the development board (or a custom board).
To carry out these activities we basically need:
- an IDE with integrated source editor and navigator;
- a cross-platform compiler able to compile source code for our platform;
- a debugger that executes the debugging of firmware on our board;
- a tool that interacts with the ST-LINK interface.
There are several complete tool-chain for the STM32 Cortex-M family, both free and commercial. The most used tools are: IAR for Cortex-M, ARM Keil, and AC6 SW4STM32.
They can integrate everything necessary for the development of applications on STM32 to simplify and accelerate their development. The first two are commercial solutions and therefore have a price to the public that may be too high for those approaching the first time.
So, that was all for today. I hope you have enjoyed today's lecture and have understood this Nucleo Development Board. In the next lecture, we will design our first project in STM32CubeIDE. Thanks for reading.
Introduction to STM32 Family
In this guide, we will explain step by step to start programming on the STMicroelectronics (STM) platform, especially the STM32 family.
The term, "STM32" refers to a family of 32-bit microcontroller integrated circuits based on the ARM® Cortex®M processor. The architecture of these CPUs (Central Processing Unit) is ARM (Advanced Risk Machine) which is a particular family of Reduced Instruction Set Computing (RISC). RISC architecture differs from Complex Instruction Set Computing (CISC) for its simplicity that allows you to create processors capable of executing instruction sets with shorter times. Why use STM32? The advantages are many, and now we will list a part of them:
- ST offers a wide portfolio of solutions depending on the developer's needs. We can find products that combine different advanced features while maintaining a high level of integration. In fact, we can choose products with high performance, real-time processing, digital signal processing, and low consumption.
- Thanks to the availability of different development tools and available support material, the development of a simple or complex project is quite simple and fast, reducing the time to market if you want to develop a product.
- Each microcontroller has an integrated processor core, static RAM, flash memory, debug interface, and various peripherals such as GPIO, ADC, DAC, Timer, SPI, UART-USART, I2C, etc.
- For every MCU, ST provides the STM32 Nucleo Board that helps anyone who wants to fastly build and test prototypes for new projects with any STM32 MCU. STM32 Nucleo boards share the same connectors and can be easily expanded with many specialized application hardware add-ons (Nucleo-64 includes ST Morpho and Arduino Uno Rev3 connectors, while Nucleo-32 includes Arduino Nano connectors). Another and not insignificant advantage is the cheap cost of these development boards.
In the next paragraph, it will be illustrated how the STM32 is divided to easily identify the one used for your purposes.
Where To Buy? |
---|
No. | Components | Distributor | Link To Buy |
1 | STM32 Nucleo | Amazon | Buy Now |
STM32 Family
- To date, the STM32 family has 16 series of microcontrollers divided into four groups in order to cover all the needs of developers.
- The four groups are Mainstream, Ultra-Low-Power, High-Performance Wireless.
STM32 Mainstream
The STM32 Mainstream has been designed to offer solutions for a wide range of applications where costs, time to market, reliability, and availability are fundamental requirements. They are widely used in real-time control signal processing applications.
There are 5 series in this group:
- STM32F1 are microcontrollers based on the ARM Cortex-M3 core. It was launched in 2007 and evolved over time in terms of maximum clock rate, memory depth, and peripherals. In fact, the maximum clock rate has gone from 24 MHz to 72 MHz, static RAM up to 96 kB, and Flash up to 1024 kB. It also supports Thumb-1 and Thumb-2 instruction sets.
- STM32F0 are microcontrollers based on the ARM Cortex-M0 core. It was launched in 2012. The maximum clock rate is 48 MHz and includes the SysTick timer. Static RAM up to 32 kB, and Flash up to 256 kB. It also supports Thumb-1 and Thumb-2 instruction sets.
- STM32F3 are microcontrollers based on the ARM Cortex-M0 core. It was launched in 2012. The maximum clock rate is 72 MHz and includes the SysTick timer. Static RAM up to 40 kB, and Flash up to 256 kB. It also supports Thumb-1, Thumb-2, Saturated, DSP, FPU instruction sets.
- STM32G0 are microcontrollers based on the Cortex-M0/M0+ core. It was launched in 2018. The maximum clock rate is 64 MHz. Static RAM up to 128 kB, and Flash up to 512 kB. It also supports Thumb-1 and Thumb-2 instruction sets. Compared to the older F0 series, it presents improvements in terms of efficiency and performance.
- STM32G4 are microcontrollers based on the Cortex-M4F core. It was launched in 2019. The maximum clock rate is 170 MHz. Static RAM up to 128 kB, and Flash up to 512 kB. Thumb-1, Thumb-2, Saturated, DSP, FPU instruction sets. Compared to the older F3/F4 series, it presents improvements in terms of efficiency and performance and higher performance compared to the L4 series.
STM32 Ultra-Low-Power
The STM32 Ultra-Low-Power has been designed to meet the need to develop devices with low energy consumption (such as portable and wearable devices) but maintaining a good compromise with performance. There are 6 series in this group:
- STM32L0 are microcontrollers based on the ARM Cortex-M0+ core. It was launched in 2014. The maximum clock is 32 MHz, static RAM is of 8 kB, and Flash is up to 64 kB. It also supports Thumb-1 and Thumb-2 instruction sets.
- STM32L1 are microcontrollers based on the ARM Cortex-M3 core. It was launched in 2010. The maximum clock rate is 32 MHz, static RAM up to 80 kB, and Flash up to 512 kB. It also supports Thumb-1 and Thumb-2 instruction sets.
- STM32L4 are microcontrollers based on the ARM Cortex-M4 core. It was launched in 2015. The maximum clock rate is 80 MHz, static RAM is of 64 kB, and Flash is of 1024 kB. It also supports Thumb-1 and Thumb-2, Saturated, DSP, FPU instruction sets.
- STM32L4+ are microcontrollers based on the ARM Cortex-M4 core. It was launched in 2016. The maximum clock rate is 120 MHz, static SRAM up to 640 kB, and Flash up to 2048 kB. It also supports Thumb-1 and Thumb-2, Saturated, DSP, FPU instruction sets. It has been enriched with advanced peripherals such as a TFT-LCD controller, Camera interface, etc.
- STM32L5 are microcontrollers based on the ARM Cortex-M33F core. It was launched in 2018. The maximum clock rate is 110 MHz, static SRAM up to 640 kB, and Flash up to 2048 kB. It also supports Thumb-1 and Thumb-2, Saturated, DSP, FPU instruction sets.
- STM32U5 is the last ultra-low-power series launched (in 2021). It is an evolution of the L series and is based on the ARM Cortex-M33F core. the new 40 nm silicon technology allows to further reduce energy consumption, it also includes advanced cyber security features and graphics accelerators. The maximum clock rate is 160 MHz, static SRAM up to 640 kB, and Flash up to 2048 kB. It also supports Thumb-1 and Thumb-2, Saturated, DSP, FPU instruction sets.
STM32 High-Performance
The STM32 High-Performance has been designed for data processing and data transfer. It also has a high level of memory integration. There are 5 series in this group:
- STM32H7 are microcontrollers based on the ARM Cortex-M7F core. It was launched in 2017. The maximum clock is 480 MHz, static RAM is up to 1.4 MB, and Flash is up to 128 kB. It includes Ethernet and some advanced features such as dual Octo-SPI, JPEG codec, etc. It supports Thumb-1 and Thumb-2, Saturated, DSP, FPU instruction sets.
- STM32F7 are microcontrollers based on the ARM Cortex-M7F core. It was launched in 2014. The maximum clock is 216 MHz, static RAM is up to 1.4 MB, and Flash is up to 128 kB. It is fully pin-compatible with F4-series. It supports Thumb-1 and Thumb-2, Saturated, DSP, FPU instruction sets.
- STM32F4 was the first series of microcontrollers based on the ARM Cortex-M4F core. It was launched in 2011. The maximum clock is up to 180 MHz. It is the first series to have DSP and FPU. It also has faster ADCs, full-duplex I2S and an improved real-time clock. It supports Thumb-1 and Thumb-2, Saturated, DSP, FPU instruction sets.
- STM32F2 are microcontrollers based on the ARM Cortex-M3 core. It was launched in 2010. The maximum clock is 120 MHz, static RAM is up to 128 kB, and Flash is up to 1024 kB. It is fully pin-compatible with the F2 series. It supports Thumb-1, Thumb-2 and Saturated instruction sets.
STM32 Wireless
With STM32 Wireless ST adds in the portfolio a platform for wireless connectivity to the portfolio. It has a broad spectrum of frequencies and is used in various industrial and consumer applications.
It has features compatible with multiple protocols which allows it to communicate with different devices in real-time. Now, only two series belong to this group:
- STM32WB provides Bluetooth®LE 5.2 and IEEE 802.15.4 communication protocols, Zigbee® and Thread, which can work simultaneously or individually.
- STM32WL is the first series that support LoRa® communication.
So, that was all for today. I hope you have enjoyed today's lecture. In the next lecture, I am going to focus on the Nucleo Development board, as we are going to use that in our upcoming tutorials. Thanks for reading. Take care !!! :)
Ten Roofing Maintenance Tips For Lasting Roofline Results
Roofing issues can be overwhelming! Whether you have purchased a new home or have resided in a house for the past twenty years, roofing issues are here to stay. In most cases, these roofing issues include roof leaks, interior water damage, or missing shingles. These problems make roofing maintenance an imperative and attention-seeking job for many homeowners. Now, what to do in this case? Who to call? Well, there are many roofing maintenance firms out there, that can lend you a helping hand in resolving these issues. Also, some roofing maintenance tips can offer lasting results.
1. Examine Your Roof
While buying a new home or commercial space, your focus should be on the roof. The roof is the prime protective layer of your premises. Even if you have been living in the house for years, it is crucial to assess the condition of the roof periodically. Take a trip to your roof once a month. It would be better if experts inspect the roof and predict its life expectancy before you run around with a bucket for leaks.
2. Keep The Clutter Away
Though surrounding landscapes add beauty, the falling leaves and twigs can clog your gutter system. It would prevent proper drainage of rainwater or melting snow. Regular cleaning can avoid damage to your rooftop. While cleaning, you should prefer not to stand on your roof and keep a garbage bag or a bucket to collect all the debris. After picking up large pieces, wash your roof with a hose to flush out dirt. Trimming the trees is another option to minimize the natural debris.
3. Floss The Moss
Your haven cannot be at the mercy of moss. Lichen, moss, and algae need damp habitats to reproduce. Your roof becomes an ideal place for their growth. They have the potential to weaken your entire home. Once moss seeps between the shingles, it can damage the inside panel of the wooden beam that holds up your home. Since mosses have a persistent nature of returning, you would need a permanent professional solution.
4. Stimulate Ventilation
In the absence of proper ventilation, dampness and heat can aggravate roof rotting. The sheathing and rafting lose their effectiveness and threaten the protective layer of your home. It also increases the danger to your interior. Your roof can start seeing tiny holes, which can enlarge over time. Exposure to sufficient sunlight can nip the evil in the bud.
5. Roof Needs Sunscreen
The harmful UV rays and excessive exposure to the sunlight can devastate your roof lining. Speaking to a certified roof expert can mitigate the impact and provide an effective sunscreen solution for your roof.
6. The First Sign of Damage
Your roof is constantly attacked by the environment in the form of natural disasters, stormy weather, high temperatures, etc. Holes in the granules or discoloration of the shingles hint towards damage. The blistering shingles indicate that it is time for a replacement. Ignoring the first signs can lead to extensive damage and expensive repair work.
7. Trim The Trees
Though you love the greenery around you, your roof may not be fond of clinging tree branches. The overhanging branches can spell disaster for your roof. The trees may strike against the shingles and crush your roof during hurricanes and tornadoes. It would be a good idea to trim your trees to safeguard your roof.
8. Attic Insulation For Your Roof
Insulated rooftops lock in the heat during winters and prevent cool air from escaping your indoors during summers. It will help if you ensure effective insulation in and around your attic space. An insulated roof assures a healthier and more durable home that prevents ice damming, moisture build-up, etc.
9. Renew Flashing Seals
Weatherproofing your home is an integral part of roof protection. From time to time, your roof demands the replacement of caulking around the flashings, such as a chimney, vent pipes, etc. Withering caulks can lead to seepage and damage. Scrape the residues of the old caulk and apply new ones to seal the gaps.
10. Prepare For Winters
It is crucial to pay heed to roof maintenance at the onset of winter. Once it starts snowing, it would not be safe to climb up your roof. Your house may be exposed to bad weather if the roof gives in at any time during the winter season. You would have to wait for spring to begin with repair work.
Roof maintenance is serious work. You can take up the task yourself or contact the experts of roofing.
In Oil, New Health And Safety Standards Greet Industry Newcomers
The oil and gas industry is an intrinsically dangerous one. The nature of the work can lead to risks both for on-site workers as well as engineers and remote staff. As a result, Energy News asserts that fatalities and injuries on oil and gas fields are vastly underreported and that there may be a greater risk posed on such sites than ever previously thought. At the same time, advances in legal protections and engineering tools are making the job safer than ever - at least on a surface level. This is good news for engineers looking to carve out a career in the new world of eco-conscious hydrocarbon extraction.
Regulatory drive
Leading the charge towards better conditions for oil and gas workers is the US-wide litigation climate. Both on and off-shore, there are huge pushes towards making health and safety better for the numerous oil and gas workers in hydrocarbon states. Click2Houston highlighted the tragic death of one worker in Texas when a rig fell on him. During the July 2021 Houston oilfield accident lawyer action quickly brought restitution for the family involved, and in turn, brought in a greater level of health and safety scrutiny.
That level of scrutiny is being pushed at national and international levels. CNBC has highlighted how many oil and gas industry consultants are looking for novel ways at which to reduce gas flaring, a process estimated to produce 400 million tons of CO2 every year. Flaring in itself can be dangerous, and poorly monitored or delayed flaring can cause serious incidents. The curious note here is it’s not a direct engineering need that is pushing forward change, but rather the wider pro-environmental agenda being promoted by global governments. This is where novel engineering starts to make an impact.
Smaller impacts
In February, RigZone noted the expansion of wearable health and safety tech and how it was being issued to a wider range of rig employees. Manufacturer Transocean had developed the novel technology to provide a way for risk and repair contractors to undertake critical work while achieving it in a smart fashion - that is, safely, and with the absolute minimum interference both with the operation of the rig and the natural environment around it.
These devices are now brought into the wider engineering field upon rigs and offer a fantastic way for contractors to obtain assurance over their health and safety The usability of this technology is fairly expansive, and reaches down to the actual drill floor of rigs, for instance. This presents a way for engineers and contractors to ensure their safety - at least until perhaps the most fail-safe way of conducting work makes its mark.
The automated wave
Automation seems to be coming for jobs in every area of industry, and especially so in engineering. Manufacturers are already well acquainted with the huge benefits that robots and their ilk offer in factories across the world - they have truly revolutionized how businesses think about productivity and the safety and role of their workers within that. Now, automation is coming for oil and gas.
According to the Houston Chronicle, automation is set to replace hundreds of thousands of oil and gas engineering jobs. Where roles will be concentrated is, predictably enough, in engineering. Robots can complete much of the simple yet critical work undertaken by contractors, and the onus of the employee will instead be shifting towards engineers. Upkeep of robots and related devices, the continued development of them in line with machine learning and AI, and assurance over their suitability for the job, will be crucial. Achieving this, however, will tick a huge box in the world of health and safety. By taking human beings out of the firing line of risk and danger in the first place, you make huge strides towards an overall improvement in the industry. With automation set to make huge strides by 2030 at the latest, oil and gas businesses are well prepared for the disruption of this technology and the new focus it will place upon engineers performing maintenance.
That, of course, brings its own risks - every engineer knows about the inherent dangers of the shop floor and working with moving parts. However, it takes away a lot of the eminent risk posed by oil and gas, from simple incidents such as unstable, crushing devices, through to the explosions and blowouts experienced from time to time by rigs across the planet. The best way to reduce risk is to remove exposure, and the myriad of engineering tools and techniques being deployed to enhance the health and safety assessment system in oil and gas is helping with this to a great extent. That's good news for engineers entering perhaps one of the most exciting fields there is.
Quick-Turn PCB Prototyping Service
Hi friends, I hope you are enjoying yourself a lot and having a great deal of fun. Our mission is to help you by providing quality content that meets your expectations so now today we will discuss all quick turn PCB prototyping services. We will discuss what is quick-turn PCB? What is a PCB prototype? What is a quick-turn PCB prototyping service? Quick turn PCB general Capabilities provided by companies. Benefits, applications and importance of quick turn prototyping service. Online Quick-turn PCB service providers and time measurements. So, let's get started:
Overview
- First of all, before starting the discussion we have to know about the meanings of the words used in our topic heading.
- We have to make grip on the meanings of quick turn, PCB, prototype, and service. After understanding the heading of the topic we will be able to understand core concepts.
- Quick turn: quick turn means something or someone that does things with great speed. Day traders use the quick turn technique to make a great deal of profit.
- PCB: PCB stands for the printed circuit board. It is a combination of conductive and insulating layers to perform specific functions that meet the demands of customers.
- The prototype is defined as an original model on which something is patterned. It is an early sample product built to test a process or concept.
- Now prototyping is a fundamental process for designing a new product on which electrical components will be patterned.
- Service: service is a system that is used to provide utilities like providing PCBs to the provided/desired location.
What is a quick turn PCB?
- Now after understanding the meaning of each term used in the heading we have to understand what is quick turn PCB? What is PCB prototyping and then we will discuss what is quick turn PCB prototyping service?
- A quick turn PCB means that a customer has their PCB faster than ever before.
- A quick turn ensures that a customer doesn’t have to wait for their product so it reduces delays.
- A quick turn also ensures that the manufacturing time for the PCB is reduced.
What is PCB prototyping?
- A PCB prototyping is to help designers to determine if there are any faults in the original PCB.
- It helps to improve performance and enhance efficiency.
- As prototypes are crucial so it is very difficult to make changes in the PCB which is manufactured.
- Quick turn PCB prototyping service means that providing PCB prototypes to the customers at a very fast speed, without delay.
Online Quick turn PCB prototyping service providers:
There are some online quick turn PCB prototyping service providers available. The one I am going to recommend is
JLCPCB Fabrication House. JLCPCB provides this service of Quick-Turn PCB Prototyping for researchers so that they could test their projects in no time. Here are a few of the key points of this service provided by
JLCPCB:
- They provide 1-50 layer PCBs with PCB Order Quality < 1m2 within 24 hours, while normally it takes 2-3 days for accomplishing such tasks.
- For PCBs with order quality between 1m2-5m2, JLCPCB takes around 3-4 days, while the normal time range is 5-7 days.
Few other Quick-Turn PCB suppliers are:
- pcb4u.com
Location: Santa Clara
- pcbway
Location: china
Capabilities: preferred for minimum trace and hole size...etc.
- aipcba
Capabilities: PCB fabrication, SMT services, PCB assembly services.
- pcbunlimited
Location: US-based
Capabilities: US prototype PCBs, PCBs panel share, offshore PCBs, PCB design and layout services, PCB assembly services.
- pcbgogo
Capabilities: FIXME(minimum trace and hole size...etc)
6. Other Quick turn PCB prototyping service providers are:
- Homebrew fabrication
- Breadboard killer
- Foundation technology
- Linksprite
- Kingfield electronics- CEM services
- Apex
- Cadsoft Eagle
- Exception group
- Bittele electronics
- Technotronic
- 4pcbassembly
- Sinomicro PCB
- Asian circuits
- Standard printed circuit board limited
- PCB train
- Euro circuit.....etc
PCB Capabilities - Quick-turn PCB
- Providing PCB prototypes within 24-72 hours is the quick turn PCB prototyping service.
- Companies do not have to look eye only at providing PCB at a fast rate but they don’t have to compromise on the quality of the product.
Items |
General Manufacturing Capabilities |
Companies general Remarks |
How many layers |
1-10 layers |
For orders above 10 layers, contact to company. |
Material |
Aluminium or RF-4 |
For Flex, Rigid-flex, Metal-based (Aluminium etc.,), HDI, Halogen-free, High Tg, etc. |
Maximum dimensions of PCB |
500*1100mm (min 5*6mm) |
For any size Greater than these Standard dimensions customers have to contact to the company |
Tolerance in board size |
±0.2mm/±0.5mm |
±0.2mm for CNC routing, and ±0.5mm for V-scoring. |
Thickness of the board |
0.2-2.4mm |
0.2,0.4, 0.6, 0.8, 1.0, 1.2, 1.6, 2.0, 2.4mm. For other thicknesses, customers have to contact to company. |
Tolerance in the thickness of board |
±10% |
Normally “+ Tolerance” will occur due to PCB processing steps such as solder mask, electroless copper and other types of finish on the surface. |
Board Thickness Tolerance(t<1.0mm) |
±0.1mm |
Minimum manufactural Trace |
0.1mm |
Min manufactural trace is (0.1mm), To save cost design trace should be above 6mil(0.15mm) |
Min Spacing |
Min manufactural spacing is 0.1 mm. To save cost it should be 6mil(0.15mm) |
Thickness of outer copper layer |
1oz/2oz/3oz(35µm/70µm/105µm) |
Also known as copper weight. 35µm=1oz, 70µm=2oz, 105µm=3oz. For copper weight greater than 3oz customers have to contact the company. |
Thickness of inner copper layer |
1oz/1.5oz(35µm/50µm) |
Inner copper weight as per customer’s request for 4 and 6 layers is 1-1.5 oz. |
Drill Sizes |
0.2-6.3mm |
Min hole size is 0.2mm, max drill size is 6.3mm. Any holes greater than 6.3mm or smaller than 0.3mm customer will have to pay extra charges. |
Annular Ring’s minimum width |
0.15mm(6mil) |
Min width for Annular Ring is 0.15mm(6mil), for pads with vias in the middle |
Diameter of finished hole |
0.2mm-6.2mm |
The final hole diameter will be smaller than the size of the drill because of copper plating in the holes. |
Tolerance of finished hole size |
±0.08mm |
For example, if the drill size is 0.8mm, the finished hole diameter ranges from 0.72mm to 0.88mm will be considered acceptable. |
Solder Mask |
LPI |
Liquid Photo-Image able is the most adopted. Thermosetting Ink is used in the inexpensive PCBs |
Width of minimum character |
0.15mm |
Characters of less than 0.15mm wide will not be Identify easily. |
Height of minimum character |
0.8mm |
Characters of less than 0.8mm high will be too small to be identified. |
Width to Height Ratio of character |
1:5 |
In PCB silkscreen legends processing, 1:5 is the most suitable ratio for character width to height. |
minimum diameter of PHH( plated half holes) |
0.6mm |
Design Half-Holes greater than 0.6mm for better connections. |
Surface Finishing |
HASL with lead
HASL lead free
Immersion gold |
These are the tree most popular types of surface finish. |
Solder Mask |
Black, yellow, white, blue, green, red |
No extra charge (Green, Red, Yellow, Blue) |
Silkscreen |
White, Black and None |
No extra charge. |
Panelization |
Tab-routing with Perforation (Stamp Holes)V- scoring
Tab-routing |
For break-routing min clearance between boards should be 1.6mm and for V- scoring it should be zero. |
Others |
UL certificate, Fly Probe and A.O.I. testing, ISO 9001:2008 |
No extra charge. |
Quick turn PCB service types:
PCB manufacturing service providers provide PCB quick turn services as
- 1-day quick turn PCB prototype
- 2 days quick turn PCB prototype
- 3 days quick turn PCB prototype
- 5 days quick turn PCB prototype
- 10 days PCB standard PCB prototype
- > 10 days PCB prototype.
Benefits of quick turn PCB prototyping service:
- Why do designers rely on prototypes instead of making a standard product? The answer to this question is that the prototype allows designers to test the functionality of the product in the design process at several stages and allow them to make adjustments according to their needs.
- Prototyping creates several advantages for customers and manufacturers as
1. Reduced timeline:
PCB prototypes help designers to complete their final product in these ways by saving their time.
- PCB prototypes complete the testing process at a fast rate. Without prototypes, flaws will waste a lot of time, lost revenue, and make a customer unhappy.
- PCB prototypes also save time by providing visual assistance to clients during the production process.
- At several stages, Prototypes help in testing before a full production run and save not only time but also minimized rework.
2. Reduced costs:
Prototypes help in reducing cost by avoiding the following issues:
- Catching design flaws
- Pinpointing cost-saving adjustments.
- Determining product adjustments.
3. Test components individually:
Designers use PCB prototypes for testing purposes. Most beneficial testing is achieved by testing simple PCBs. This type of testing is used to achieve the purposes listed below
- Testing design theories
- Breaking down complex designs.
4. Accurate reliable prototype:
Accurately designed reliable prototypes help throughout the designing and manufacturing process. Quality PCB prototypes allow designers to test the following aspects:
- PCB design
- Functional testing
- Conditional testing
- Final product design
5. Manufacturing review and assistance:
Using third party PCB prototyping services companies gain benefits but several things can go wrong in the design process that results in mistakes listed below:
- Excessive input
- Design blind spots
- Design rule check
Applications of quick turn PCB prototype:
Quick turn PCB has several applications in different industries. The applications in different scenarios are listed below:
- Electronic designers who require high-quality boards use quick-turn PCB prototypes.
2. PCB assembly manufacturers designs products for the mass market use quick turn PCB prototypes to fulfil the needs of the market.
3. Designers also need to work on new ideas so they use quick turn PCB prototypes.
4. To provide the investors and clients the samples of their products designers need to show quick turn PCB prototypes.
Importance of quick turn PCB prototyping service:
- The role of PCBs in the best performance of electronic devices can not be denied.
- Electronic devises based companies heavily depend upon PCB prototyping firms and their efficiency of fabrication.
- However, to meet challenging deadlines, pressing schedules, and excellent quality PCB manufacturing, quick turn PCB prototyping service plays a crucial role.
- Let’s know-how companies benefit from their quick services and attain their business goals.
- By providing quick turn services, companies increase their number of customers.
- For the projects that need to be completed in a very short time, companies charge extra amounts. To attain the goals of extra profit, and everything related to PCB manufacturing should be perfect.
- By providing reference prototyping services, companies built a trust relationship with their customers.
- Listed above are the benefits/ importance for companies providing quick turn PCB prototyping service. Quick turn PCB prototyping service is not only beneficial for companies but also for clients. Here is the importance of quick turn PCB service for customers.
- By obtaining their prototype according to their demands, customers can complete their projects on time.
- Customers do not have to waste their time in transportation and searching for PCB, they just have to order PCB and mention their requirements. Their desired PCB will be at their door.
- There are also some cost benefits to customers in this service.
Quick turn PCB prototyping service time measurement:
- When an order is placed in the morning like at 9:00 am then at next business day noon, 1 day is completed and from noon after 24 hours, 2nd day is completed from your order.
- If an order is placed at 12:00 am then after 24 hours, 1 day will be completed. And next days will be counted similarly.
- For orders placed after 4:00 pm lost much of their time so placing late time orders is not suitable.
Conclusion:
When we think about PCB prototyping, it seems an additional step that will enhance the PCB cost and we consider it one that never is overlooked. But the reality is that it is best to weed out errors, flaws, and faults before proceeding to the final product. Prototyping helps in reducing cost, provides us with quicker turnaround time, and provides you with more efficient design. Now designers always prefer prototypes before developing new innovative ideas as well. They know about the value of time, cost and quality so suggest to students, engineers, and innovators to use prototypes. In the end, we can say that the value of PCB prototypes can not be neglected, they are as fruitful and helpful as standard PCBs.
That’s all for today’s article. I hope you have enjoyed the article and make grip on the understanding points. However, if you still face any skepticism regarding single-layer PCB then please feel free to leave your questions in the comment section. I will provide an answer to these questions to the best of my knowledge and researching skills. Also, provide us with your innovative feedbacks and suggestions you improve the quality of our work and provide you content according to your needs and expectations. Stay tuned! Thank you for reading this article.
C++ Variables & Constants
In the previous topic, we have discussed data types in C++ in detail. Today we will discuss variables and constants in C++.
A named memory location or memory cell is called a variable. The program's input data and its results are stored in variables during execution. During the execution of the program, the value of a variable can be changed but its name can not be changed.
Variables are created in random access memory. As we know that RAM is a temporary memory so data stored in it is also temporary. It can only be used during execution. When the program ends, the data stored in the variable is automatically removed.
In C++, all the variables are declared first:
- Name of variable: an identifier that represents a memory location.
- Address of variable: memory location of the variable.
- Contents of variable: the value stored in a memory location.
Variable Declaration:
- Variable declaration is the process of specifying the name and the type of variable.
- Before a variable is used, it can be declared anywhere in the program before its execution.
- Information is provided to the compiler about the variable by variable declaration.
- The compiler determines the memory required for each variable.
- After the declaration, the required memory of bytes is allocated to variables.
- Once the variable is declared then its name and data type can not be changed but its value can be changed during execution.
- For example, an integer required 2 bytes of memory but a character required one byte of memory. During execution int and char data types can not be changed but integer value can be changed from 5 to 9 and character can be changed from ‘f’ to ‘g’.
SYNTAX of declaring a variable in C++
- data-type: type of data that is stored in a variable.
- variable-name: tell us about the memory location of the variable.
For example:
int num1=25, num2=1000;
We can also write it like this:
int num1,num2;
num1=25;
num2=1000;
Types of Variables
Types of Variables can be categorized in two ways
- Types of variables regarding data types
- Types of variables regarding the scope
Types of variables regarding data type:
Based on the data type of variable, there are the following categories of variables in C++
- int: holds an integer value i.e. 1, 2, 3, 50 etc.
- char: holds character values like ‘c’, ‘F’, ‘B’, ‘p’, ‘g’, ‘q’ etc.
- bool: holds boolean value true or false(0 or 1).
- double: holds double-precision floating-point value.
- float: holds single-precision floating-point value.
Example
Different types of variables can be declared as follow:
- int marks;
- float average;
- char grade;
- double salary;
Variables having the same data type can be declared in a single line. Each variable in line should be separated by a comma as follows:
int a, b, c;
Types of variables regarding scope
When we discussed the Hello Program, we have seen the curly braces in the program like this:
int main {
//Some code
}
When variables are declared in curly braces then their scope is limited within these braces. The variable declared in main() function can not be used outside the main() function.
There are two types of variables based on their scope.
- Global variable
- Local variable
Global Variable
Global variables are always declared outside of any function.
- Their scope is in the complete program so can be accessed anywhere in the program.
- Can be accessed in the main() function, in the user-defined function and anywhere in the program.
Global variable example
Let us have a global variable myvar and it is declared outside of main. We can access the variable twice in the main() function easily.
#include <iostream>
using namespace std;
// This is a global variable
char myvar = 'G';
int main()
{
cout <<"Value of myvar: "<< myvar<<endl;
myVar='m';
cout <<"Value of myvar: "<< myvar;
return 0;
}
Output:
- Value of myvar: G
- Value of myvar: m
Local variable
- They are declared inside the curly braces of any loop or control statement, main function, user-defined function and their scope is limited only to the curly braces so they can be used only within the curly braces.
Local variable example
#include <iostream>
using namespace std;
char myFuncn() {
// This is a local variable
char myVar = 'X’;
}
int main()
{
cout <<"Value of myVar: "<< myVar<<endl;
myVar='H’;
cout <<"Value of myVar: "<< myVar;
return 0;
}
Output:
- As we are trying to access the variable outside its scope so a compile-time error will occur.
- Local and global variables may or may not have the same name.
- We can see an example having the same name for local and global variables.
#include <iostream>
using namespace std;
// This is a global variable
char myVar = 'X';
char myFuncn() {
// This is a local variable
char myVar = 'Y’;
return myVar;
}
int main()
{
cout <<"Funcn call: "<< myFuncn()<<endl;
cout <<"Value of myVar: "<< myVar<<endl;
myVar='A';
cout <<"Funcn call: "<< myFuncn()<<endl;
cout <<"Value of myVar: "<< myVar<<endl;
return 0;
}
Output:
Funcn call: X
Value of myVar: Y
Funcn call: X
Value of myVar: A
As the scope of the local variable is limited so the changed value of the variable is only responded for the global variable and the value of the local variable remained the same ‘ X’.
RULES FOR DECLARING VARIABLES:
There are some rules in C++ for naming variables
- Variable can be a letter, number and underscore(-).
- Variable’s first letter should be a letter or underscore. The variables 6second, $6payment and 5kg are invalid.
- In the variable name, blank spaces can not be added. ‘ my var’ is an invalid variable.
- Both upper and lower cases can be used. User-defined variables are written in lower and constants are written in upper case conventionally.
- special symbols can not be used in variables as a name.
- Reserved words can not be used as a variable name. e.g int, for, while etc can not be used as a variable name.
- The no of characters in the variable should not be more than 31.
- A variable can not be declared for more data types. It should be declared for only one data type.
Variable declaration vs variable definition:
- The variable declaration tells us about the part where the variable was first declared before its use.
- While variable definition tells us about that part where variable assigned memory location and value
- Variable definition and declaration did at a time mostly.
#include <iostream>
using namespace std;
int main()
{
// declaration and definition of variable 'b123'
char b123 = 'a';
float b;
// multiple definitions and declararions
int _c, _d45, e;
cout << b123 << endl;
return 0;
}
Variable Initialization:
Variable initialization is the process of assigning a value to the variable.
- = sign is used to initialize a variable
- The variable name is written on the left side of = and the value is given on the right side of =.
- Compiler allocated some memory to the variable when it is declared.
Syntax
type_ name variable=value;
- type_name: indicates the data type of the variable
- variable: name of the variable
- = assignment operator used to initialize a variable
- value: value to initialize a variable
Example
#include <iostream>
using namespace std;
int main() {
int a = 10;
int b;
cout << " value of variable a : "<< a; // static initialization
cout << "\nEnter the value of variable b : "; // dynamic initialization
cin >> b;
cout << "\n value of variable b : "<< b;
return 0;
}
Output
value of variable a : 10
Enter the value of variable b : 18
value of variable b : 18
CONSTANTS IN C++
- Constants are those quantities that cannot be changed during program execution.
- It is used in the program wherever it is needed.
There are two common types of constants in C++
- Literal constant
- Symbolic constant
Literal constant
It is typed directly in the program and used when needed.
Example
The following statement contains "Hi guys" string literal constant.
Age is an integer variable and 19 is a literal constant.
TYPES OF LITERAL CONSTANTS:
There are 5 common types of literal constants are used in C++
- Integer constant
- Floating-point constant
- Character constant
- String constant
- Bool constant
Integer literal constant
It can be a decimal, hexadecimal or octal constant.
Examples:
- 85 // decimal
- 0213 // octal
- 0x4b // hexadecimal
- 30 // int
- 30u // unsigned int
- 30l // long
- 30ul // unsigned
Floating-point literals
Floating-point literal constant contain four parts
- Integer part
- Decimal part
- Fractional part
- Exponent part
Decimal forms include a decimal point, exponent or both. Exponent forms include integer part, fractional part or both
Examples
- 3.14159 // Legal
- 314159E-5L // Legal
- 510E // Illegal: incomplete exponent
- 210f // Illegal: no decimal or exponent
- .e55 // Illegal: missing integer or fraction
Character constants
- These constants are enclosed in single quotes
- Upper case letters are stored in wchar_t type and lower case letters are stored in char type
- A character literal can be a simple character (e.g., 'x'), an escape sequence (e.g., '\p’), or a universal character (e.g., '\u0C0').
- The characters with backslash have special meanings. These characters with a backslash are given below.
Escape sequence |
Meaning |
\\ |
\ character |
\' |
' character |
\" |
" character |
\? |
? character |
\a |
Alert or bell |
\b |
Backspace |
\f |
Form feed |
\n |
Newline |
\r |
Carriage return |
\t |
Horizontal tab |
\v |
Vertical tab |
\ooo |
Octal number of one to three digits |
\xhh . . . |
Hexadecimal number of one or more digits |
Example
#include <iostream>
using namespace std;
int main() {
cout << "Hello\tWorld\n\n";
return 0;
}
Output
Hello World
String constants
They are enclosed in double-quotes. It may contain
- Characters
- Escape sequence
- Universal character
String literals are used to break long lines into multiple lines.
Examples
"hello, dear"
"hello, \
dear"
"hello, " "d" "ear"
Program for defining a constant
#include <iostream>
using namespace std;
#define VAL1 20
#define VAL2 6
#define Newline '\n'
int main()
{
int tot;
tot = VAL1 * VAL2;
cout << tot;
cout << Newline;
}
Programs
#include <iostream>
using namespace std;
#define LENGTH 5
#define WIDTH 20
#define NEWLINE '\n'
int main() {
int area;
area = LENGTH * WIDTH;
cout << area;
cout << NEWLINE;
return 0;
}
Program # 2
#include <iostream>
using namespace std;
int main()
{
const int SIDE = 40;
int area;
area = SIDE*SIDE;
cout<<"The area of the square with side: " << SIDE <<" is: " << area << endl;
return 0;
}
Bool constants
Three keyword literals exist in C++: true, false and nullptr:
- For Boolean variables, we have true or false literals/ constants.
- nullptr indicates the null pointer value.
1
2
3 |
bool foo = true;
bool bar = false;
int* p = nullptr; |
Symbolic constants
- It is the Symbolic name given to the Symbolic values that cannot be changed
- A Symbolic constant PI having the value 3.141593 is used where needed and its value can not be changed.
There are two ways by which Symbolic constants can be derived.
- const Qualifier
- define Directive
The syntax for const Qualifier
const <Data_Type> <Variable_Name>
The syntax for define directive
<Return_Type> <Function_Name>() const
Example
#include <iostream>
using namespace std;
const int a = 100; // Const Variable
class TestConst
{
public:
void display() const // Const Function/ define directive
{
cout << "Value of a in the const function is " << a;
}
};
int main ()
{
Test int1;
int1.display();
cout << a;
return 0;
}
Comparison table for Constants and Variables
We have discussed above the clear understanding of variables, their types and some programs to make grip on the topic. We have also discussed constants and their types and some programs to make ideas clear. At the end, we make a clear comparison between constants and variables.
In the next section, we will discuss operators, expressions and comments in C++. Till then take care and have fun. Thanks for reading.
C++ Data Types
In the previous section, we have had an overview of a detailed Introduction to C++. Today, we will have a look at the data types in C++. It's our 2nd tutorial in the C++ programming language series.
In the previous tutorial, we have seen the basics of C++ and have also discussed a small code. We have discussed various programming terms in the previous tutorial and from now on, we are going to discuss those terms in detail. So, today's lecture is on Data Types in C++, let's get started:
C++ Data Types
A data type defines the type and the set of operations that can be performed on the data. Various types of data are manipulated by the computer. The data is given as an input to the program. According to the program's set of instructions, data is processed and then output is returned on the screen. Before designing the actual program data, its type and operations performed on it are defined and used to process the data. At the start of the program, the type of each data value is identified. Various data types are provided by C++ and the computer’s memory allocates each data type differently.
Types of data types in C++
- Built-in data types
- derived data types
- user-defined data types
Built-in Data Types in C++
- Integral, floating-point and void data types are provided by C++ as built-in data types.
- The integral and floating-point data types can be treated with different types of modifiers.
- The size or range of data type is changed by using these modifiers.
- Short, long, signed and unsigned are various modifiers.
Three main built-in data types provided by C++ are:
1. Integral data type
- Integer data type: keyword int is used to express integer data type.
- It normally requires 4 bytes of memory and ranges from -2147483648 to 2147483647.
long b = 4523232;
long int c = 2345342;
long double d = 233434.56343;
short d = 3434233; // Error! out of range
unsigned int a = -5; // Error! Used for storing only +ive numbers and 0
Example
Character data type in C++
- Characters are stored by using character data type.
- Char is used to representing character data type.
- It normally requires 1 byte of memory.
- char test = 'h';
- As each character is assigned by a unique ASCII code which is an integer so that’s why characters are included in integral data type.
- When we store a character in memory, we actually store a unique numeric code associated with that character in memory.
- And when the computer is instructed to print characters, it basically prints characters associated with the numeric code.
- Here's the chart showing ASCII codes of alphabetical characters:
2. Floating data types in C++:
- Variables holding real numbers are defined by using floating-point data type. In C++ three data types are used to represent floating-point numbers.
- float
- double
- Long double
float area = 64.74;
double volume = 134.64534;
- Values having floating-point types are expressed in terms of precision and range.
- The accuracy in the fractional part of the value is precision.
- Range: it is for the range of fractions and numbers.
- The floating point number is stored as mantissa E or the power of 10.
3. Void data type
- The meaning of void is without any value and is used where functions do not return any value.
- A function does not take any argument when the void is used to define an empty parameter list and a function does not return any value when it is used to return value to the function.
- 0 bytes of memory is allocated to it and hence it cannot store anything. As a result, it cannot be used to declare simple variables but it can be used to define generic pointers.
C++ Void Pointer
#include <iostream>
using namespace std;
int main() {
void* ptr;
float f = 2.3f;
// assign float address to void
ptr = &f;
cout << &f << endl;
cout << ptr << endl;
return 0;
}
Output
0xffd117ac
0xffd117ac
Bool and wcha_t:
- In C++, Boolean and wide-character data types are also used.
- Boolean values are defined by bool data type.
- Bool data type contains only 2 integers 0 and 1.
- False is represented by 0 and 1 is used to represent true.
- Only 1 bit of storage is required by bool data type.
- As it is stored as an integer so it can be considered as an Integral data type. The results of logical operations performed on data are represented by the bool data type.
bool cond = false;
- In addition to char data type, wchar_t is used to store 16- bit wide characters in C++. Large character sets are allocated with non-English languages so wchar-t is used to store wide characters.
wchar_t test = $# // storing dollar and hash character;
User-Defined Data Types in C++
C++ provides various user-defined data types
- structures,
- unions,
- enumerations and
- classes.
Structure, Union and class
Important features of the C language are structures and unions. Similar or dissimilar data types assigned a single name are grouped by structure and union. However, in C++ the concept of structure and union is modified by adding some new features to provide support to object-oriented programming.
Class is defined as a new user-defined data type by C++ and it forms the basis of object-oriented programming. A class functioned as a template that can be used to define the data and functions that are included in an object of a class. Classes are declared using the keyword class. The object of the class can be created when the class is declared.
Enums in C++
A set of integer constants that are named and specify all the values that can be assigned to variables Enumerators are the set of these permissible values. For example, consider the statement.
enum Colour{red, green, blue, white}; // declaring an enum type
- In this statement, an enumeration data-type color (Colour is a tag name), consisting of enumerators red, green, blue and white is declared.
- These enumerators represent only integer values, so any arithmetic operation can be performed on them.
- By default, the first enumerator in the enumeration data type will have the value zero.
- The value of the next enumerators is increased by one. Hence,
- the value of red is 0,
- the value of green is 1
- the value of blue is 2 and
- the value of white is 3.
We can also assign values explicitly to enumerators as shown here.
enum country {US, UN=2, India, china} ;
- Value for the US is 0 by default in this declaration
- the value of UN is 2
- Russia is 3 and
- China is 4
When enum is declared then its variables assign the values specified in enum.
country country1, country2;
For example, consider these statements.
- Country1 Pakistan; // valid
- country2 China; // invalid
Int data types can not be assigned to enumerators because they are treated as integers.
Derived Data Types in C++
Derived data types are derived from built-in data types. C++provide 4 major derived data types that are
- arrays,
- Functions,
- references and
- pointers.
Array
- The set of elements having the same data type and same name formed an array.
- In memory, all the elements are stored one after another location.
- An index or subscript is used to access an element.
- The position of the element is indicated by the subscript value.
Declaring Arrays:
- Syntax to declare a one-dimensional array:
//intExp indicates number of elements
dataType arrayName[intExp];
//declares array num containing 4 elements of type int:
//num[0], num[1], num[2],and num[3]
int num[4];
Accessing Array Elements:
- Syntax to access array element:
// intExp is used to specify position
array Name[intExp]
//fourth element in array num
num[3];
One dimensional array example
- Initialize
- Input
- Output
- Sum and Average
- Find largest element value
- Find the smallest element value
// name of the constant is initialized
const int arraySize=5;
double list[arraySize];
//initialize 7 variables
int i=0;
double smallest=0.0;
double largest=0.0;
double sum=0.0;
double average=0.0;
int maxi=0;
int mini=0;
//1. Array us initialized
for (i=0; i < arraySize; i++)
list[i]=0.0;
//2. Give value for each element in array list, beginning w/first element
for (i=0; i < arraySize; i++)
cin >> list[i];
//3. Resulted value for each element in array list, beginning w/first element
for (i=0; i < arraySize; i++)
cout << list[i] << " ";
//4. Sum and Average elements in array list, and display
for (i=0; i < arraySize; i++)
sum = sum + list[i];
average = sum / arraySize;
cout << "Sum = " << sum;
cout << "\nAverage = " << average;
//5. find largest element value in array list, and display
for (i=0; i < arraySize; i++)
if (list[maxi] < list[i])
maxi = i;
largest = list[maxi];
cout << "\nLargest = " << largest;
//6. find smallest element value in array list, and display
for (i=0; i < arraySize; i++)
if (list[mini] > list[i])
mini = i;
smallest = list[mini];
cout << "\nSmallest = " << smallest;
Function in C++
- The function is used to carry out a specific well-defined task. It is a self-contained program segment.
- In C++ one or more functions can be used in a program and can be invoked from the other parts of the program when needed.
#include <iostream>
using namespace std;
int fact(int n); // function prototype
int main(){
int nv,ans;
cout<<" Input n:";
cin>> nv;
ans = fact(nv);// calling a function
cout<<"Answer is:"<<ans<<endl;
}
int fact(int n){ // int to another int
int ans =1;
for(int i= 3; i<= n; i++)
ans *=i;
return ans are; // function providebanswer to the caller
}
function prototype, calling main program and the complete function definition shown in the above program
C++ Reference
The alternate name of the variable is a reference. So we can say that a reference is an alias for the variable in the program. Both variable and reference allocate the same memory location so they can be interchangeably used in a program. When we make changes in variables, these changes are also made in reference and vice versa. – reference type variable in C++ is treated as a constant pointer that can be dereferenced.
- Constant reference type variable must be initialized first and can not be used as a reference to other variables.
- Ampersands (&) are used with reference type variables. For example,
int result = 0;
int &ref_result = result;
…
ref_result = 100;
C++ Pointers
- The variable which can be used to store the memory address of another variable is called a pointer.
- Memory is used dynamically by pointers.
- In run time, memory can be allocated and de-allocated with the use of pointers which increases the efficiency of the program.
- Assignment and dereferencing are two major operations performed by pointers. Assignment operation assigns a value to the pointer and dereferencing takes reference by indirection technique.
- If ptr is a pointer variable with the value 7080, and the cell whose address is 7080 has the value 206, then the assignment j = *ptr sets j to 206.
- The assignment operation j = *pta
- Pointers should be used with care because they are flexible.
- Used for management addressing and dynamic storage.
- Pointer arithmetic in C++ makes them more interesting than other programming languages.
- The asterisk (*) is used for dereferencing operation, and the ampersand (&) for producing the address of a variable. For example, in the code
int *ptr;
int count,
init;
…
ptr = &init;
count = *ptr
- single assignment statement can take place the value of two assignment operators.
count = init;
Example: Pointer Arithmetics in C++
int list[10];
int *ptr;
ptr = list;
- *(ptr+5) is equivalent to list[5] and ptr[5] *(ptr+i) is equivalent to list[i] and ptr[i] –
- Domain type is not needed to be fixed.
So, that was all for today. I hope you have enjoyed today's lecture. In the next tutorial, we will discuss the variables and constants in C++. Stay tuned !!! :)
WiFi Temperature Monitor with ESP8266 and DS18B20
Hello friends, I hope you all are doing great. Today, we will create a wifi temperature monitoring system. For reading, we will use the DS18B20 sensor. For data processing and webpage creation, we will use our already known ESP8266.
The project will be built as follows:
- Circuit assembly
- Code for reading the DS18B20 sensor (we will use Serial for tests).
- Creation of the webpage (we will use SPIFFS to store in FLASH).
But first, let's know a little about the sensor and the communication model it uses.
Where To Buy? |
---|
No. | Components | Distributor | Link To Buy |
1 | ESP8266 | Amazon | Buy Now |
Materials
For this project, we will need the following items: For this project, we will need the following items:
- 1 x ESP8266
- 1x DS18B20 Sensor
- 1x Breadboard
- 1x 4k7 Ohms resistor
DS18B20
- DS18B20 is a digital temperature sensor with good precision, good customization, practical use, reliable and low cost. Good combination?
- The sensor monitors temperatures in the range: -55°C to +125°C (-67°F to + 257°F), with an accuracy of +-0.5°C in the range -10°C to +85°C (outside that range, this inaccuracy increases, but nothing absurd).
It uses three pins for operation:
- VDD (Power Supply)
- GND (Ground)
- DQ (Digital Communication)
VDD operates with values from 3V to 5.5V and can even be omitted. The sensor has a Parasite Mode, using only the DQ and GND pins, and its power comes from the communication pin. This mode works well but is more susceptible to noise.
Data communication takes place over the 1-Wire (OneWire) protocol, using the DQ pin. We'll discuss the protocol later, but now it's important to know that, despite having only one wire, it allows two-way communication.
The reading is performed actively, the microcontroller sends a command and receives back a packet with the information.
In addition to the reading request, the sensor can also receive alarm configuration and data format commands. The DallasTemperature library already handles most of this for us. Including offering us some additional features, such as receiving reading in Faraday.
The most common models on the market are found in the TO-92 package (looks like a transistor) and the waterproof package. This second is more common due to its practical application, 1m long cable with stainless steel tip. It can be used to control water temperature, for example. The reading is performed actively, the microcontroller sends a command and receives back a packet with the information.
In addition to the reading request, the sensor can also receive alarm configuration and data format commands. The DallasTemperature library already handles most of this for us. Including offering us some additional features, such as receiving reading in Faraday.
The most common models on the market are the TO-92 package (looks like a transistor) and the waterproof package. This second is more common due to its practical application, 1m long cable with stainless steel tip. It can be used to control water temperature, for example.
OneWire
OneWire (or 1-Wire) is a communication method designed by Dallas Semiconductor that transmits data using just one line, with a system of signaling who sends and when.
The method is very similar to i2C, but it has a much more limited data transfer speed. Another difference is that in the 1-wire case, it is possible to omit the power pin, using the data pin in parasite mode (by now, you may have noticed that despite the name, the method needs at least two wires: Data and GND).
Communication is done in master-slave mode, in which the microcontroller sends all requests, and the other devices only send data when nominally requested.
Each device has a unique address/name. This allows us to connect multiple devices on the same data line. The requests are sent in broadcast, the device that recognizes itself in it responds.
Circuit
The circuit for our application is simple. We will connect the VDD pin of the sensor to the 3V3 of the NodeMCU, GND with GND, and we will use the D4 pin for the sensor data. It could be any other digital pin.
Additionally, a 4k7 ohm resistor must be placed between the data pin and the 3V3 to increase stability.
Finding the DS18B20 address
As we saw earlier, each sensor has a unique address and, this address is essential for communication. We can understand this as a manufacturing serial number. But how to identify this number?
We will create a helper code to find this address. In this case, the code scans any devices connected to pin D4. We will use the Serial Monitor to visualize the result.
We started with importing the OneWire and DallasTemperature libraries (do not forget to maintain order). If any import error occurs, you can add them to Arduino IDE's library manager.
Next, we start a OneWire object on pin D4 and create a sensor using that object. From that moment on, the “sensors” object has all the properties and functions offered by the DallasTemperature library.
And we will make use of two functions Search(), which performs a search for devices in OneWire, and reset_search() which restarts this search.
What our code does is start a search, save the result in the addr variable and, if the variable is not empty, write it in the serial.
We found the result on the Serial Monitor. If there are other devices, they will appear here too. Keep the address, we'll need it.
Sensor reading by Serial Monitor
Now that we know the sensor's address. Let's start our main code for reading the temperature. The objective here is to start the sensor and take a reading every 10s.
We started in the same way, but this time we created the sensor1 variable with the collected address.
In the readDs18b20() function we will use two functions:
- requestTemperatures() - This function does not specifically communicate with any sensors, but with all. It's like it says: If you're a ds18b20, run a new read now and wait for my ” And what the sensor does.
- getTempC(address) - Here we send information directed to each sensor of interest, which responds to us with the last reading
Inside the Setup() function we started the sensor with the begin() function, it performs a reading automatically, if you didn't make new requests, the sensor would still respond to the getTemp() function, but with an outdated value.
In the loop, we have a timer with the millis() function so that the reading takes place every 10s.
On the serial monitor, we should get the following result:
Note that on line 15, we added one more parameter to the Serial.println() function. With that, we define the number of decimal places.
Creating the monitoring page
With our reading ready, let's create a web page to view this information in the browser. Remember that later we will put these files in FLASH ESP8266 with SPIFFS.
We will build the following screen:
And for this, we will use two files:
The page structure is not the focus of this article, but basically, we have the index.html file creating the page itself and triggering a javascript function to update the reading.
The style.css file improves the appearance of the page but does not interfere with its functioning.
Both files must be in the data folder within the project folder and be transferred using the ESP8266 Sketch Data Upload.
Complete Code
With the page saved to FLASH, we need to create the structure to serve the page.
- Connect on wifi
- Create a web server
- Create call-backs for requests to this
This step is nothing new for us, but it is worth noting a few points.
Now the readDs18b20() function also updates a variable of type String. We do this because server call-back functions do not accept integer or float variables.
For the server, we have three routes:
- “/” will send the html file with the latest sensor reading.
- “/styled.css” will send the css file
- “/state” will return the temperature variable to be updated.
Conclusion
The DS18B20 is an extremely efficient and easy-to-use sensor. The application we developed today could be used to monitor the ambient temperature, or perhaps the temperature of a water reservoir. And the ESP8266 extends the range of that monitoring as far as we want.
The technology behind Online Casinos
Hello friend! I hope you all are very well and satisfied with our services of new innovative articles. Our mission is to provide the best quality content which can fulfill all the demands and requirements of everyone. So to achieve our goal, today we will provide you with a detailed article on The Technology Behind Online Casinos. We will discuss the overview, Evolution of online casinos, types of online casinos, tools, and infrastructure used in the development of online casinos, data sources of online casinos, providers of online casino games, the technology behind the security and fair play of online casino, the technology behind the optimization of online casinos, the technology behind online payment methods of online casinos, mobile-friendly casinos, why do people favor online casinos, advantages and disadvantages of online casinos, the importance of online casinos, requirements for playing games at online casinos like Indiacasinos.com and the end we will discuss the conclusion. So to finally make grip on the topic let’s dive into it.
Overview:
- For online casinos, technology plays its role as a backbone.
- Gambling sites can not be enjoyed very well without convenient programming languages, design software, and advanced graphics.
- Most of the casinos do not design gaming software but hire Partners to design games for them.
- Engineers chime in with hardware installments, soundtrack, and the coding work to make modern slots addictive.
- Sometimes goggles and helmets are used to enjoy the feelings of real casinos.
- Accounts of users are made secure with the help of end-to-end encryption technology.
- Fair play is maintained by RNG technology.
- Optimization is done on regular basis to attract more users and provide them with the best online gaming environment.
- Skrill, PayPal, Verve, and other methods are used to withdraw the win money.
Evolution of online casinos:
- Most gaming masters play games to relax their minds or to get money.
- In past, they have to go to the local casino halls to fulfill their acquisition but with the advent of technology, they can now play casino games at home only.
- The Internet combined with micro-gaming and a new version of games formed called online gambling. At the start, many free software’s were provided by the developers. After that to make online gambling famous, the pioneer and E-commerce technologies are introduced to make financial transactions.
- Faster and larger jackpots are now available to people with the development of the internet.
- So many online casinos are now available on the internet with the help of Vegas technology.
- Multi-currency and multi-lingual options are now available on online casinos.
- To avoid money laundering, the government provided a set of rules and regulations. Now you have to see about many issues regarding online transactions and many more before choosing the best online casino.
- Now to win real money many well-established and experienced websites are available, offering online casino games to their customers.
Types of online casinos:
- Online casinos are not only best for providing betting and gambling games but they also take care of home comforts feeling for their players.
- Online casinos are the online version of land-based casinos with the opportunity for the players to win real money.
- There are 3 kinds of virtual casinos for game lovers. These casino types differ from one another based on their interface.
- Live-based casinos
- Software-based casinos
- Web-based casinos
Live-based casinos:
- In these online casinos, players have the ability to interact with dealers and other players at the tables in an online casino. This builds the feeling of a Live casino.
- These Live-based casinos not only provide interesting games but also a real-world gaming atmosphere.
Software-based casinos:
- Clients should have the software to allow players to download games from online casinos.
- Such casino software is provided by casino websites free of cost.
- The software does not need any browser to maintain its connection.
- Once the software is installed, it needs to be connected to the particular online casino to provide downloaded gaming services.
- Software installation and downloading need a lot of time but after the installation is complete, games are enjoyed at a fast rate than Web-based casinos.
Web-based casinos:
- Websites that allow players to enjoy games are Web-based casinos.
- Downloading any kind of software is not necessary to enjoy the pleasures of games.
- Just a browser is needed to play games and win money.
Tools used in developing casino games:
- Experienced designers and engineers use photoshop images and turn them into entertaining games.
- Programmers are not only experts in C++, C, and other programming languages but also experts in Photoshop, Maya, and other software used to develop games.
- Casino game development is a complete process. It starts with a concept and ends with a full flag game.
- During this process, designers use technology for artwork in games and program the software.
- After this, they enhance graphics, remove bugs, add audio, and do quality control.
- The nature of all the tools used in the development and designing of games is technical.
- Hardware like PC and smartphones are used to run casinos.
- Online casinos adopt crypto payments when bitcoin became a thing.
Providers of online casino games
High-quality games are provided by the best game providers that exceed our expectations. Some of the providers of online casino games are listed below:
- Microgaming
- Pragmatic Play
- playing
- Evolution
- QuickSpin ...etc
First casino software was created in 1994 and the first mobile casino software in 2004 by Microgaming.
Data sources of online casinos:
- Data sources secure a paramount position in online casinos.
- Betway 88 casino which is the biggest online casino platform spends much of the money on data hosting to provide their players with an uninterrupted gaming environment.
- As players spend a lot, more than their targeted budget, so, online casinos make a substantial investment in hardware, software infrastructure, and servers.
- Personal and financial details of the users are retained by data hosting, after retaining, this information is made more secure with the help of present technological advancements.
Technology Behind the security and Fair Play:
- As these online casino websites are not trustworthy to leave sensitive information so players' concerns about security can not be ignored.
- To protect the personal information and funds, several ways used by online casinos are listed below:
1. Encryption software:
- This technology ensures that financial transactions and personal pieces of information are secured and not visible to other people
2. ID verification:
- A passport or driver’s license is used to verify identity. It makes your information safe and secure.
3. End-to-end encryption:
- Unbreakable codes are used to scramble data that can not be encoded easily by anyone. It requires the intended recipient account to decode the secured codes.
4. Two-step verification:
- In two-step verification, a unique code is sent to your mobile number to check that you are the original guy.
5. TLS:
- TLS technology is mostly used in banks to secure your money. Now it is widely used at online casino platforms to secure transactions.
6. SSL-encryption:
- SSL encryption is a form of Artificial that collects all of the data from players and makes it secure by turn it into vines of Unbreakable codes.
7. RNG:
- To generate random numbers another form of Artificial intelligence is used which is RNG. RNG technology is used to ensure the fair play of the game. With this technology, everyone has an equal chance of winning the game.
Technology Behind optimization of online casino:
- To provide fast responses to players, optimization is very necessary.
- Without optimization of online casinos, all of its features are unless.
- With live casinos, optimization is extremely handy.
- There are apps for some of the online casinos.
- The points shown in the figure need to be optimized for better results.
The technology behind online payment methods:
- Commonly used payment methods at online casinos are
? PayPal
? Skrill
?Verve
? Bank transfer
? Neteller.....etc
- Your money is made secure at the casino by using SSL(secure socket layer) technology, but when you want to withdraw your money different methods like PayPal, Skrill and Neteller are used.
- These accounts are connected to your account in the bank. When you transfer money, money appeared in your bank account after 2-3 days.
The technology behind online casino software and gaming:
- Online casino software runs the whole online architecture of the casino.
- Random Number Generator(RNG) is the core component of online casino software.
- It ensures the unpredictability and randomness of the casino game, both player and casino are not aware of the next sequence.
- So, online casino technology is based on Fair play. It is not in the favor of anyone, casino or player.
- EXAMPLE: it’s an example showing how RNG works: the RNG will determine the outcome in the online free spin game.
Mobile-friendly casinos:
- Online casinos are easily accessible and at the comfort of their homes.
- Gambling is become more convenient because of the mobility of the current technology.
- Most of the casinos, now launch their mobile apps, at these apps, there is no difference in playing games as browsing on a computer or your phone.
- Mobile casinos cover a huge market because a lot of people have no time to sit on the PC and play games. Such peoples spend most of their time on their phones playing online casino games.
Why do people favor online casinos?
- Now let us discuss on a short note, why do people favor online casino games.
- People prefer online casinos rather than land-based casinos for many of the reasons:
- Online casinos are open forever for any time like 24/7/365 while land-based casinos opened at their specific times.
- Payout percentages of online casinos are better than land-based casinos.
- Have hundreds of games in the same casino platform while land-based casinos have few games in a casino.
- Online casinos also have welcome bonuses, loyalty programs, and different tournaments while land-based casinos do not offer these things.
Advantages of online casinos
- Players' presence in the game can be detected easily by these online casinos.
- Players can chat with each other while playing.
- Online casino games are available in hundreds in number which is a great array and these are expected to grow.
- Opportunity od setting up a daily routine is provided to players.
- Best optimization is dome in this industry.
Disadvantages of online casinos:
- The risk of being addictive is everywhere in this industry.
- Players spend more than their targeted budget.
- Risk of loss of profile and money in case of an account being hacked by senior hacker
Requirements for playing games at an online casino:
Before start playing online games at virtual casinos, you have to check the requirements that your PC should have. These requirements will enable you to download software and install it on your PC without any difficulty. So, you have to keep an eye on the following aspects:
- Window 7 SP1 or higher
- Intel i5-4590 or higher
- AD 290 or higher/ NVIDIA GTX 970
- Random-access memory of at least 8 GB.
- HDMI 1.3 video out compatible
- 2 USB 3.0 ports
These requirements may vary for different online casino games.
Conclusion:
The online casino industry is almost totally based on technology. With the recent advancement in the Internet and technology, you can look upon more and more casino games and apps customized for smartphones. Online casinos have to maximize their clients and players by the development of online gambling. Declaring their excellent services, online casinos say that, It’s not cheap and It’s complicated. You have chances of winning huge prizes, and you will be entertained and immersed. But always remember, gambling is highly addictive so gamble responsibly.
This is all for today’s article. I hope you have enjoyed the article and make grip on the understanding points. However, if you still face any skepticism regarding the technology behind online casinos then please feel free to leave your questions in the comment section. I will provide you best answers to your questions to the best of my knowledge and researching skills. Also, provide us with your innovative feedbacks and suggestions it will improve the quality of our work and provide you content according to your demands and expectations. Stay tuned! Thank you for reading this article.
Explore the future of creating objects through 3D designs and inventive engineering
3D modeling has been evolving since the day it came into the limelight. Within years of efforts, the technology has changed tremendously, offering better prospects and possibilities to the users. And, the development within the 3D modeling niche does not seem to cease. There are many interesting upgrades already underway and many to come in the years to follow.
Undoubtedly, the future of technology looks much brighter, with virtual reality and 3D printing furthering the application of 3D design and inventive engineering at a higher pace. It won’t be an exaggeration to deem that the increased accessibility of 3D printing did have a great impact on 3D design. In addition to shortening the time needed to create prototypes, additive manufacturing enabled the use of only resources for developing these prototypes.
Hence, it is certain that 3D printing along with 3D design and inventive engineering will pave the way for a better future and exciting developments. So, let’s explore the way we would be able to create objects through 3D design in the near future.
3D Designing with Higher Resolution
Although 3D modeling is around for more than a few decades, it still has one biggest limitation that happens to restrict its application within various tasks. Well, it’s the low-resolution files. Thankfully, according to technological advancements and current trends, it is likely that the barrier of low resolution will no longer be a problem any time soon.
The 3D resolution is on the verge to improve significantly. And, the day isn’t far when users will be able to interact with the designed 3D models without fearing any such limitations. Developers are working along to enable the visualization of 3D elements to reach perfection. In other words, people would be able to interact with the designs as if with naked eyes. Hence, planning to offer a much more enhanced realistic experience.
Because 3D modeling and related technologies help save money and offer innovative ways for accomplishing goals, businesses are inclining towards involving the technology for improving productivity while saving cost.
For instance, the real estate industry has already started making use of virtual staging along with 3D design. Soon, other niches will reap the benefit that 3D design and inventive engineering have to offer. Wish to know more about 3D design? Look for answers on Pick3DPrinter.
3D Designing and 3D Photorealism
As you must expect, for true photorealism, one must be able to make smart use of textures. And, it is equally crucial to apply those textures to something. Hence, artists do rely on detailed 3D models to avoid the need for faking details. However, currently, 3D designing tools end up increasing the file size of the model with complex features and high resolution. This is another challenge that is likely to improve considerably in the future.
Today, for creating a photorealistic image using pre-rendering of the imagery, you have the highest resolution settings for best results. However, from a medium for rendering to a long rendering time, you must consider many variables. Alternatively, you can think of purchasing fast rendering equipment, however, it would be a costly investment.
Similarly, when using 3D design to create models for animation, it is often to come across highly complicated geometries. These projects can even crash the application in between the modeling task. On the other hand, rendering still images won’t get you the results you wish to achieve. However, in the coming future, you can expect massive success already planned within photorealistic 3D modeling.
3D Modeling and Augmented Reality (AR)
AR isn’t just a long-awaited dream anymore. Although in its nascent stage, the technology has already amazed everyone with its possible future. AR is not restricted to Snapchat filters, funny avatars, or Google Glass. It’s just the preview of what entails ahead.
For instance, HoloLens that came back in 2016 for developers is an expensive kit capable of defining what augmented reality would be in the future. It allows us to interact with 3D models in a completely amazing way.
Industries 3D Modeling Will Impact in the Future
With 3D modeling, one can create a virtual three-dimensional model for any imaginary or existing real-world object, this provides a great opportunity to creators in terms of design flexibility and ease of use, individuals without any prior designing skill tend to lean towards sites that provide free 3D STL files to create their models. Here’s a list of some of the best sites to look for Free 3D Printer STL Files.
3D modeling has found widespread application in today's business world, with applications ranging from visualizing products and processes to securing funding for new research projects. Here are a few niches that will be able to reap most of the benefits 3D design and inventive engineering has to offer in the future.
Mechanical Engineering:
In the discipline of mechanical engineering, CAD modeling is utilized to assist improved visualization of designs, compliance with worldwide standards and the improvement of design quality.
3D models are created using precise measurements and may be quickly adjusted if changes are required. This improves the accuracy of 3D engineering models, allowing for the production of faultless gear that can be used by enterprises in a variety of industries as well as scientific institutes.
Biology and Medicine:
3D Bioprinting is a type of additive manufacturing that prints live structures layer by layer. Mimicking the behavior of natural living systems. This technology has provided immense possibilities to the niche which wouldn’t have been possible otherwise. 3D scanning in the medical field has given direction to a lot of research and many have been successfully accomplished as well.
By solving problems related to organ transplants, dental implants, and many others, 3D scanning has gained a lot of trust in the medical industry.
Advertising:
Models created using 3D design will be able to offer customers and clients a glimpse of what the real product would be. Marketers can start using a combination of 3d modeling and animation to generate stunning product images that businesses can use to create prototypes, offering their customers the ability to understand the upcoming design before launch.
Entertainment:
In movies, 3D modeling is employed to create special effects, especially when it comes to creating costumes, helmets, or supernatural decor for sets.
3D modeling creates realistic and immersive effects that can take the audience's experience to new heights. As the entertainment sector becomes more updated, 3D modeling will take on a more advanced makeover and will be used to create amazing effects.
Construction and Architecture:
3D models allow architects and the whole construction team to better understand the project’s scope and dimensions, which helps them take the right steps and eliminate errors in the early stages of the project, resulting in fewer surprises as the project progresses.
The Conclusion
Without any doubt, 3D design has a brighter future ahead. With so many developments around the corner, nothing seems too far from reality. Sooner, everyone would realize the amazing things the technology is set to impart.