Real-Time Embedded Processor Systems ACOE343 Experiment #6

Real-Time Embedded Processor Systems ACOE343 Experiment #6

<p> Real-Time Embedded Processor Systems – ACOE343 – Experiment #6</p><p>Department of Computer Science and Engineering</p><p>Real-Time Embedded Systems Laboratory (ACOE343)</p><p>Laboratory Exercise #6</p><p>Serial communication with Arduino</p><p>Student’s Name: Semester: Date:</p><p>Assessment: Assessment Point Weight Grade Methodology Presentation and discussion of results Participation Assessment Points’ Grade </p><p>Comments: Real-Time Embedded Processor Systems – ACOE343 – Experiment #6</p><p>Lab #6: Serial communication with Arduino</p><p>Procedure: In this lab you will need two Arduinos and two PCs!</p><p>Step 1: Connect two Arduino Boards through the serial bus by connecting the first Arduino TX pin to the second Arduino RX pin and vice versa. Connect the GND pins of the two Arduinos together through a wire for a common ground.</p><p>Step 2: Write a program for the first Arduino (Lab6a1) that sends a “Hello world!” string from the first Arduino to the second, and a program for the second Arduino (Lab6a2) that receives the string and prints it on the Serial monitor. Don’t forget to initialize the serial connection with Serial.begin(); Use the following functions and variables for your program: char txstr[] = "…"; //String data Serial.write(txstr, int length); //Write the serial data, wher length the length of the string char rxstr[]; //Initialized variable to store received data Serial.readBytes(rxstr, int length); //Read the serial data and store in var rxstring where int the length of the string</p><p>Insert code here....</p><p>Step 3: Compile the program (From the “Sketch” menu select “Verify/Compile”). If the compiler shows any errors, correct them and re-compile the program.</p><p>Step 4:  Select "Tools=> Board=> Chipkit MAX32""  Select "File=>Upload to I/O Board".  Wait until you see a "Done uploading" message. An LED in the shield should be flashing.</p><p>Question 1</p><p>What is the size of each program in bytes? Real-Time Embedded Processor Systems – ACOE343 – Experiment #6</p><p>Step 5: Write a program (Lab6b) for each Arduino that reads the temperature sensor and sends the temperature to the other Arduino. Both Arduinos, after receiving each other’s temperature, compare it with their own, and print on the serial monitor which temperature is higher. The sampling interval is one second.</p><p>Step 6: Compile the program (From the “Sketch” menu select “Verify/Compile”). If the compiler shows any errors, correct them and re-compile the program.</p><p>Step 7:  Select "Tools=> Board=> Chipkit MAX32""  Select "File=>Upload to I/O Board".  Wait until you see a "Done uploading" message. An LED in the shield should be flashing.</p><p>Insert code here....</p><p>Question 2</p><p>What is the size of the Lab3b program in bytes?</p>

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    3 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us