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 2 device.
DO PART III ONLY where you have to write code on firmware with two's complement
2 buttons (with "lefty" connected to D8 and "righty" to D6)
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 2
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 2
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 lab2, the LEDs will display digits -8 to +7(using 2's complement). You may need to review your CS 251 notes to figure this out.
Each time the right button is pressed, the digit will increment. When 7 is exceeded, roll around to -8
Each time the left button is pressed, the digit will decrement. Roll around from -8 to 7.
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 (a= very slow; s= slow; d= fast; f= very fast). You may choose the speeds, just make sure they are distinguishable from one another.
// Define the pins for LEDs int blueLED = D0; // Repre (LSB)
int greenLED = D1;
int yellowLED = D2;
int redLED = D3; ,?? Repr
(MSB)
 In partiParticle C++ for a photon 2 device. DO PART III

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!