tailieunhanh - Hệ thống nhúng - Chương 2

“What happens when all the code in the main() function has been executed?” The device will reset, and the entire program will execute again and again. In fact, the compiler puts a special software reset instruction right after the end of the main() function code How to keep the system alive? | Hệ thống nhúng Thạc sĩ Lê Mạnh Hải Embedded Systems Lesson 2 : A loop in the pattern Flight plan: Embedded-control programs need a framework, similar to the pilots’ pattern, so that the flow of code can be managed. Loops syntax in C The 16-bit Timer1. Two new MPLAB® SIM “Animate” “Logic Analyzer.” Preflight checklist MPLAB IDE, Integrated Development Environment MPLAB SIM, software simulator MPLAB C30 compiler (Student Version) The flight Select “Project→Project Wizard”, to start creating a new project. Select the PIC24FJ128GA010 device, and click Next. Select the MPLAB C30 compiler suite and click Next. Create a new folder and name it “Loop.” name the project “A Loop in the Pattern,” and clickNext. There is no need to copy any source fi les from the previous lessons; click Next once more. Click Finish to complete the Wizard set-up. Open a new editor window. Type the main program header: // // A loop in the pattern // Select “Project→AddNewFiletoProject”, to save the fi . | Hệ thống nhúng Thạc sĩ Lê Mạnh Hải Embedded Systems Lesson 2 : A loop in the pattern Flight plan: Embedded-control programs need a framework, similar to the pilots’ pattern, so that the flow of code can be managed. Loops syntax in C The 16-bit Timer1. Two new MPLAB® SIM “Animate” “Logic Analyzer.” Preflight checklist MPLAB IDE, Integrated Development Environment MPLAB SIM, software simulator MPLAB C30 compiler (Student Version) The flight Select “Project→Project Wizard”, to start creating a new project. Select the PIC24FJ128GA010 device, and click Next. Select the MPLAB C30 compiler suite and click Next. Create a new folder and name it “Loop.” name the project “A Loop in the Pattern,” and clickNext. There is no need to copy any source fi les from the previous lessons; click Next once more. Click Finish to complete the Wizard set-up. Open a new editor window. Type the main program header: // // A loop in the pattern // Select “Project→AddNewFiletoProject”, to save the fi le as: “” and have it automatically added to the project source fi les list. Save the project. The flight “What happens when all the code in the main() function has been executed?” The device will reset, and the entire program will execute again and again. In fact, the compiler puts a special software reset instruction right after the end of the main() function code How to keep the system alive? While loops In C there are at least three ways to code a loop; here is the fi rst—the while loop: while ( x) { // your code here. } Operators ( a || b) is true, ( a && b) is true ( !a) is false There are, then, a number of operators that compare numbers (integers of any kind and fl oating-point values, too) and return logic values. == the “equal-to” operator; notice it is composed of two equal signs to distinguish it from the “assignment” operator we used in the previous lesson, != the “NOT-equal to” operator, > the “greater-than” operator, >= the “greater-or-equal to” .

TỪ KHÓA LIÊN QUAN
crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.