LEGO MINDSTORMS - The Unofficial Guide to Robots - Jonathan B. Knudsen Part 10

Tham khảo tài liệu 'lego mindstorms - the unofficial guide to robots - jonathan b. knudsen part 10', 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ả | 170 Open the output file. out FreeFile open filename For Output As out .InitComm First get item zero which describes the length of the datalog. data .UploadDatalog 0 1 length data 2 0 - 1 Now upload 50 items at a time. index 0 While index length Find the smaller of the remaining items or 50. stepSize min length - index 50 Get the data. data .UploadDatalog index 1 stepSize Write it out to a file. For i o To stepSize -1 line getTypeString data 0 i _ Str data 1 i Str data 2 i Print out line Next I index index stepSize Wend .CloseComm Close the file. Close out End With End Sub Function min n1 As Integer n2 As Integer As Integer If n1 n2 Then min n1 Else min n2 End If End Function Function getTypeString ByVal code As Integer As String getTypeString Switch _ code 0 Variable _ code 1 Timer _ code 2 Constant _ code 3 Motor status _ code 4 Random _ code 8 Program number code 9 Sensor value _ code 10 Sensor type _ code 11 Sensor mode _ code 12 Sensor raw _ 171 code 13 code 14 code 15 Sensor boolean Watch IR message End Function This example of course is really just a jumping-off point. You may want to make the following enhancements Integrate SaveDatalog into a form to create a user-friendly application. Modify the output file format to suit your own needs. Online Resources LEGO Programmable Bricks Reference Guide http This official document from LEGO describes in detail. Although LEGO calls it a Software Development Kit SDK it s not really a big deal. There s a PDF file of the Technical Reference Document which is 112 pages of reference material describing every function in . There are also some Visual Basic files that you can download and experiment with including a file of handy constant definitions. LEGO on my mind Roboworld http brok legomind robo This is the robotics area of Eric Brok s excellent site. There are actually two relevant resources here. The first is an outstanding introduction the .

Không thể tạo bản xem trước, hãy bấm tải xuống
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
169    67    2    08-05-2024
29    91    2    08-05-2024
Đã 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.