Here is my updated code: int potValue=0; //variables assigned int pause=0; int someVar= 0; int numLED = 4; int ledPins[4] = {28,29,30,31}; int buttonPins[4] = {33,34,35,36}; void setup() { Serial.begin(9600); for(int i=0;i<4;i++){ pinMode(ledPins[i], OUTPUT); pinMode(buttonPins[i], INPUT); } } void loop(){ potValue = analogRead(A13); pause = potValue; numLED= map(analogRead(A21),0,1024, 1,4); if(digitalRead(buttonPins[0]) == HIGH) { for(int i=0;i<numLED;i++){Continue reading “Digital Electronics Lecture 4”
Category Archives: Uncategorized
Digital Electronics Lab 5
int ledPinArray[3] = {31, 30, 29}; //arrays and variables assigned int notePotVals[3] = {0, 0, 0}; int mappedNotePotVals[3] = {0, 0, 0}; int toggleSwitch[2] = {15, 14}; int pot[3] = {A13, A15, A16}; int totalPots = 3; int totalLeds = 3; int onoff = 38; int tempo = 0; int tempoPin = A20; void setup()Continue reading “Digital Electronics Lab 5”
Digital Electronics Lecture Assign 3
Digital Electronics Lecture 3 PART 1: This midi keyboard is different from the previous ones we have done. In this keyboard there is no delay when a button is pressed and when a sound is heard. This midi keyboard also has a variable sustain. I accomplished this using if statements that check for the exactContinue reading “Digital Electronics Lecture Assign 3”
Digital Lecture Lab 4
int redLED = 10; int yellowLED = 24; int blueLED = 26; int toggle = 39; int onoff = 23; int pot1 = 0; int pot2 = 0; int pot3 = 0; int tempoPot = 0; int mappedPot1 = 0; int mappedPot2 = 0; int mappedPot3 = 0; int mappedtempoPot = 0; void setup() {Continue reading “Digital Lecture Lab 4”
Digital Lecture Assignment 2
Digital Lecture Assignment 2 Part 1) Fix this broken circuit: Link to working Tinkercad circuit: https://www.tinkercad.com/things/kYpvV1CcXu9 Part 2) Explain this code in English: Function1() basically makes each LED blink. But when all switches are open, the LEDs will blink down the chain from left to right with 500milliseonds between each blink. Function2() basically makes itContinue reading “Digital Lecture Assignment 2”
Digital Electronics Lab 3
USB MIDI Lab: My Code: int redLED = 10; int yellowLED = 24; int blueLED = 26; int greenLED = 28; int buttonPin1 = 36; int buttonPin2 = 35; int buttonPin3 = 33; int buttonPin4 = 32; int toggle = 29; int potValue = 0; void setup() { pinMode(redLED, OUTPUT); pinMode(yellowLED, OUTPUT); pinMode(blueLED, OUTPUT); pinMode(greenLED,Continue reading “Digital Electronics Lab 3”
Digital Electronics Lab 2
Part 1) Part 2) Part 3) Part 4) Part 5) Part 6) int redLED = 10; int greenLED = 24; int yellow1LED = 11; int yellow2LED = 25; int buttonPin = 36; int buttonPin2 = 34; int potValue = 0; int toggle = 38; void setup() { pinMode(redLED, OUTPUT); pinMode(yellow1LED, OUTPUT); pinMode(greenLED, OUTPUT); pinMode(yellow2LED, OUTPUT);Continue reading “Digital Electronics Lab 2”
FALL 2020 DIGITAL LECTURE ASSIGNMENT 1
Fall 2020 Digital Lecture Assignment 1 My Tinkercad circuit: https://www.tinkercad.com/things/jqg6hZ0D9r7 My changes to the original circuit, are detailed below: Added a white LED. The white LED is only active when the button is pressed. Added 2 red LEDs that are active when the green and blue LEDs are. Changed the pin assigned to the buttonContinue reading “FALL 2020 DIGITAL LECTURE ASSIGNMENT 1”
Digital Electronics Lab 1
Digital Electronics Lab 1 Arduino/Teensy (I have ordered the parts but have not received them yet.) Research Find 5 Arduino projects online that are interesting to you and link to them, with a one paragraph description of what each one is. 1. https://www.instructables.com/id/Simple-Electronic-Piano/ This project is a relatively simple piano made with a battery, pushbuttons,Continue reading “Digital Electronics Lab 1”
Lab 13
Analogue Electronics Lab 13 1. Nick Royall made a 8-step, 4-channel audio and MIDI step sequencer and keyboard. This project looks absolutely sick, but a little complex. The “all-in-one” concept is cool but a little cluttered, I like work with individual insturments with their own functions when producing. I would love to have an attemptContinue reading “Lab 13”