How to Distinguish Between Source and Sink Types in PLCs?

How to Distinguish Between Source and Sink Types in PLCs?

1. The source type and sink type generally refer to transistor-type circuits and can be directly understood as the IO circuitproviding/outputting current (source) orabsorbing/inputting current (sink). For DO, the PNP transistor output is generally a source type, where the output module is internally connected to the power supply, allowing current to flow out through DO … Read more

C Language Program to Determine if a Number is Even or Odd

C Language Program to Determine if a Number is Even or Odd

Determine if a number is even or odd #define _CRT_SECURE_NO_WARNINGS#include <stdio.h>#include <stdlib.h> // system function required int main(){ int a; while (1) // infinite loop { printf("Please enter an integer:\n"); scanf("%d", &a); if (a % 2 == 0) { printf("%d is even\n", a); } else { printf("%d is odd\n", a); } printf("Press any key to … Read more

Understanding MCU Input Functions

Understanding MCU Input Functions

The “Understanding at a Glance” series explains common terms and concepts of 8-bit MCUs in the most straightforward way. Unlike traditional explanations of the 8051, this series will combine products and practices from mainstream microcontroller manufacturers in the current market (such as Zhongx, Shengx, Xinx, Yingx, Jiux, etc.) to analyze core knowledge in a simple … Read more

GESP Level 3 C++ Practice (One-Dimensional Array) luogu-B2093 Find a Specific Value

GESP Level 3 C++ Practice (One-Dimensional Array) luogu-B2093 Find a Specific Value

GESP Level 3 practice, one-dimensional array exercise (Knowledge point 5 in the C++ Level 3 syllabus, one-dimensional array), Difficulty ★☆☆☆☆. GESP Level 3 Practice Question List GESP Level 3 Real Question List GESP Level 3 Syllabus Analysis luogu-B2093 Find a Specific Value Problem Requirements Problem Description Find a given value in a sequence (starting from … Read more

Learning C++ Programming from Scratch, Day 396: Converting Positive Integer N to Binary Number; Question Bank Answer; Method 1

Learning C++ Programming from Scratch, Day 396: Converting Positive Integer N to Binary Number; Question Bank Answer; Method 1

1108 – Converting Positive Integer N to Binary Number What does this program do? This program acts like a “digital translator” that converts the numbers we commonly use (like 10, 25) into binary numbers used by computers (like 1010, 11001). It’s similar to translating Chinese into English, but here we are translating decimal numbers into … Read more

C++ Basics – Introduction (1)

C++ Basics - Introduction (1)

Hi, long time no see! The main content begins—— 1. Introduction to C++ Basics 1.1 The Father of C++ – Bjarne Stroustrup 1.2 C++ References Reference Material – C++ Reference (cplusplus.com) C++ Reference Manual – cppreference.com cppreference.com Note:The first link is not the official C++ documentation, and the standard is only updated to C++11. However, … Read more

STM32CUBEMX Tutorial 2 — Using GPIO for Input/Output

STM32CUBEMX Tutorial 2 — Using GPIO for Input/Output

Previous article links:Detailed installation tutorial for STM32CUBEMXSTM32CUBEMX Tutorial 1 — Environment Configuration and New Project CreationWhen learning and using any MCU, the initial step often starts with GPIO. Learning how to configure IO allows you to output the desired voltage levels and read the voltage levels from the IO ports.This article introduces the GPIO of … Read more

Essential C++ Basics: A Comprehensive Guide to Namespaces, Input/Output, Variable Types, and Control Flow

Essential C++ Basics: A Comprehensive Guide to Namespaces, Input/Output, Variable Types, and Control Flow

Introduction C++ is a powerful and widely used programming language that combines the efficiency of C with the flexibility of object-oriented programming. This article will introduce several fundamental concepts in C++: namespaces, input/output, basic variable types, and control flow. Mastering these concepts is crucial for further learning in C++ programming. 1. Namespaces Namespaces are a … Read more