Serial Port (RS -232) Connection in C++

Please take a look here: RS-232 for Linux and Windows 1) Windows Serial Port Programming 2) Using the Serial Ports in Visual C++ 3) Serial Communication in Windows 1) You can use this with Windows (incl. MinGW) as well as Linux. Alternative you can only use the code as an example. 2) Step-by-step tutorial how … Read more

Python: Making a beep noise

On Windows, if you want to just make the computer make a beep sound: import winsound frequency = 2500 # Set Frequency To 2500 Hertz duration = 1000 # Set Duration To 1000 ms == 1 second winsound.Beep(frequency, duration) The winsound.Beep() can be used wherever you want the beep to occur.

PHP serial port data return from Arduino

I assume you work on linux. First setup your serial port: stty -F /dev/ttyACM0 cs8 9600 ignbrk -brkint -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke noflsh -ixon -crtscts Then you can use good old fashion fread/fwrite $fp =fopen(“/dev/ttyACM0”, “w+”); if( !$fp) { echo “Error”;die(); } fwrite($fp, $_SERVER[‘argv’][1] . 0x00); echo fread($fp, … Read more

How to open a serial port by friendly name?

Posting tonight’s code, for everybody’s enjoyment: public class SetupDiWrap { static public string ComPortNameFromFriendlyNamePrefix(string friendlyNamePrefix) { const string className = “Ports”; Guid[] guids = GetClassGUIDs(className); System.Text.RegularExpressions.Regex friendlyNameToComPort = new System.Text.RegularExpressions.Regex(@”.? \((COM\d+)\)$”); // “….. (COMxxx)” -> COMxxxx foreach (Guid guid in guids) { // We start at the “root” of the device tree and look for … Read more

tech