ATTiny 85 + shift register + ir sensor

Pickups, wiring schemes, switch techniques and onboard active electronics for guitars

ATTiny 85 + shift register + ir sensor

Postby yamadanao » 21 Jun 2017, 05:05

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 +

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
Posts: 1
Joined: 21 Jun 2017, 04:57
Has thanked: 0 time
Have thanks: 0 time

Re: ATTiny 85 + shift register + ir sensor

Postby deltafred » 21 Jun 2017, 08:50

WTF has this got to do with guitars, pedals or amps?
Politics is the art of so plucking the goose as to obtain the most feathers with the least squawking. - R.G. 2011
Jeez, she's an ugly bastard, she makes my socks hurt. I hope it's no ones missus here. - Ice-9 2012
User avatar
Opamp Operator
Posts: 1366
Joined: 06 Apr 2010, 17:16
Location: Yorkshire, England, UK
Has thanked: 286 times
Have thanks: 234 times

Re: ATTiny 85 + shift register + ir sensor

Postby edy_wheazel » 21 Jun 2017, 10:51

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 :))))
Posts: 18
Joined: 07 Dec 2013, 17:40
Has thanked: 7 times
Have thanks: 19 times

Return to Electric Guitar Rewiring

Who is online

Users browsing this forum: No registered users and 1 guest