Posts

Showing posts from November, 2017

Controlling 8 BIT SMD LED Array by Potentiometer 100k

Image
In this intractable, we want to control 8 bit smd led array by Potentiometer. Step 1: Materials Required 1.      Arduino (We use UNO) 2.      8 Bit Smd Led Array 3.      Potentiometer 100k 4.      Jumper wires Male - Female Software Required 1.      Arduino IDE (We use NSight Eclipse)   Circuit Diagram Step 2: Uploading Arduino Program Code: #include #include int main (void) { unsigned char result; // OUTPUT DDRD = DDRD | 0b11111111; // Make all port d pins as output // ADC SETUP CODE /* 1. */ DDRC = DDRC | 0b00111111; // Make all of PORT C as INPUT /* 2. */ ADMUX = ADMUX | 0b01100000; // SELECT 5V and LEFT ADJUST /* 3. */ ADCSRA |= (1 << ADEN); // Turn on the ADC module /* 4. */ _delay_ms(10); /* 5. */ ADCSRA = ADCSRA | 0b00000100; // Select divide by 16 while (1) { // ADC USAGE /* 1. */ AD...

Controlling 8 BIT SMD LED Array with ARDUINO

Image
This is our very first intractable, we want to control 8 bit smd led array with arduino. Step 1: Materials Required 1.      Arduino (We use UNO) 2.      8 Bit Smd Led Array 3.      Jumper wires Male - Female Software Required 1.      Arduino IDE (We use NSight Eclipse) Circuit Diagram     Step 2: Uploading Arduino Program Code: #include<avr/io.h> int main (void) { unsigned char input1, input2; DDRB = DDRB | 0b00001111; // Make pins B3 to B0 as output DDRB = DDRB & 0b11001111; // Make pins B5 and B4 as input while (1) { // Take care of the inputs input1 = PINB & 0b00010000; // Read pin B4 as input1 input2 = PINB & 0b00100000; // Read pin B5 as input2 // Implement the 2:4 decoder as output if (input2 != 0 && input1 != 0) { // Turn on LED1 only PORTB = PORTB & 0b111...