Error with VB2010


hello,
i have arduino send values vb2010 , depending on value, displayed in different label.
below vb code:
code: [select]
    sub eventhandler(byval sender object, byval e system.io.ports.serialdatareceivedeventargs) handles serialport1.datareceived

        dim datareceived boolean = false
        dim recstr string = ""

        while not datareceived

            dim recval integer
            recval = serialport1.readbyte()
            if recval = 10 or recval = 13 then
                datareceived = true
            else
                recstr = recstr + chr(recval)
            end if

        end while

        if recstr <> "" then
            if recstr > 1000 then
                recstr = recstr - 1000
                label10.text = recstr
            end if

            if recstr > 100 , recstr < 1000 then
                recstr = recstr - 100
                label4.text = recstr
            end if

            if recstr < 0 then
                recstr = recstr * (-1)
                recstr = recstr - 10
                label8.text = recstr
            end if

            if recstr > 0 , recstr < 10 then
                recstr = recstr
                label6.text = recstr
            end if
            if recstr > 10 , recstr < 100 then
                recstr = recstr - 10
                label8.text = recstr
            end if




        end if

    end sub


if use message box variable displayed correctly. when try display variable on label error.
anybody knows why??

thanks help.

quote
but when try display variable on label error.

and error is?


Arduino Forum > Using Arduino > Interfacing w/ Software on the Computer > Error with VB2010


arduino

Comments

Popular posts from this blog

Thread: PKI Client 5.00 install (for eToken Pro)

ATmega2560-Arduino Pin Mapping

Crossfader Arduino Tutorial