Quantcast
Channel: CodeChef Discuss - latest questions
Viewing all articles
Browse latest Browse all 40121

Serial Port programming Code

$
0
0

Construct a working C++ program in either Dev-C developer for implementing a serial port programming code. You need to access the data coming in the serial port (USB port) via Arduino, to your laptop/desktop, and log that data into a text file called Log.txt. You must find when the port is active and hence open the file, write the incoming data and finally close it. Check again for incoming data and re-open the file, to append new data.

For the Arduino, the following code is given, you have to use this.

int x; void setup() { Serial.begin(9600); } void loop() { x = 0; for(int i=0;i<20;i++) { Serial.print("The Value of the variable is =");Serial.println(x); x++; delay(1000); } delay(500); }


Viewing all articles
Browse latest Browse all 40121

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>