Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I just need the code and how it should look on arduino board Part 1 - Lbrary GPIO Open the blink example in the Acduino

I just need the code and how it should look on arduino board
image text in transcribed
Part 1 - Lbrary GPIO Open the blink example in the Acduino 10 by clicking Files Examples-Basicssblink. Compile and upload the code to your Arduine by clicking the right arfow shaped button at the top of the IDE. - Verify that the code is working - does the on-board Arduino LeD blink? Does it blink at the eapected rate? What is the frequency of the signal from the code? - Modify the code in the example to blink faster, and check cutput signal. What is the treguency of the sigral? - Modify the code in the example to blink as fast as possible and observe the signal. What is the fastest frequenty you can attain with the iterary functions? - Modify the example code to output the sigal on both pin 13 and pin 7. - Consect an LED and a resihtor in series to pin 7 , and configure it such that the LED is on when the pin is driven high. is this LED active high or active low? - Consect an LED and a resishor in series to pin 7, and configure it such that the LED is off when the pin is driven high. Is this LED active High or active low? Part 2 - Register-Level Output Download example_L ino from webcampus, this example demonstrates manipulating GPIO output at the register level, - What is the frequency of the signal on P87 without moditying the code? - Modify the code to switch the state of PB7 as tast as possible. What is the fastest frecuency you can attain using low level reester access functions? - What is limiting the maximum output frequency of the code? Are we appeoaching the clock frequency of the Arduine Mega? - What is the function of the line in the setup function? What does the DDR register do? - Explain what the 'or operation and the 'and' operation in the loop function are doing to the port register. What does the port rezister do? Part 3 - Preprocessor Definitions and Function Wrapping Download example_2 ino and example_3. ino from webcampos, these examples demonatrate two otferent ways to implement GPO at the register level. - What is the difference between erample_1.ino and example_ 2 ino? - What is the difference between example_ 2 . ino and example 3 ino? - After compining the Arduine ine lists the memery consumption for both program data, and variable data in the terminal window at the botom of the inf, compare the memery consumption of all three examples. - Modify example_ 2 ino and example_3. 3ine to maximize the trecuency oufput on PB7. What are the frequencies achieved?, as there any difference in the maximum frequency output between eamples 1 through 3 ? What explains the trequency differences? - is there any difference in readabity between the three examples? Part 4-Register-Level input Download example_4 ino from webcampus. This example code demonstrates how to implement register-tevel ingut connect a push button to PB4 wach that PB4 is erounded when the button is pressed, and open the Arduine Serial Moeitor by clicking the magitying glass at the top right comer of the IDE. Be sure to set the baud rate so that it matches the baud rate set in example_4. ino. - Why do we need to enable the pullup resingor on PB4? What would happen if the pullup revitor was not enabled? - Test your assumption from question :1 by modifying the example to diable the pullup resistor. is the input reliable? Does it reflect the state of the pin? What is the state of the pin when the button is not pressed? (Remember the 3 state in tristate devices) Part 5-Putting Everything Together Write an Arduino program to read the state of PK2, output this state on POO, and output the complement of the state on PE3. Write the program to minimize the time delay between a change on PK2 reflecting onto PO0 andPE3. Attach a button to PK2, and an LED (with a series resitor) to PDO

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Essentials of Database Management

Authors: Jeffrey A. Hoffer, Heikki Topi, Ramesh Venkataraman

1st edition

ISBN: 133405680, 9780133547702 , 978-0133405682

More Books

Students also viewed these Databases questions