GIÁM SÁT, ĐIỀU KHIỂN, THU THẬP DỮ LIỆU KHÔNG DÂY CHO MOBILE ROBOT

88 81 0
GIÁM SÁT, ĐIỀU KHIỂN, THU THẬP DỮ LIỆU KHÔNG DÂY CHO MOBILE ROBOT

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Đề tài đã thực hiện thành công và đạt được kết quả khả quan như xây dựng được một mô hình mobile robot hoàn chỉnh với các mạch điện tử được làm thủ công. Với code chương trình được lập trình bằng ngôn ngữ C trên phần mềm arduino, cùng với giao diện điều khiển, hiển thị nhiệt độ và độ ẩm môi trường được viết trên phần mềm matlab. Xây dựng được một báo cáo hoàn chỉnh về các bước để thiết kế phần cứng lẫn phần mềm của một mobile robot giám sát, thu thập dữ liệu, điều khiển từ xa. Để làm tiền đề cho các khóa sau tìm hiểu phát triển để ứng dụng vào các cuộc thi robocon.

BỘ GIÁO DỤC VÀ ĐÀO TẠO TRƢỜNG ĐẠI HỌC NÔNG LÂM THÀNH PHỐ HỒ CHÍ MINH KHĨA LUẬN TỐT NGHIỆP GIÁM SÁT, ĐIỀU KHIỂN, THU THẬP DỮ LIỆU KHÔNG DÂY CHO MOBILE ROBOT Họ tên sinh viên: UNG MINH HOAN Ngành: CƠ ĐIỆN TỬ Niên khóa: 2011-2015 Tháng 06 năm 2015 GIÁM SÁT, ĐIỀU KHIỂN, THU THẬP DỮ LIỆU KHÔNG DÂY CHO MOBILE ROBOT TÁC GIẢ UNG MINH HOAN Khóa luận tốt nghiệp đƣợc đề trình đáp ứng u cầu cấp kỹ sƣ ngành Cơ Điện Tử Giáo viên hƣớng dẫn: Th.S Nguyễn Tấn Phúc Tháng 06 năm 2015 i LỜI CẢM ƠN Em xin trân trọng cảm ơn tất quý thầy cô trƣờng Đại học Nơng Lâm TP.Hồ Chí Minh q Thầy Cơ khoa Cơ Khí - Cơng Nghệ trang bị cho em kiến thức quý báu nhƣ giúp đỡ em suốt trình học tập trƣờng Em xin chân thành cảm ơn thầy cô môn Cơ Điện Tử giúp đỡ chúng em nhiệt tình thời gian thực đề tài Em xin bày tỏ biết ơn chân thành đến thầy Nguyễn Tấn Phúc tận tình hƣớng dẫn em suốt trình làm Luận văn tốt nghiệp Đặc biệt, em xin cảm ơn quý thầy cô hội đồng dành thời gian nhận xét góp ý để luận văn em hoàn thiện Cuối cùng, em xin gửi lời cảm ơn đến ngƣời thân nhƣ bạn bè động viên, ủng hộ tạo điều kiện thuận lợi cho em suốt q trình hồn thành luận văn TPHCM, tháng 06 năm 2015 Sinh viên thực UNG MINH HOAN ii TÓM TẮT Đề tài nghiên cứu “Giám sát, điều khiển, thu thập liệu không dây cho mobile robot” đƣợc thực trƣờng Đại Học Nông Lâm Thành Phố Hồ Chí Minh, thời gian từ tháng đến tháng năm 2015 Đề tài thực thành công đạt đƣợc kết khả quan nhƣ xây dựng đƣợc mơ hình mobile robot hồn chỉnh với mạch điện tử đƣợc làm thủ công Với code chƣơng trình đƣợc lập trình ngơn ngữ C phần mềm arduino, với giao diện điều khiển, hiển thị nhiệt độ độ ẩm môi trƣờng đƣợc viết phần mềm matlab Xây dựng đƣợc báo cáo hoàn chỉnh bƣớc để thiết kế phần cứng lẫn phần mềm mobile robot giám sát, thu thập liệu, điều khiển từ xa Để làm tiền đề cho khóa sau tìm hiểu phát triển để ứng dụng vào thi robocon Nội dung báo cáo đƣợc trình bày theo bố cục sau: Chƣơng 1: Tổng quan Chƣơng 2: Cơ sở lý thuyết Chƣơng 3: Mô hình hóa mơ Chƣơng 4: Kết khảo nghiệm Chƣơng 5: Kết luận Do thời gian thực hạn chế, trình độ kinh nghiệm có giới hạn nên đề tài nhiều thiếu sót Em mong nhận đƣợc đóng góp ý kiến quý thầy cô bạn bè để đề tài em đƣợc hoàn thiện iii MỤC LỤC Trang LỜI CẢM ƠN ii TÓM TẮT iii MỤC LỤC iv DANH SÁCH CÁC BẢNG vii DANH SÁCH CÁC HÌNH viii Chƣơng TỔNG QUAN 1.1 Lý chọn đề tài 1.2 Mục tiêu đề tài 1.3 Phƣơng pháp nghiên cứu đề tài 1.4 Vật liệu nghiên cứu 1.4.1 Phần cứng 1.4.2 Phần mềm 1.5 Tổng quan mobile robot 1.5.1 Lịch sử đời Robot 1.5.2 Sơ lƣợc mobile robot 1.5.3 Phân loại mobile robot 1.5.4 Ứng dụng 1.6 Nội dung thực Chƣơng CƠ SỞ LÝ THUYẾT 2.1 Vi điều khiển ATmega328P 2.1.1 Giới thiệu họ vi điều khiển AVR 2.1.2 Giới thiệu vi điều khiển ATmega328P 2.1.3 Cấu trúc nhớ 2.2 Cảm biến siêu âm SRF05 10 2.2.1 Giới thiệu 10 2.2.1.1 Cảm biến siêu âm nguyên tắc TOF ( Time Of Flight ) 11 2.2.1.2 Tầm quét cảm biến siêu âm 11 2.2.1.3 Thông số số loại cảm biến siêu âm SRF 12 iv 2.2.1.4 Cảm biến siêu âm SRF05 đặc tính kỹ thuật 13 2.2.2 Các chế độ SRF05 14 2.2.2.1 Chế độ 1: tƣơng ứng SRF04 – tách biệt kích hoạt phản hồi 14 2.2.2.2 Chế độ 2: Dùng chân cho kích hoạt phản hồi 15 2.3 Module bluetooth HC05 19 2.4 Giới thiệu DHT22 20 2.4.1 Giới thiệu 20 chân, khoảng cách chân 0.1'' 2.4.2 Nguyên lý hoạt động - Sơ đồ kết nối vi xử lý: 21 2.5 Động DC 23 2.5.1 Cấu tạo 23 2.5.2 Nguyên tắc hoạt động 24 2.6 Động RC Servo 9G 26 2.7 IC L293D 27 2.8 Giới thiệu phần mềm lập trình cho ATmega328P 28 2.9 Giới thiệu phần mềm Matlab 29 Chƣơng PHƢƠNG PHÁP NGHIÊN CỨU 31 3.1 Thiết kế phần cứng 31 3.1.1 Kết cấu khung robot 31 3.1.2 Mạch nguyên lí phần cứng robot 32 3.1.2.1 Khối nguồn 33 3.1.2.2 Khối vi xử lí 34 3.1.2.3 Khối công suất động 35 3.1.2.4 Khối giao tiếp máy tính từ xa 36 3.1.2.5 Khối cảm biến 37 3.1.2.5.1 Cảm biến độ ẩm DHT22 37 3.1.2.6 Động RC Servo 9G 38 3.2 Thiết kế phần mềm 39 3.2.1 Giới thiệu ngôn ngữ C 39 3.2.2 Phần mềm biên dịch 39 3.2.3 Phần mềm thiết kế giao diện điều khiển 39 3.3 Lƣu đồ giải thuật 40 v 3.3.1 Sơ đồ giải thuật chƣơng trình 40 Chƣơng KẾT QUẢ THẢO LUẬN 42 4.1 Phần cứng 42 4.1.1 Main 42 4.1.2 Mạch cầu H 43 4.1.3 Mạch nguồn 43 4.1.4 Mơ hình hệ thống sau hoàn thiện 44 4.1.5 Cấu tạo nguyên tắc hoạt động 44 4.2 Giao diện điều khiển 45 4.3 Khảo nghiệm 46 4.3.1 Thiết bị khảo nghiệm 46 4.3.2 Chạy khảo nghiệm mobile robot 47 4.3.2.1 Khảo nghiệm cảm biến nhiệt ẩm DHT22 47 4.3.2.2 Khảo nghiệm SRF05 49 4.3.2.3 Khảo nghiệm chế độ điều khiển từ xa mobile robot 52 4.3.2.4 Khảo nghiệm chế độ tự hành né vật cản mobile robot 52 4.3.2.5 Khảo nghiệm chế độ tự dừng mobile robot chế độ điều khiển từ xa 55 Chƣơng KẾT LUẬN VÀ ĐỀ NGHỊ 57 5.1 Kết luận 57 5.2 Đề nghị 57 TÀI LIỆU THAM KHẢO 59 PHỤ LỤC 60 vi DANH SÁCH CÁC BẢNG Trang Bảng 4.1: Kết khảo nghiêm DHT22 Bảng 4.2: Kết đo SRF05 khảo nghiệm Bảng 4.3: Kết đo SRF05 khảo nghiệm 51 Bảng 4.4: Kết khảo nghiệm chế độ điều khiển mobile robot 52 Bảng 4.5: Kết khảo nghiệm chế độ né vật cản mobile robot lần 53 Bảng 4.6: Kết khảo nghiệm chế độ né vật cản mobile robot lần 54 Bảng 4.7: Kết khảo nghiệm chế độ né vật cản mobile robot lần 55 Bảng 4.8: Kết khảo nghiệm chế độ tự dừng chờ lệnh điều khiển có vật cản phía trƣớc dƣới 20cm 56 vii 50 DANH SÁCH CÁC HÌNH Trang Hình 1.1: Sơ đồ tổng qt điều khiển Robot Hình 2.1: Sơ đồ chân ATmega328P Hình 2.2: Sơ đồ khối cấu trúc ATmega328P Hình 2.3: Bộ nhớ chƣơng trình có khơng có sử dụng boot loader Hình 2.4: Sơ đồ nhớ liệu 10 Hình 2.5: Cảm biến siêu âm 10 Hình 2.6: Nguyên tắc TOF 11 Hình 2.7: Tầm quét cảm biến siêu âm 12 Hình 2.8: Thông số số cảm biến siêu âm SRF 12 Hình 2.9: Hình ảnh thực tế cảm biến siêu âm SRF05 13 Hình 2.10: Chế độ SRF05 14 Hình 2.11: Giản đồ định thời SRF05 chế độ 15 Hình 2.13: Giản đồ định thời SRF05 chế độ 16 Hình 2.14: Chùm tia cảm biến SRF05 17 Hình 2.15: Sơ đồ hoạt động cảm biến siêu âm 17 Hình 2.16: Mức độ hồi tiếp sóng âm 18 Hình 2.17: Vùng phát SRF05 18 Hình 2.18: Vùng phát cảm biến SRF05 19 Hình 2.19: Ảnh thực tế Module Bluetooth HC05 19 Hình 2.20: Sơ đồ chân DHT22 20 Hình 2.21: Sơ đồ kết nối DHT22 với MCU 21 Hình 2.22: Một số động DC đƣợc sử dụng robot 23 Hình 2.23: Ngun lí hoạt động động DC 26 Hình 2.24 : Ảnh thực tế động RC Servo 9G 26 Hình 2.25: Sơ đồ chân IC L293 27 Hình 2.26: Giao diện phần mềm Arduino1.5.8 28 viii Hình 2.27: Giao diện phần mềm Matlab 29 Hình 3.1: Hình ảnh thực tế khung mobile robot 31 Hình 3.2: Sơ đồ khối tổng quát mobile robot 32 Hình 3.3: Mạch nguồn ổn áp 5V 8V DC 33 Hình 3.4: Mạch điều khiển trung tâm 34 Hình 3.5: Sơ đồ nguyên lý L293 35 Hình 3.6: Sơ đồ kết nối Module Bluetooth HC05 36 Hình 3.7: Sơ đồ nguyên lý DHT22 37 Hình 3.8: Sơ đồ nguyên lý SRF05 37 Hình 3.9: Sơ đồ nguyên lý RC Servo 9G 38 Hình 3.10: Sơ đồ giải thuật cho toàn hệ thống 41 Hình 3.11: Sơ đồ giải thuật cho chƣơng trình tự động 41 Hình 4.1: Main 42 Hình 4.2: Mạch cầu H L293 43 Hình 4.3: Mạch nguồn 5V, 8V 43 Hình 4.4: Mơ hình Mobile robot hồn thiện 44 Hình 4.5: Giao diện điều khiển hiển thị PC 45 Hình 4.6: Hình ảnh thực tế nhiệt ẩm kế Anymetre TH108 47 Hình 4.7: Mơ hình bố trí khảo nghiệm cảm biến nhiệt độ DHT22 48 Hình 4.8: Giao diện đọc kết khảo nghiêm cảm biến nhiệt độ DHT22 48 Hình 4.9: Mơ hình bố trí khảo nghiệm cảm biến SRF05 lần 50 Hình 4.10: Giao diện đọc kết cảm biến SRF05 lần 50 Hình 4.11: Mơ hình bố trí khảo nghiệm cảm biến SRF05 lần 51 Hình 4.12: Giao diện đọc kết cảm biến SRF05 lần 51 Hình 4.13: Mơ hình bố trí khảo nghiệm khả né vật cản lần 53 Hình 4.14: Mơ hình bố trí khảo nghiệm khả né vật cản lần 54 Hình 4.15: Mơ hình bố trí khảo nghiệm khả né vật cản lần 55 Hình 4.16: Mơ hình bố trí khảo nghiệm khả tự động dừng chờ lệnh điều khiển 56 ix void scan() { Time = sonar.ping(); distance = Time / US_ROUNDTRIP_CM; delay(10); } void navigate() { servo.write(135); delay(500); scan(); LeftDistance = distance; servo.write(45); delay(500); scan(); RightDistance = distance; if(abs(RightDistance - LeftDistance) < 20) { moveBackward(); analogWrite(pwm,150); delay(300); } else if(RightDistance < LeftDistance) { moveLeft(); analogWrite(pwm,125); delay(10); } else if(LeftDistance < RightDistance) { moveRight(); 64 analogWrite(pwm,125); delay(10); } } void tudong() { servo.write(90); scan(); FrontDistance = distance; if(FrontDistance > 30 || FrontDistance == 0) { moveForward(); analogWrite(pwm,110); } else { CollisionCounter = CollisionCounter + 1; moveStop(); delay(50); navigate(); } } void doccb() { if (millis() - lastCallTime >= 1000){ int s1 = dht.readHumidity(); s = (s1*10)/100; int h = dht.readHumidity()-s; int t = dht.readTemperature(); if (isnan(h) || isnan(t)) { return; 65 } Serial.println("Nhiet do= "+String(t)+"*C "+" Do am= "+String(h)+"%"); Serial.flush(); float hi = dht.computeHeatIndex(t, h); lastCallTime = millis(); Code giao diện matlab: function varargout = GIAODIENDK(varargin) % GIAODIENDK MATLAB code for GIAODIENDK.fig % GIAODIENDK, by itself, creates a new GIAODIENDK or raises the existing % singleton* % % H = GIAODIENDK returns the handle to a new GIAODIENDK or the handle to % the existing singleton* % % % GIAODIENDK('CALLBACK',hObject,eventData,handles, ) calls the local function named CALLBACK in GIAODIENDK.M with the given input arguments % % GIAODIENDK('Property','Value', ) creates a new GIAODIENDK or raises the % existing singleton* Starting from the left, property value pairs are % applied to the GUI before GIAODIENDK_OpeningFcn gets called An % unrecognized property name or invalid value makes property application % stop All inputs are passed to GIAODIENDK_OpeningFcn via varargin % % *See GUI Options on GUIDE's Tools menu Choose "GUI allows only one % instance to run (singleton)" % % See also: GUIDE, GUIDATA, GUIHANDLES % Edit the above text to modify the response to help GIAODIENDK 66 % Last Modified by GUIDE v2.5 08-Apr-2015 07:59:32 % Begin initialization code - DO NOT EDIT gui_Singleton = 1; gui_State = struct('gui_Name', mfilename, 'gui_Singleton', gui_Singleton, 'gui_OpeningFcn', @GIAODIENDK_OpeningFcn, 'gui_OutputFcn', @GIAODIENDK_OutputFcn, 'gui_LayoutFcn', [] , 'gui_Callback', []); if nargin && ischar(varargin{1}) gui_State.gui_Callback = str2func(varargin{1}); end if nargout [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:}); else gui_mainfcn(gui_State, varargin{:}); end % End initialization code - DO NOT EDIT % - Executes just before GIAODIENDK is made visible function GIAODIENDK_OpeningFcn(hObject, eventdata, handles, varargin) % This function has no output args, see OutputFcn % hObject handle to figure % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % varargin command line arguments to GIAODIENDK (see VARARGIN) % Choose default command line output for GIAODIENDK 67 handles.output = hObject; % Update handles structure guidata(hObject, handles); clc; global B t; B = Bluetooth('HC-05',1); instrhwinfo('Bluetooth', 'HC-05'); B = Bluetooth('HC-05',1); %go [a,map]=imread('go.jpg'); [r,c,d]=size(a); x=ceil(r/74); y=ceil(c/135); g=a(1:x:end,1:y:end,:); g(g==255)=5.5*255; set(handles.pushbutton5,'CData',g); %back [a,map]=imread('back.jpg'); [r,c,d]=size(a); x=ceil(r/74); y=ceil(c/135); g=a(1:x:end,1:y:end,:); g(g==255)=5.5*255; set(handles.pushbutton3,'CData',g); %left [a,map]=imread('left.jpg'); [r,c,d]=size(a); x=ceil(r/72); y=ceil(c/145); g=a(1:x:end,1:y:end,:); 68 g(g==255)=5.5*255; set(handles.pushbutton1,'CData',g); %righ [a,map]=imread('righ.jpg'); [r,c,d]=size(a); x=ceil(r/72); y=ceil(c/145); g=a(1:x:end,1:y:end,:); g(g==255)=5.5*255; set(handles.pushbutton4,'CData',g); %stop [a,map]=imread('stop.jpg'); [r,c,d]=size(a); x=ceil(r/55); y=ceil(c/107); g=a(1:x:end,1:y:end,:); g(g==255)=5.5*255; set(handles.pushbutton2,'CData',g); %connect [a,map]=imread('connect.jpg'); [r,c,d]=size(a); x=ceil(r/62); y=ceil(c/112); g=a(1:x:end,1:y:end,:); g(g==255)=5.5*255; set(handles.pushbutton6,'CData',g); %auto [a,map]=imread('auto.jpg'); [r,c,d]=size(a); x=ceil(r/60); y=ceil(c/115); 69 g=a(1:x:end,1:y:end,:); g(g==255)=5.5*255; set(handles.pushbutton11,'CData',g); % UIWAIT makes GIAODIENDK wait for user response (see UIRESUME) % uiwait(handles.figure1); % - Outputs from this function are returned to the command line function varargout = GIAODIENDK_OutputFcn(hObject, eventdata, handles) % varargout cell array for returning output args (see VARARGOUT); % hObject handle to figure % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Get default command line output from handles structure varargout{1} = handles.output; % - Executes on button press in pushbutton1 function pushbutton1_Callback(hObject, eventdata, handles) % hObject handle to pushbutton1 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) global B; fwrite(B,'3'); % - Executes on button press in pushbutton2 function pushbutton2_Callback(hObject, eventdata, handles) % hObject handle to pushbutton2 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) 70 global B; fwrite(B,'5'); % - Executes on button press in pushbutton3 function pushbutton3_Callback(hObject, eventdata, handles) % hObject handle to pushbutton3 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) global B; fwrite(B,'2'); % - Executes on button press in pushbutton4 function pushbutton4_Callback(hObject, eventdata, handles) % hObject handle to pushbutton4 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) global B; fwrite(B,'4'); % - Executes on button press in pushbutton5 function pushbutton5_Callback(hObject, eventdata, handles) % hObject handle to pushbutton5 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) global B; fwrite(B,'1'); % - Executes on button press in pushbutton6 function pushbutton6_Callback(hObject, eventdata, handles) 71 % hObject handle to pushbutton6 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) clc; global B t; fopen(B); t = timer; t.ExecutionMode = 'fixedSpacing'; t.BusyMode = 'queue'; t.TimerFcn = {@ergoTimerStart, handles}; start(t) % - Executes on button press in pushbutton7 function pushbutton7_Callback(hObject, eventdata, handles) % hObject handle to pushbutton7 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) global B t; fclose(B); stop(t); delete(t); set(handles.edit2,'string',''); function edit1_Callback(hObject, eventdata, handles) % hObject handle to edit1 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) 72 % Hints: get(hObject,'String') returns contents of edit1 as text % str2double(get(hObject,'String')) returns contents of edit1 as a double % - Executes during object creation, after setting all properties function edit1_CreateFcn(hObject, eventdata, handles) % hObject handle to edit1 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows % See ISPC and COMPUTER if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end % - Executes during object creation, after setting all properties % - Executes on button press in pushbutton8 function pushbutton8_Callback(hObject, eventdata, handles) % hObject handle to pushbutton8 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) close; 73 % - Executes during object creation, after setting all properties % - Executes during object creation, after setting all properties function logo_CreateFcn(hObject, eventdata, handles) % hObject handle to logo (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called [x,map]=imread('logo.jpg','jpg'); image(x),colormap(map),axis off,hold on % Hint: place code in OpeningFcn to populate logo % - Executes on button press in pushbutton11 function pushbutton11_Callback(hObject, eventdata, handles) % hObject handle to pushbutton11 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) global B; fwrite(B,'6'); % - Executes on button press in pushbutton12 % - Executes during object creation, after setting all properties function pushbutton6_CreateFcn(hObject, eventdata, handles) % hObject handle to pushbutton6 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called 74 function edit2_Callback(hObject, eventdata, handles) % hObject handle to edit2 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of edit2 as text % str2double(get(hObject,'String')) returns contents of edit2 as a double % - Executes during object creation, after setting all properties function edit2_CreateFcn(hObject, eventdata, handles) % hObject handle to edit2 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows % See ISPC and COMPUTER if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end function edit3_Callback(hObject, eventdata, handles) % hObject handle to edit3 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) 75 % Hints: get(hObject,'String') returns contents of edit3 as text % str2double(get(hObject,'String')) returns contents of edit3 as a double % - Executes during object creation, after setting all properties function edit3_CreateFcn(hObject, eventdata, handles) % hObject handle to edit3 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows % See ISPC and COMPUTER if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end % - Executes on button press in pushbutton13 function pushbutton14_Callback(hObject, eventdata, handles) % hObject handle to pushbutton14 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) set(handles.edit2,'string',''); % - Executes on button press in pushbutton15 function pushbutton15_Callback(hObject, eventdata, handles) % hObject handle to pushbutton15 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) clc; 76 function ergoTimerStart(mTimer,event, h) global B; char A; A = fscanf(B) set(h.edit2,'string',A); % - Executes during object creation, after setting all properties function logo1_CreateFcn(hObject, eventdata, handles) % hObject handle to logo1 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called [x,map]=imread('logo1.jpg','jpg'); image(x),colormap(map),axis off,hold on % Hint: place code in OpeningFcn to populate logo1 function edit4_Callback(hObject, eventdata, handles) % hObject handle to edit4 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of edit4 as text % str2double(get(hObject,'String')) returns contents of edit4 as a double % - Executes during object creation, after setting all properties function edit4_CreateFcn(hObject, eventdata, handles) % hObject handle to edit4 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called 77 % Hint: edit controls usually have a white background on Windows % See ISPC and COMPUTER if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end 78 ... CẢM ƠN Em xin trân trọng cảm ơn tất quý thầy cô trƣờng Đại học Nông Lâm TP.Hồ Chí Minh q Thầy Cơ khoa Cơ Khí - Cơng Nghệ trang bị cho em kiến thức quý báu nhƣ giúp đỡ em suốt trình học tập trƣờng

Ngày đăng: 19/09/2019, 15:49

Từ khóa liên quan

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan