Question: In partiParticle C + + for a photon 2 device. DO PART III ONLY where you have to write code on firmware with two's complement
In partiParticle C for a photon device.
DO PART III ONLY where you have to write code on firmware with two's complement
buttons with "lefty" connected to D and "righty" to D
In Fritzing, create a breadboard that represents the product
Arrange the LEDs in the order red, yellow, green, blue forming a horizontal line parallel to the long side of the breadboard
Arrange the buttons similarly.
Keep the board as compact as possible
Construct the circuit on a physical breadboard so that it resembles as closely as possible your Fritzing document
Plug in your Photon
Write the firmware to print out "left" or "right" to the serial port, depending on whether the left or right button is pressed
With the USB port pointing away from you, the left button will be on your left
Flash the firmware to your Photon
Verify that your left and right buttons are working appropriately
Part III: Project
Write the firmware so that the device has the following behavior.
As in lab the LEDs will display digits to using s complement You may need to review your CS notes to figure this out.
Each time the right button is pressed, the digit will increment. When is exceeded, roll around to
Each time the left button is pressed, the digit will decrement. Roll around from to
While both buttons are pressed simultaneously, the LEDs will automatically count up or down up if the right button was pressed most recently, or no button had been pressed prior; down if the left button was pressed most recently Once one or both buttons are released the automatic counting will stop
The speed with which the LEDs animate during the counting process will be determined by reading in an input from the terminal very slow; slow; fast; very fast You may choose the speeds, just make sure they are distinguishable from one another.
Define the pins for LEDs int blueLED D; Repre LSB
int greenLED D;
int yellowLED D;
int redLED D; Repr
MSB
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
