Go Down

Topic: Serial.begin messes up my 74HC595 Shifter (Read 164 times) previous topic - next topic

kampsu

I am doing a school project that involves lots of Outputs. I need to use one 7segment display so i decided to use shift register.  Register works fine until the point i type Serial.begin under my setup(){}.
The whole 7 segment goes crazy and random lights starts when booting program. Sometimes all segments are on.

As soon as i remove the Serial.begin line everything works. What to do? Shifter uses same serials that i try to use or what what is happening? I am using Arduino Uno. Thank you.
My main is like this:

Code: [Select]
#include "Display.h"

void setup()
{
pinMode(0, OUTPUT); // ClockPin
pinMode(1, OUTPUT); // LatchPin
pinMode(2, OUTPUT); // DataPin
}

void loop()
{
Ykkonen();
}


And my Display.h follows

Code: [Select]

#include "Arduino.h"

void Ykkonen()
{
  int ClockPin = 0;
  int LatchPin = 1;
  int DataPin = 2;
 
  digitalWrite(LatchPin, LOW);
  shiftOut(DataPin, ClockPin, LSBFIRST, B10001001);
  digitalWrite(LatchPin, HIGH);
}

CrossRoads

  int ClockPin = 0;
  int LatchPin = 1;

These are the Serial lines.  Use other pins.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Go Up