TAILIEUCHUNG - McGraw-Hill - The Robot Builder's Bonanza Episode 2 Part 6

Tham khảo tài liệu 'mcgraw-hill - the robot builder's bonanza episode 2 part 6', kỹ thuật - công nghệ, cơ khí - chế tạo máy phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | CONTROLLING RC SERVOS WITH THE BX-24 511 twice in this example changes the state of a specified I O line. Note the use of the constants. The syntax for PutPin is as follows PutPin PinNumber Value where PinNumber is the number of the pin you want to use . pin 25 for the red LED and Value is either 1 for on or logical HIGH or 0 for off or logical LOW . The Delay function causes the BX-24 to pause a brief while in this case 70 milliseconds. Delay is called twice so there is a period of time between the on off flashing of each LED Green pulse. Call PutPin GreenLED LEDon Call Delay Call PutPin GreenLED LEDoff Call Delay The process is repeated for the green LED. Controlling RC Servos with the BX-24 You can easily control RC servos with the BX-24 using a few simple statements. While there is no built-in servo command as there is with the OOPic microcontroller see Chapter 33 the procedure is nevertheless very easy to do in the BX-24. Here s a basic program that places a servo connected to pin 20 of the BX-24 at its approximate mid-point position. I say approximate because the mechanics of RC servos can differ between makes models and even individual units Sub Main Do Call PulseOut 20 1 Call Delay Loop End Sub The program continuously runs because it s within an infinite Do loop. The PulseOut statement sends a short ms HIGH pulse to pin 20. The Delay statement causes the BX-24 to wait 20 milliseconds before the loop is repeated all over again. With a delay of 20 milliseconds the loop will repeat 50 times a second 50 20 milliseconds 1000 milliseconds or one second . Note the optional use of scientific notation for the second parameter of PulseOut. Using the value would yield the same result. You should be aware that the BX-24 supports two versions of the PulseOut statement a float version and an integer version The float version is used with floating-point numbers that is numbers that have a decimal point. The integer version

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.