TAILIEUCHUNG - Amphibionics build your own biologically inspired reptilian robot - part 10

Khi photointerrupter được kết nối với bộ điều khiển chính, vi điều khiển PIC ra khỏi ổ cắm 18-pin và bật sức mạnh. Từ từ xoay lốp xe bằng tay. LED sẽ được vào khi một phần mờ đục của đĩa mã hóa giữa các bộ ngắt quang học. Khi đi qua một lỗ trong đĩa, đèn LED sẽ được tắt. Chương trình tiếp theo sẽ kiểm tra kết nối của thiết bị để vi điều khiển PIC 16F84. | Chapter 7 Turtletron Build Your Own Robotic Turtle FIGURE Optical encoder disk centered between the interrupter. FIGURE Interrupter interface board mounted to robot base. 331 Amphibionics FIGURE Wiring diagram to connect interface board to main controller. When the photointerrupter is connected to the main controller take the PIC microcontroller out of the 18-pin socket and turn on the power. Slowly rotate the tire by hand. The LED will be on when an opaque section of the encoder disk is between the optical interrupter. When it comes across a hole in the disk the LED will be off. The next program will test the connection of the device to the PIC 16F84 microcontroller. Compile listed in Program and then program the PIC 16F84 with the file listed in Program . Place the PIC in the 18-pin socket and then turn on the power. When you rotate the tire and encoder disk by hand the PIC will produce a sound each time a hole is encountered. The program stays in a tight loop until the transistor changes state again otherwise the PIC would continuously produce the tone sequence while the disk was on the same hole. This method will be used when counting the number of times the transistor switches from one state to another or an event is being triggered. If a counter is being incremented this method ensures that only one count will occur during a state transition. 332 Chapter 7 Turtletron Build Your Own Robotic Turtle Name Compiler PicBasic Pro - MicroEngineering Labs Notes Program to test the optical interrupter photodarlington switch PROGRAM program listing PortA set as outputs. trisa 00000000 PortB set as outputs. pin 0 input. trisb 00000001 initialize variables switch VAR enable_right forward_right reverse_right enable_left reverse_left forward_left piezo control VAR VAR VAR VAR VAR VAR VAR VAR BYTE temp VAR BYTE low .

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã 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.