Skip to main content
Arduino

Return to Question

Commonmark migration
Source Link

Genuino Zero (RX) pin 0 ---------------- Arduino Uno pin 11

Genuino Zero (TX) pin1 ---------------- Arduino Uno pin 10

Ground ---------------------------------- Ground

Genuino Zero (RX) pin 0 ---------------- Arduino Uno pin 11

Genuino Zero (TX) pin1 ---------------- Arduino Uno pin 10

Ground ---------------------------------- Ground

Genuino Zero (RX) pin 0 ---------------- Arduino Uno pin 11

Genuino Zero (TX) pin1 ---------------- Arduino Uno pin 10

Ground ---------------------------------- Ground

Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
deleted 300 characters in body
Source Link
dda
  • 1.6k
  • 1
  • 12
  • 17
#include <SoftwareSerial.h>
SoftwareSerial mySerial(10, 11); // RX, TX
/* Simple Serial ECHO script : Written by ScottC 03/07/2012 */
/* Use a variable called byteRead to temporarily store
 the data coming from the computer */
byte byteRead;
void setup() { 
// Turn the Serial Protocol ON
 Serial.begin(9600);
 mySerial.begin(9600);
 pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {
 char a[8];
 /* check if data has been sent from the computer: */
 if (Serial.available()) {
 /* read the most recent byte */
 byteRead = Serial.read();
 //a[0] = atoi(byteRead);
 // a[1] = atoi(byteRead);
 Serial.print("rushin\r\n");
 /*ECHO the value that was read, back to the serial port. */
 if(byteRead == 0x61) {
 digitalWrite(LED_BUILTIN, HIGH);
 Serial.write(byteRead);
 }
 }
 if (mySerial.available()) {
 /* read the most recent byte */
 byteRead = mySerial.read();
 //a[0] = atoi(byteRead);
 //  a[1] = atoi(byteRead);
 mySerial.print("rushin\r\n");
 /*ECHO the value that was read, back to the serial port. */
 if(byteRead == 0x61) {
 digitalWrite(LED_BUILTIN, HIGH);
 mySerial.write(byteRead);
 }
 }
}
-------------------transmitter----------------------------------
/*
 DigitalReadSerial
 Reads a digital input on pin 2, prints the result to the serial monitor
 This example code is in the public domain.
 */
// digital pin 2 has a pushbutton attached to it. Give it a name:
int pushButton = 7;
// the setup routine runs once when you press reset:
void setup() {
 // initialize serial communication at 9600 bits per second:
 Serial.begin(9600);
 // make the pushbutton's pin an input:
 pinMode(pushButton, INPUT);
}
// the loop routine runs over and over again forever:
void loop() {
 // read the input pin:
 int buttonState = digitalRead(pushButton);
 // print out the state of the button:
 // if(buttonState == 1)
 //{
 Serial.println("a");
 // }
  delay(1000); // delay in between reads for stability
}
#include <SoftwareSerial.h>
SoftwareSerial mySerial(10, 11); // RX, TX
/* Simple Serial ECHO script : Written by ScottC 03/07/2012 */
/* Use a variable called byteRead to temporarily store
 the data coming from the computer */
byte byteRead;
void setup() { 
// Turn the Serial Protocol ON
 Serial.begin(9600);
 mySerial.begin(9600);
 pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {
 char a[8];
 /* check if data has been sent from the computer: */
 if (Serial.available()) {
 /* read the most recent byte */
 byteRead = Serial.read();
 //a[0] = atoi(byteRead);
 // a[1] = atoi(byteRead);
 Serial.print("rushin\r\n");
 /*ECHO the value that was read, back to the serial port. */
 if(byteRead == 0x61) {
 digitalWrite(LED_BUILTIN, HIGH);
 Serial.write(byteRead);
 }
 }
 if (mySerial.available()) {
 /* read the most recent byte */
 byteRead = mySerial.read();
 //a[0] = atoi(byteRead);
 //  a[1] = atoi(byteRead);
 mySerial.print("rushin\r\n");
 /*ECHO the value that was read, back to the serial port. */
 if(byteRead == 0x61) {
 digitalWrite(LED_BUILTIN, HIGH);
 mySerial.write(byteRead);
 }
 }
}
-------------------transmitter----------------------------------
/*
 DigitalReadSerial
 Reads a digital input on pin 2, prints the result to the serial monitor
 This example code is in the public domain.
 */
// digital pin 2 has a pushbutton attached to it. Give it a name:
int pushButton = 7;
// the setup routine runs once when you press reset:
void setup() {
 // initialize serial communication at 9600 bits per second:
 Serial.begin(9600);
 // make the pushbutton's pin an input:
 pinMode(pushButton, INPUT);
}
// the loop routine runs over and over again forever:
void loop() {
 // read the input pin:
 int buttonState = digitalRead(pushButton);
 // print out the state of the button:
 // if(buttonState == 1)
 //{
 Serial.println("a");
 // }
  delay(1000); // delay in between reads for stability
}
#include <SoftwareSerial.h>
SoftwareSerial mySerial(10, 11); // RX, TX
/* Simple Serial ECHO script : Written by ScottC 03/07/2012 */
/* Use a variable called byteRead to temporarily store
 the data coming from the computer */
byte byteRead;
void setup() { 
// Turn the Serial Protocol ON
 Serial.begin(9600);
 mySerial.begin(9600);
 pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {
 char a[8];
 /* check if data has been sent from the computer: */
 if (Serial.available()) {
 /* read the most recent byte */
 byteRead = Serial.read();
 Serial.print("rushin\r\n");
 /*ECHO the value that was read, back to the serial port. */
 if(byteRead == 0x61) {
 digitalWrite(LED_BUILTIN, HIGH);
 Serial.write(byteRead);
 }
 }
 if (mySerial.available()) {
 /* read the most recent byte */
 byteRead = mySerial.read();
 mySerial.print("rushin\r\n");
 /*ECHO the value that was read, back to the serial port. */
 if(byteRead == 0x61) {
 digitalWrite(LED_BUILTIN, HIGH);
 mySerial.write(byteRead);
 }
 }
}
-------------------transmitter----------------------------------
/*
 DigitalReadSerial
 Reads a digital input on pin 2, prints the result to the serial monitor
 This example code is in the public domain.
 */
// digital pin 2 has a pushbutton attached to it. Give it a name:
int pushButton = 7;
// the setup routine runs once when you press reset:
void setup() {
 // initialize serial communication at 9600 bits per second:
 Serial.begin(9600);
 // make the pushbutton's pin an input:
 pinMode(pushButton, INPUT);
}
// the loop routine runs over and over again forever:
void loop() {
 // read the input pin:
 int buttonState = digitalRead(pushButton);
 // print out the state of the button:
 Serial.println("a");
 delay(1000); // delay in between reads for stability
}
added 2541 characters in body
Source Link
Beginner
  • 43
  • 2
  • 9

-------------------receiver---------------------

#include <SoftwareSerial.h>
SoftwareSerial mySerial(10, 11); // RX, TX
/* Simple Serial ECHO script : Written by ScottC 03/07/2012 */
/* Use a variable called byteRead to temporarily store
 the data coming from the computer */
byte byteRead;
void setup() { 
// Turn the Serial Protocol ON
 Serial.begin(9600);
 mySerial.begin(9600);
 pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {
 char a[8];
 
 /* check if data has been sent from the computer: */
 if (Serial.available()) 
 {
 /* read the most recent byte */
 byteRead = Serial.read();
 //a[0] = atoi(byteRead);
 // a[1] = atoi(byteRead);
 Serial.print("rushin\r\n");
 /*ECHO the value that was read, back to the serial port. */
 if(byteRead == 0x61)
 {
 digitalWrite(LED_BUILTIN, HIGH);
 Serial.write(byteRead);
 }
 }
 if (mySerial.available()) 
 {
 /* read the most recent byte */
 byteRead = mySerial.read();
 //a[0] = atoi(byteRead);
 // a[1] = atoi(byteRead);
 mySerial.print("rushin\r\n");
 /*ECHO the value that was read, back to the serial port. */
 if(byteRead == 0x61)
 {
 digitalWrite(LED_BUILTIN, HIGH);
 mySerial.write(byteRead);
 }
 }
 
}
-------------------transmitter----------------------------------
/*
 DigitalReadSerial
 Reads a digital input on pin 2, prints the result to the serial monitor
 This example code is in the public domain.
 */
// digital pin 2 has a pushbutton attached to it. Give it a name:
int pushButton = 7;
// the setup routine runs once when you press reset:
void setup() {
 // initialize serial communication at 9600 bits per second:
 Serial.begin(9600);
 // make the pushbutton's pin an input:
 pinMode(pushButton, INPUT);
}
// the loop routine runs over and over again forever:
void loop() {
 // read the input pin:
 int buttonState = digitalRead(pushButton);
 // print out the state of the button:
 // if(buttonState == 1)
 //{
 Serial.println("a");
 // }
 delay(1000); // delay in between reads for stability
}

-------------------receiver---------------------

#include <SoftwareSerial.h>
SoftwareSerial mySerial(10, 11); // RX, TX
/* Simple Serial ECHO script : Written by ScottC 03/07/2012 */
/* Use a variable called byteRead to temporarily store
 the data coming from the computer */
byte byteRead;
void setup() { 
// Turn the Serial Protocol ON
 Serial.begin(9600);
 mySerial.begin(9600);
 pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {
 char a[8];
 
 /* check if data has been sent from the computer: */
 if (Serial.available()) 
 {
 /* read the most recent byte */
 byteRead = Serial.read();
 //a[0] = atoi(byteRead);
 // a[1] = atoi(byteRead);
 Serial.print("rushin\r\n");
 /*ECHO the value that was read, back to the serial port. */
 if(byteRead == 0x61)
 {
 digitalWrite(LED_BUILTIN, HIGH);
 Serial.write(byteRead);
 }
 }
 if (mySerial.available()) 
 {
 /* read the most recent byte */
 byteRead = mySerial.read();
 //a[0] = atoi(byteRead);
 // a[1] = atoi(byteRead);
 mySerial.print("rushin\r\n");
 /*ECHO the value that was read, back to the serial port. */
 if(byteRead == 0x61)
 {
 digitalWrite(LED_BUILTIN, HIGH);
 mySerial.write(byteRead);
 }
 }
 
}
-------------------transmitter----------------------------------
/*
 DigitalReadSerial
 Reads a digital input on pin 2, prints the result to the serial monitor
 This example code is in the public domain.
 */
// digital pin 2 has a pushbutton attached to it. Give it a name:
int pushButton = 7;
// the setup routine runs once when you press reset:
void setup() {
 // initialize serial communication at 9600 bits per second:
 Serial.begin(9600);
 // make the pushbutton's pin an input:
 pinMode(pushButton, INPUT);
}
// the loop routine runs over and over again forever:
void loop() {
 // read the input pin:
 int buttonState = digitalRead(pushButton);
 // print out the state of the button:
 // if(buttonState == 1)
 //{
 Serial.println("a");
 // }
 delay(1000); // delay in between reads for stability
}
added 6 characters in body
Source Link
Beginner
  • 43
  • 2
  • 9
Loading
deleted 4 characters in body; edited title
Source Link
dda
  • 1.6k
  • 1
  • 12
  • 17
Loading
Source Link
Beginner
  • 43
  • 2
  • 9
Loading

AltStyle によって変換されたページ (->オリジナル) /