Menu Close
Spread the love

c++ arduino serial communication


Serial Communication with C++ Project. C++ windows application
with Arduino nano Communication Serial A photoresistor or light-dependent


Arduino Serial Comminucation

Communicating to the Arduino in the .NET platform is pretty much straightforward: The Arduino uses a virtual serial
port to allow programs to be written onto it, but we can also use this port to get and send data to and from the Arduino.

Parts Required:

  1. Arduino NANO
  2. LDR (1)
  3. LCD 16×2 (1)
  4. Wires to connect it all together



#include <LiquidCrystal.h>

const int buttonPin = A2;
const int ledPin =  8;
int buttonState = 0;
int ledstat = 0;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
const int sensorMin = 0;
const int sensorMax = 600;

void setup() {
pinMode(buttonPin, INPUT);

lcd.begin(16, 2);

void loop() {

lcd.setCursor(0, 1);

int sr = analogRead(A2);
// map the sensor range to a range of four options:
int range = map(sr, 0, 1023, 0, 255);

if (sr < 5){




For more Please make sure to subscribe to Officialhrm YouTube channel and like Facebook Page.

Thank you for visiting OfficialhrmPlease don’t forget to share this website with your friends.


File Description Date added File size Downloads
zip Serial comminication with arduino August 15, 2018 4:27 pm 8 MB 6203
Posted in Arduino

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *