Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void setup() {
- // put your setup code here, to run once:
- Serial.begin(19200, SERIAL_8E1);
- Serial.println("ASCII Table - Character Map");
- }
- int thisByte = 'U';
- void loop() {
- // put your main code here, to run repeatedly:
- Serial.write(thisByte);
- delay(1000);
- }
- #include <SoftwareSerial.h>
- Software mySerial(2, 3); //pin2 -> RX, pin3-> TX
- int newLineSerial=true;
- void setup(){
- //Open Serial communications and wait for port to open:
- Serial.begin(57600);
- Serial.println("Hardware UART Up!);
- //Configure the data rate for the SW UART
- mySerial.begin(4800); //8 Data Bit, No Parity, 1 STOP Bit
- }
- void loop(){
- if(Serial.available())
- {
- if(newLineSerial) //If Newline character received
- {
- mySerial.write("PCI>> ");
- newLineSerial=false;
- }
- else
- {
- int byteRead = Serial.read(); //read from HW UART (Data from PC's Serial monitor)
- mySerial.write(byteRead); //Write to SW UART, which is connected to the SW UART on the other Arduino Board
- if(byteRead=='\n') newLineSerial=true;
- }
- }
- if(mySerial.available())
- {
- Serial.write(mySerial.read()); //Output to Serial Monitor
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement