Tải bản đầy đủ (.pptx) (13 trang)

LAB3: Learning the Development Environment

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (196.56 KB, 13 trang )

REPORT
LAB3: Learning the Development Environment
The Next Step

Nhóm :
1. Trần Xuân Việt 11DT2
2. Nguyễn Trường Thi 11DT2
3. Đoàn Ngọc Yên Vui 11DT2
4. Nguyễn Đặng Nhật 11DT2


1. Mục đích của bài lab:

• Tinh chỉnh thiết kế ở lab 2 bằng cách:
– Tích hợp thêm một số tính năng mới:
+ Phím điều khiển
+ Giao tiếp với máy tính


2. Khái quát yêu cầu chung:








Startup Task
Timer Interrupt and Time Base
A Dynamic Scheduler


Flow Rate Measurement
OLED Display
Local Keypad
Local Serial Communications


XÂY DỰNG SƠ ĐỒ USE CASE CHO HỆ THỐNG


XÂY DỰNG FUNCTION
DECOMPOSITION


XÂY DỰNG CLASS DIAGRAM


FUNCTION PROTOTYPES








void Measure (void* taskDataPtr);
void Compute (void* taskDataPtr);
void Status (void* taskDataPtr);
void KeypadConsole (void* taskDataPtr);
void LocalComs (void* taskDataPtr);

void OLEDdisplay (void* taskDataPtr);
void WarningAlarm (void* taskDataPtr);


TCB struct
struct MyStruct
{
void (*myTask)(void*);
void *taskDataPtr;
struct MyStruct *next;
struct MyStruct *prev;
};


OLED display function
void OLEDdisplay (void* dt)
{
display* temp=dt;
RIT128x96x4StringDraw("Temperature: ",0,40,15);
print_integer(*(temp->tempCorrectedPtr),78,40,15);
RIT128x96x4StringDraw("Flow Rate:",0,55,15);
print_integer(*(temp->flrCorrectedPtr),66,55,15);
RIT128x96x4StringDraw("CarbonLevel:",0,70,15);
print_integer(*(temp->carbonLevelCorrectedPtr),78,70,15);
RIT128x96x4StringDraw("SalinityLevel:",0,85,15);
print_integer(*(temp->salinityLevelCorrectedPtr),90,85,15);
RIT128x96x4StringDraw("Battery:
",0,0,15);
print_integer(*(temp->batteryStatePtr),50,0,15);
}



CẢI TIẾN CỦA HỆ THỐNG
• Timer Interrupt and Time Base: Thay thế software delay bởi hardware timer
interrupt .


• Local Serial Communication: dữ liệu có thể
được hiển thị trên OLED hoặc màn hình máy tính
thông qua cổng serial của vi xử lý.
• Keypad: sử dụng thêm các phím keypad trên kit
và các phím keyboard của máy tính để điều
khiển hoạt động của hệ thống


Demo Lab 2

The normal range for the measurements is specified as follows:
Temperature:
20 F to 30 F
Flow Rate:
120 liters per second
CarbonLevel:
380 ppm
SalinityLevel:
30 ppt
Battery:
Greater than 20% charge remaining



THANKS FOR YOUR
LISTENNING



×