Project A Electronics Engineering Technology Project A ELTR2302: Embedded Systems III XXXXXXXXXXStudent Name: ____________________________ ELTR2302.ProjectA Page 1 of 3 Outcomes of this Project 1....

1 answer below »
im hoping yall can help me


Project A Electronics Engineering Technology Project A ELTR2302: Embedded Systems III Student Name: ____________________________ ELTR2302.ProjectA Page 1 of 3 Outcomes of this Project 1. Interpretation and correct use of data specification sheets. 2. Implement a simple embedded system circuit design, interfacing a microcontroller with the following analog/digital devices: a. A 4x4 matrix membrane keypad. b. Two Servo Motors c. An Analog thumb joystick d. Two LEDs: one red and one green. 3. Write firmware (software) for a microcontroller embedded system application. Project Description and Procedure. ABC Engineering has completed a preliminary embedded system design using a joystick to control two servo motors using an Arduino Nano (Microchip 328p) microcontroller. The lead engineer has spec’d out the required components for use with the system. They include the following: Parallax Inc 4x4 Matrix Membrane Keypad (#27899) Keypad Library for Arduino by Mark Stanley and Alexander Brevig (IDE download) Adafruit Analog 2-axis Thumb Joystick with Select Button + Breakout Board (ID: 512) FeeTech FS90 Micro Servo Specifications => Servo Additional Information Red and Green LEDs The engineer has also provided the required pinout and connection diagram for the implementation of the design that must be followed. No deviations are permitted. https://www.parallax.com/sites/default/files/downloads/27899-4x4-Matrix-Membrane-Keypad-v1.2.pdf https://playground.arduino.cc/Code/Keypad/ https://www.adafruit.com/product/512 https://www.pololu.com/file/0J1435/FS90-specs.pdf https://www.pololu.com/product/2818 Electronics Engineering Technology Project A ELTR2302: Embedded Systems III Student Name: ____________________________ ELTR2302.ProjectA Page 2 of 3 ABC Engineering has requested ELTR2302 students to build a prototype of the embedded system as well as write the firmware (software) required for its operation. The lead engineer has provided the following requirements in keeping with ABC’s internal programming standards used with all of their firmware. Firmware guidelines. The program is to be written in a modular format with each state of operation self-contained in a function. The three required states of operation for this system are as follows. State0 => The initialization/reset condition State1 => The keypad entry State2 => The joystick and servo-motor operations. The program is to have the following structure. Again, no deviation is permitted as this is ABC’s standard program structure. #include, #define, and system variable definitions first. void setup() //Setup the system for operation void loop() //Main program loop void State0() //State0 function void State1() //State1 function void State2() //State2 function ISR() //Appropriate Interrupt Service Routine as required. Firmware Details A system-wide variable (global variable) called OP_State (short for operational state) is to be used to keep track of the current system state. Upon initialization/reset, this variable should be zero (0). The void loop() function template is given as follows: if (OP_State ==0) // call the state0 function if (OP_State ==1) // call the state1 function if (OP_State ==2) // call the state2 function Electronics Engineering Technology Project A ELTR2302: Embedded Systems III Student Name: ____________________________ ELTR2302.ProjectA Page 3 of 3 The void state0() function pseudo code template is give as follows: Set the Red and Green LEDs as off. In an infinite loop, toggle the Red LED on and off using the appropriate PIN function Use the millis() function to determine the on and off time such that the period is 500ms. The delay() function is not permitted. Breakout of the infinite loop if the OP_State changes to 1, via the ISR() function. The void state1() function pseudo code template is give as follows: Ensure the Green LED is off and turn the Red LED on solid. Wait until a key is pressed from the keypad. (use the waitForKey() function) If the keypress is not ‘*’, change the OP_State back to State0 and exit the function If the keypress is ‘*’ key, enter two additional key presses. If the 2 digits match the predefined access code ‘4A’, change the OP_State to State2 and exit the function (Note: The 2 digit access code is globally defined as an array or string of characters.) Otherwise change the OP_State back to State0 and exit the function. The void state2() function pseudo code template is give as follows: Ensure the Green LED is on solid and the Red LED is off. In a continuous loop, change the position of the servo-motors via the joystick X-Axis and Y-Axis values. Check the status of the keypad for the ‘#’ key (use the getKey() function for this). Note: The servo motor must be controlled by configure the appropriate timers, not using servomotor library functions. The continuous loop should end if the ‘#’ key was entered. Then reset the OP_State to State0 and exit the function. The appropriate ISR() function pseudo code template is give as follows: The ISR is entered when the Joystick pushbutton is pressed. If the current state is 0, then the OP_State is changed to 1, when the button is released. If the joystick button is pressed when not in OP_State 0, the button press is ignored. The course instructor is the main contact with the lead engineer from ABC Engineering. They require students to present their designs to the course instructor to verify correct hardware and firmware operation of the circuit. A project completion guide will be provided separately. Best of luck with your design.
Answered 1 days AfterOct 01, 2021

Answer To: Project A Electronics Engineering Technology Project A ELTR2302: Embedded Systems III...

Sathishkumar answered on Oct 02 2021
146 Votes
#include
const byte ROWS = 4; //four rows
const byte COLS = 4; //four columns
//define
the cymbols on the buttons of the keypads
char hexaKeys[ROWS][COLS] = {
{'0','1','2','3'},
{'4','5','6','7'},
{'8','9','A','B'},
{'C','D','E','F'}
};
#define Joy_X A0
#define Joy_Y A1
#define Servo_X 9
#define Servo_Y 10
#define Green_led 11
#define Red_led 12
#define J_Button 8
unsigned long previousMillis = 0; // will store last time LED was updated
const long interval = 500;
byte rowPins[ROWS] = {5, 4, 3, 2}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {A5, A4, A3, A2}; //connect to the column pinouts of the keypad
int op_state = 0;
int key = 0;
int XValue = 0;
int XoutputValue = 0;
int YValue = 0;
int YoutputValue = 0;
int MicroSecondsOfPeriod = 20 * 1000; // 20 milliseconds (ms)
int MicroSecondsOfPulse = 1.8 * 1000; // 1.0 ms is 0 degrees
int ledState = LOW;
//initialize an instance of class...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here