Digistump Forums

General Discussion => Other Arduino Talk => Topic started by: harun on May 04, 2017, 07:01:34 pm

Title: Serial communication is not established
Post by: harun on May 04, 2017, 07:01:34 pm
hi, Where am I making mistakes? It does not work.

Code: [Select]
#include <SoftSerial.h>
#include <TinyPinChange.h>

SoftSerial mySerial(2, 3);

char data = 0;
void setup()
{
  Serial.begin(9600);
  pinMode(1, OUTPUT);
}

void loop()
{
  if(Serial.available() > 0)
  {
    data = Serial.read();
    Serial.print(data);
    Serial.print("\n");
    if(data == '1')
      digitalWrite(1, HIGH);
    else if(data == '0')
      digitalWrite(1, LOW);
  }                         
 
}

I dont know English. Sorry if translation is faulty.

Title: Re: Serial communication is not established
Post by: Amaury on August 19, 2017, 07:51:57 am
What microcontroller are you using? With what OS?
By the code i think u are just trying to send data from microcontroller to another microcontroller and check if you receive the same data.
You have to give more information if you want answers.