Welcome to My New music tech Blog
Digital Electronics Lab Final
Below is my code: int buttonPin[8] = { 33, 34, 35, 36, 37, 38, 39, 13}; int totalButtonPins = 8; int ledPin[8] = { 23, 21, 20, 19, 18, 17, 16, 14}; int totalLeds = 8; bool lastButton1State[8] = { LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW}; bool button1State[8] = { LOW, LOW, LOW,…
Digital Electronics Lab 11
Below is my code in part_1_button: #include "Button.h" Button buttonOne(33, 1); Button buttonTwo(34, 3); Button buttonThree(35, 5); Button buttonFour(36, 6); void setup() { Serial.begin(9600); buttonOne.pressHandler(onPress); buttonOne.releaseHandler(onRelease); buttonTwo.pressHandler(onPress); buttonTwo.releaseHandler(onRelease); buttonThree.pressHandler(onPress); buttonThree.releaseHandler(onRelease); buttonFour.pressHandler(onPress); buttonFour.releaseHandler(onRelease); } void loop() { buttonOne.process(); buttonTwo.process(); buttonThree.process(); buttonFour.process(); } void onPress(int buttonNumber) { Serial.print(buttonNumber); Serial.println(" pressed"); } void onRelease(int buttonNumber) { Serial.print(buttonNumber); Serial.println("…
Follow My Blog
Get new content delivered directly to your inbox.