Foundation Degree in computing - main project. Project to convert K-9 toy into an autonomous robot. By Kristian Dunn

Wednesday, 24 February 2010

Software requires a re-design

I have been writing a fair bit of skeleton code to get an idea of where i need to go. I got a DLL from Velleman which emulates the card by sending the inputs to the outputs. This will be very useful for testing without having to upload to the robot every time. THis is handy at the moment as I blew up the power supply by accidentally connecting the battery to the PSU instead of the robot. This is because the connectors are exactly the same so I need to mark them up to avoid this happening again.
To test the DLL I put this together

Private Sub frmMapping_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim intInput As Integer

        OpenDevice(0)
        intInput = ReadAllDigital
        PrintText("Input " & CStr(intInput))
        SetDigitalChannel(1)
        intInput = ReadAllDigital
        PrintText("Input " & CStr(intInput))
        intInput = ReadAnalogChannel(1)
        PrintText("Input " & CStr(intInput))
        OutputAnalogChannel(1, 234)
        intInput = ReadAnalogChannel(1)
        PrintText("Input " & CStr(intInput))

        CloseDevice()
    End Sub

There is a subroutine called PrintText to add the text to a log file.
I now need to go back to the design of the software and redraw a more detailed flowchart. This is inline with my build-and-fix design methodology.
My reasons for this are that while writing the skeleton code it has become apparent that my plan to write mapping software then location software will have to be merged as the main search algorithm is required in the mapping stage to locate and move to unmapped areas.

No comments:

Post a Comment

Followers