ELD-3110 Lab1

docx

School

Thomas Edison State College *

*We aren’t endorsed by this school

Course

311

Subject

Computer Science

Date

Jan 9, 2024

Type

docx

Pages

5

Uploaded by DrJellyfish3760

Report
LAB1 E L D - 3 1 1 0 Messier, Michael J (mjmessier) |
Report (60 percent): . Introduction: The first lab experiment involved downloading the necessary software for the Arduino board and writing a simple sketch to control the onboard LED. The objective was to make the Arduino Uno board blink its built-in LED with a 1-second interval and subsequently modify the sketch to change the blinking interval to 2 seconds. Materials: Arduino Uno board USB A to B cable Computer with the Arduino IDE installed Internet connection With the Arduino Uno connected to our computer via a USB cable, we verified that the computer recognized the board. We then proceeded to write the code that would control the onboard LED on pin 13. Our initial sketch set the LED pin as an output, illuminating the LED for a period of 1 second and then extinguishing it for an additional second. Upon uploading this code to the Arduino Uno, the board commenced blinking its onboard LED at a 1-second interval. As an additional step, we edited the sketch to adjust the blinking interval to 2 seconds. After recompiling and uploading the updated sketch to the Arduino Uno, the onboard LED now blinked every 2 seconds. In conclusion, this introductory lab experiment provided a foundational understanding of working with the Arduino Uno board. It entailed downloading the Arduino IDE, writing a sketch to control the onboard LED, and modifying the sketch to adjust the blinking interval. This experiment marks the starting point for our exploration of Arduino programming and hardware interfacing, setting the stage for more advanced projects and learning opportunities. Video Demonstration (40 percent) Exercise 1: Installing Arduino software Install the latest version of Arduino software on your computer. The resource links in Module 1 provide detailed instructions on how to do it. The video clip for this exercise should show the launch of the Arduino IDE by clicking the shortcut icon on the desktop of your computer. Exercise 2: Running your first sketch Connect the Arduino UNO board to your computer using the supplied USB cable. Launch Arduino IDE and select the right board and port. Start a new sketch using File > New menu options.
Add the following line to the setup area to initialize the serial port at 9600 baud: Serial.begin(9600); Next, add the following lines to the loop area: Serial.println("This is my first Arduino sketch!"); while(1); Save the sketch as Lab1-1. Compile the sketch and download to the board. Launch the Serial Monitor from the Tools menu. It should display the message.
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
The video clip for this exercise should start with the serial monitor window showing the message. Now bring the UNO board in view and press the reset button. Another copy of the message should appear in the serial monitor window. Exercise 3: LED blink example Open the existing blink sketch by going to File > Examples > 01Basic > Blink. Compile and download the program to the UNO board. You will see the that the on board LED connected to pin 13 starts blinking one second on and one second off. Save the sketch as Lab1-2. Edit the value in the second 'delay' statement, changing it from 1000 to 2000. Compile and download the sketch again. Note the difference in the blinking pattern and provide an explanation in the report. /* MIkes First Program int ledPin = 13; void setup() ( //initialize pins as outputs pinMode(ledPin, OUTPUT); ) void loop() ( digitalWrite(ledPin, HIGH); delay(1000); digitalWrite(ledPin, LOW); delay(1000); void loop() ( digitalWrite(ledPin, HIGH); delay(2000); digitalWrite(ledPin, LOW); delay(2000);