Page 1 of 1

ATTiny 85 + shift register + ir sensor

Posted: 21 Jun 2017, 04:05
by yamadanao
I had the ATtiny working with the shift register, but when I added the IR receiver to the code the shift register did not work as desired.

I have a shift register connected to 8 LEDs and controlled by an ATtiny85. I also have a button and an IR receiver connected. The idea is to control the LEDs with my remote control using the minimal space required for an ATtiny.

Thedate sheet of attiny85

The date sheet of 74hc595


It is definitely in the code, because it was working with the code for only the shift register and all that changed in the hardware was the addition of a button and IR sensor. The shift register only turns on all the lights and eventually turns them all off. what I want to happen is patterns to be displayed on the LEDs.

Here is my code:

Hardware connections:

74HC595 pin LED pin Arduino pin

1 (QB) LED 2 +
2 (QC) LED 3 +
3 (QD) LED 4 +
4 (QE) LED 5 +
5 (QF) LED 6 +
6 (QG) LED 7 +
7 (QH) LED 8 +
8 (GND) GND

9 (QH*)
10 (SRCLR*) 5 V
11 (SRCLK) Digital 3
12 (RCLK) Digital 4
13 (OE*) GND
14 (SER) Digital 2
15 (QA) LED 1 +
16 (VCC) 5 V

*/

// Pin definitions:
// The 74HC595 uses a type of serial connection called SPI
// (Serial Peripheral Interface) that requires three pins:

int datapin = 2;
int clockpin = 3;
int latchpin = 4;
int switchpin = 1;

// We'll also declare a global variable for the data we're
// sending to the shift register:

/* Raw IR commander

Re: ATTiny 85 + shift register + ir sensor

Posted: 21 Jun 2017, 07:50
by deltafred
WTF has this got to do with guitars, pedals or amps?

Re: ATTiny 85 + shift register + ir sensor

Posted: 21 Jun 2017, 09:51
by edy_wheazel
Lots of stuff on 74HC595 + Arduino on the web, but I hate that circuit (74HC595). Try using PCF8574 or similar, it's I2C. You can find the library online.
deltafred wrote:WTF has this got to do with guitars, pedals or amps?
Pretty lights on a kick ass pedal :))))