W
weg22
Hi all,
I'm developing a Visual Basic 2005 application to communicate with an
I2C device. I recently decided to add an i2c status bar. The status
bar is just a textbox with the following properties:
When I2C communication active:
Public Sub i2c_active()
statusBar.Text = "Exchanging Data..."
statusBar.BackColor = Drawing.Color.Red
End Sub
When I2C communication is idle:
Public Sub i2c_idle()
statusBar.Text = "IDLE"
statusBar.BackColor = Drawing.Color.Lime
End Sub
Ideally, the above properties are changed before and after the
get_i2c_data function. For example:
i2c_active()
get_i2c_data()
i2c_idle()
The problem is that the textbox properties for i2c_active() don't
change until after the get_i2c_data() function finishes. For example,
if I execute
i2c_active()
get_i2c_data()
the textbox doesn't turn red and display "Executing Data..." until
after it has already retrieved the data from the i2c device. This is
completely pointless!
There is some sort of delay between when the i2c_active() function
executes and when I see the textbox properties change. To debug, I
tried just executing the i2c_active() function and the textbox
properties change instantaneously. I need to have the textbox
properties change instantaneously when the get_i2c_data() function is
included. I'm not sure how to get this working. Any suggestions
would be appreciated.
Thanks,
-weg22
I'm developing a Visual Basic 2005 application to communicate with an
I2C device. I recently decided to add an i2c status bar. The status
bar is just a textbox with the following properties:
When I2C communication active:
Public Sub i2c_active()
statusBar.Text = "Exchanging Data..."
statusBar.BackColor = Drawing.Color.Red
End Sub
When I2C communication is idle:
Public Sub i2c_idle()
statusBar.Text = "IDLE"
statusBar.BackColor = Drawing.Color.Lime
End Sub
Ideally, the above properties are changed before and after the
get_i2c_data function. For example:
i2c_active()
get_i2c_data()
i2c_idle()
The problem is that the textbox properties for i2c_active() don't
change until after the get_i2c_data() function finishes. For example,
if I execute
i2c_active()
get_i2c_data()
the textbox doesn't turn red and display "Executing Data..." until
after it has already retrieved the data from the i2c device. This is
completely pointless!
There is some sort of delay between when the i2c_active() function
executes and when I see the textbox properties change. To debug, I
tried just executing the i2c_active() function and the textbox
properties change instantaneously. I need to have the textbox
properties change instantaneously when the get_i2c_data() function is
included. I'm not sure how to get this working. Any suggestions
would be appreciated.
Thanks,
-weg22