Pages: 1 [2]   Go Down
Author Topic: Can't store the values I get from my temperature in the database.  (Read 1405 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Edison Member
*
Karma: 26
Posts: 1339
You do some programming to solve a problem, and some to solve it in a particular language. (CC2)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I overlooked this part:

Quote
This exception only appears when I have the arduino software running and getting the temperature values. When it's not running, nothing happens, and the buttons don't work. here is the code of my WFApplication.

To OP: you can't have two applications open the same com port at the same time. If you have the Arduino IDE running and serial monitor open, COM4 (or whatever it is) is locked. You have to close the serial monitor or probably quit the entire Arduino IDE before your C# app can open COM4.

This will make the "port locked" error go away.

If the program doesn't work, keeping the Arduino IDE open is not the solution.
Logged

Offline Offline
Edison Member
*
Karma: 26
Posts: 1339
You do some programming to solve a problem, and some to solve it in a particular language. (CC2)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
private void timer1_Tick(object sender, EventArgs e)
        {
            string POT = sp1.ReadExisting();
            label1.Text = POT;
        }

I usually code in vb.net, but... I don't see where you initialize and start timer1, not where you associate timer1_Tick method with the timer1 tick event...
Logged

Pages: 1 [2]   Go Up
Jump to: