Haris Rao Lab 4
.docx
keyboard_arrow_up
School
Brooklyn College, CUNY *
*We aren’t endorsed by this school
Course
CET4711
Subject
Computer Science
Date
Apr 3, 2024
Type
docx
Pages
23
Uploaded by MagistrateResolve1044
Computer Engineering Technology Department CET 4711 – Computer Controlled System Design Year & Semester: 2024 Spring
Instructor Name: Professor F. Zia
Lab Report
Lab# and Title:
Lab-4 Data Communication between Arduino and Processing
Date:
3/11/2024
Student Name:
Haris Rao
Page 2 of 23
Table of Contents:
1.
Objectives
2.
Component List
3.
Procedure
4.
Diagrams
5.
Source Code
6.
Measurements
7.
Troubleshooting
8.
Discussion
9.
Conclusion
Page 3 of 23
1. Objectives:
1. Become familiar with the Processing graphical environment, Java language, and reference site.
2. Understand the basics of data communication between Arduino and Processing.
3. Create a simple interactive system using Arduino and Processing.
2.
Component / Equipment List:
Microcontroller development board (UNO, MEGA etc.) with USB cable
Breadboard
Jumper Wires
Resistors (Potentiometer 10k)
Page 4 of 23
3. Procedure:
1. In a new Processing sketch, open the example MouseeCircle.pde code available in Lab-#.zip
file. The MouseeCircle.pde code is shown on next page (inside the text box) for reference.
2. Run the code in Processing IDE. You should see a circle drawn inside a graphics window, that will follow the mouse pointer.
3. Go to Processing reference website and look for the following functions used in the code.
size(255, 255);
strokeWeight(10); frameRate(16); background(100); fill(0, 121, 184);
stroke(255);
ellipse(X, Y, radius, radius);
4. For each of the functions shown above, copy the function description from the Reference web site and paste it inside a comment block /* … */ before each function. The purpose is to thoroughly understand how the function works.
5. Final code for Part A of the lab should include a comment for each function used in the code, indicating what each function does.
6. Save the final modified code in a file and include it in your report.
7. Take a screenshot of the graphics window with the circle, to include in the Measurements section of the lab report.
Procedure Part B (Design) (Interactive Circle):
In the following steps you will create a new version of the previous processing sketch MouseeCircle.pde, where the size of the circle, the radius, is controlled by a potentiometer connected to an Arduino board. The readings of the potentiometer in the Arduino will be sent through serial/USB communication to the Processing sketch running on the PC.
8. To refresh your memory about Arduino, potentiometers, and serial communication, refer to
the Arduino IDE example AnalogReadSerial. This example program can be used to complete the Arduino side of this lab exercise. Upload the Arduino example AnalogReadSerial to the Arduino board.
9. For the Processing program, you will need to make use of the Processing serial library. ( Serial library reference: https://processing.org/reference/libraries/serial/ )
Add following lines shown inside the text box, to beginning of program before /* Global variables */ section:
10. Next, you will need to add the following lines shown inside the text box, in the beginning of the setup( ) function to activate the serial port.
IMPORTANT NOTE: You will need to specify the correct USB/COM (serial) port index number
in square brackets in Serial.list()[0], where Arduino USB cable is connected.
The first USB/COM port on your PC is indicated by Serial.list()[0] The second USB/COM port on your PC is indicated by Serial.list()[1]
Page 5 of 23
The third USB/COM port on your PC is indicated by Serial.list()[2] so on and so forth.
This is how serial communication works in Processing. When it is setup as above and there
is data coming through the serial port, the serial library triggers a serial event that is captured
by the function shown below.
11. Add the following serialEvent( ) function shown inside the text box, to the end of your code after all the other functions.
12. Comment each line of the serialEvent() function to show that you understand how it works.
13. Run the modified Processing sketch on the PC.
14. Rotate potentiometer connected to Arduino analog input to change the size of the circle.
15. (Extra Credit) Change two other attributes of the circle by using the radius variable. For example,
vary the shape of the circle to an oval, vary the fill color of the circle, etc.
16. Put a copy of final modified Processing code (sketch) for Part B in your report.
17. Take a screenshot of the graphics window, to include in the Measurements section of the lab report.
Page 6 of 23
4.
Diagrams and Pictures:
Hardware: (Schematic diagram)
Hardware: (Picture(s) of electrical circuit / Physical circuit layout diagram)
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Related Questions
A digital signal program is to be manipulated using either Von Newman or Harvard architecture.a) with the aid of a diagram, critically explain why you would choose either of them for the manipulation. b) Assuming your architecture is in full operation, with the aid of a computer system diagram, explain the various operational components of your architecture
arrow_forward
What is the significance of Moore's Law in the context of microchip development and how has it evolved over time?
arrow_forward
please write for lap report introduction and conclusion about Data transfer using external Memory
arrow_forward
Provide following diagrams for ATM machine
Packages diagram
Component Diagram
Deployment Diagram
arrow_forward
Explain the concept of Moore's Law and its relevance to microchip development.
arrow_forward
Explain the concept of Moore's Law and its impact on microchip development over the years.
arrow_forward
In a computer-based instrumentation system, identify the four components that make it up.
arrow_forward
in computer organization and architecture create a simple program to evaluate the performance of a computer system.
arrow_forward
Explain the main steps of the AM process in detail.
• Conceptualization and CAD
• Conversion to STL/AMF
• Transfer and manipulation of STL/AMF file on AM machine• Machine setup• Build• Part removal and cleanup• Post-processing of part• Application
arrow_forward
Draw a complete block diagram.
arrow_forward
How does Moore's Law relate to the development of microchips, and what are its implications?
arrow_forward
The use of a siloed information system is associated with a number of possible downsides and disadvantages.
arrow_forward
discuss four importance of monte carlos simulation
arrow_forward
The description and completion of the IOT temperature monitoring system are presented.
arrow_forward
The salesforce structure at cascade Maverick is a ___
arrow_forward
Create a diagram depicting the Von-Neuman architecture and explain what each component does.
arrow_forward
Define benchmark in computer system
arrow_forward
Explain the concept of Moore's Law and its impact on microchip development.
arrow_forward
What is the significance of Moore's Law in the context of microchip development and performance?
arrow_forward
sketch a water softening plant , label its part and their functions
arrow_forward
What distinguishes the TPC from the SPEC in terms of its primary focus?
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning
Related Questions
- A digital signal program is to be manipulated using either Von Newman or Harvard architecture.a) with the aid of a diagram, critically explain why you would choose either of them for the manipulation. b) Assuming your architecture is in full operation, with the aid of a computer system diagram, explain the various operational components of your architecturearrow_forwardWhat is the significance of Moore's Law in the context of microchip development and how has it evolved over time?arrow_forwardplease write for lap report introduction and conclusion about Data transfer using external Memoryarrow_forward
- Provide following diagrams for ATM machine Packages diagram Component Diagram Deployment Diagramarrow_forwardExplain the concept of Moore's Law and its relevance to microchip development.arrow_forwardExplain the concept of Moore's Law and its impact on microchip development over the years.arrow_forward
- In a computer-based instrumentation system, identify the four components that make it up.arrow_forwardin computer organization and architecture create a simple program to evaluate the performance of a computer system.arrow_forwardExplain the main steps of the AM process in detail. • Conceptualization and CAD • Conversion to STL/AMF • Transfer and manipulation of STL/AMF file on AM machine• Machine setup• Build• Part removal and cleanup• Post-processing of part• Applicationarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrSystems ArchitectureComputer ScienceISBN:9781305080195Author:Stephen D. BurdPublisher:Cengage Learning
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning