Pages: [1]   Go Down
Author Topic: Serial.begin messes up my 74HC595 Shifter  (Read 147 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
#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:
#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);
}
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 545
Posts: 27353
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

  int ClockPin = 0;
  int LatchPin = 1;

These are the Serial lines.  Use other pins.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Pages: [1]   Go Up
Jump to: