Serial COM port reading data

Friends, I have an Arduino Leonardo connected to my pc.

There is a temperature sensor on arduino sending a value through serial COM port to my computer.

What I´m planning to do is to create a graphical panel to show a pointer in a gauge according to my value obtained through serial.

The problem is:

I was trying to run a lua script that partially worked, i mean… I managed to open the COM port and according to the TX led of my arduino, the data was sent on the right interval, but I was unable to see any value on my terminal screen. 

I´m using the following scritp:

print("Serial Test Iniciated\n")while 1 do serialin=io.open("COM4","r") print(serialin:read("\*a")) --should print values on screen serialin:close()end

But it´s not working… due to the fact that I´m unable to see the numbers or any data sent through COM port on my screen.

Can anyone tell me what I´m doing wrong?

Thank you!

Please post back if you resolve this on your own.

Hi…The serial port can be implemented by several techniques such as ActiveX, access I/O and file operation. This article explains the use of serial port on Win32 platform by file operation technique. The programmer can use kernel32.lib library that is provided with the Microsoft Visual C++ Version 6.0. In Microsoft Windows serial port can be treated as a file. Therefore it’s possible to open a serial port by using Windows file-creating function.

http://percentagescalculator.com/

Please post back if you resolve this on your own.

I’m also trying without success

Someone managed to do it?

Good job everyone

Hi…The serial port can be implemented by several techniques such as ActiveX, access I/O and file operation. This article explains the use of serial port on Win32 platform by file operation technique. The programmer can use kernel32.lib library that is provided with the Microsoft Visual C++ Version 6.0. In Microsoft Windows serial port can be treated as a file. Therefore it’s possible to open a serial port by using Windows file-creating function.

http://percentagescalculator.com/

I’m also trying without success

Someone managed to do it?

Good job everyone