Show Posts
Pages: [1] 2 3
1  Using Arduino / LEDs and Multiplexing / Re: Shifting 200 Leds on: March 27, 2014, 06:55:44 pm
Ok...Rewritten code like this:
(code tags added by moderator)
Code:
#include <SPI.h>

int SER_Pin = 8;   //pin 14 on the 75HC595
int RCLK_Pin = 9;  //pin 12 on the 75HC595
int ssPin = 10; //pin 11 on the 75HC595

//How many of the shift registers - change this
#define number_of_74hc595s 1

//do not touch
#define numOfRegisterPins number_of_74hc595s * 8

boolean registers[numOfRegisterPins];

void setup() {
  pinMode(SER_Pin, OUTPUT);
  pinMode(RCLK_Pin, OUTPUT);
  pinMode(ssPin, OUTPUT);
  SPI.begin();


  //reset all register pins
  clearRegisters();
  writeRegisters();
}


//set all register pins to LOW
void clearRegisters() {
  for (int i = numOfRegisterPins - 1; i >=  0; i--) {
    registers[i] = LOW;
  }
}


//Set and display registers
//Only call AFTER all values are set how you would like (slow otherwise)
void writeRegisters() {

  digitalWrite(RCLK_Pin, LOW);

  for (int i = numOfRegisterPins - 1; i >=  0; i--) {
    digitalWrite(ssPin, LOW);

    int val = registers[i];

    digitalWrite(SER_Pin, val);
    digitalWrite(ssPin, HIGH);

  }
  digitalWrite(RCLK_Pin, HIGH);

}

//set an individual pin HIGH or LOW
void setRegisterPin(int index, int value) {
  registers[index] = value;
}


void loop() {
  digitalWrite (ssPin, LOW); // use D10
  for (int x = 0; x < 24; x = x + 1) {
    SPI.transfer(dataArray[x]);
  }
  digitalWrite (ssPin, HIGH);


}

but have a brain ache How should i define the dataArray?
2  Using Arduino / LEDs and Multiplexing / Re: Shifting 200 Leds on: March 27, 2014, 06:55:19 am
In the schematic provided by crossroads the Leds in the top right corner are reversed from how I have mine wired up. Ie the shift register provides power not ground.
3  Using Arduino / LEDs and Multiplexing / Re: Shifting 200 Leds on: March 26, 2014, 10:20:17 pm
I see where you have in the schematic controlling the ground side. I currently have it reversed. If that changes anything. I am a novice,  so where in my code should I place your code?

Thanks guys!
4  Using Arduino / LEDs and Multiplexing / Re: Shifting 200 Leds on: March 26, 2014, 08:47:17 pm
I am using this as a template as it "CLAIMS" that this will run 40+ ShiftRegisters

http://bildr.org/2011/02/74hc595/
5  Using Arduino / LEDs and Multiplexing / Shifting 200 Leds on: March 26, 2014, 07:17:58 pm
I have daisy chained 25 74hc5 95 each has its own 5 volt Power Supply. I would like some help with the shift out commands. I have been having some undesired results. Ie the last 3 or 4 registers stay latched and lit...so that's happening.


Thanks
6  Using Arduino / LEDs and Multiplexing / Re: Driving 750 or so leds, independently (of Course....why should this be easy?) on: December 22, 2013, 08:06:55 pm
sorry posted before I finished reading ....

Thanks for everyone's help!
7  Using Arduino / LEDs and Multiplexing / Re: Driving 750 or so leds, independently (of Course....why should this be easy?) on: December 22, 2013, 07:24:45 pm
Using a 74HC595 shifter in conjunction w/ the i2c should do the trick then right guys?
8  Using Arduino / LEDs and Multiplexing / Re: Driving 750 or so leds, independently (of Course....why should this be easy?) on: December 22, 2013, 01:44:12 pm
Ar-Ds                                (Arduinos) - thought i was being clever....apparently not... smiley-wink
just 1 (8x16) i2c               (1 i2c channel is capable of 8x16 (128 pins))
an i2c w/ software?       (someone earlier mentioned being able to run i2c on more than just pins 4&5 with "software", how is this possible?)
9  Using Arduino / LEDs and Multiplexing / Re: Driving 750 or so leds, independently (of Course....why should this be easy?) on: December 22, 2013, 08:52:02 am
Ok.

The First bank of LEDS is 200 (10w x 20h row) these must be individual 5mm LEDs.

The next bank is a few rows of numerics (7/16 segment LEDs)

The LED panel (matrices) won't work. I thought the Ar-Ds were capable of much more than just 1 (8x16) i2c.

Anyone have a link to an i2c w/ software?

Thanks!
10  Using Arduino / LEDs and Multiplexing / Driving 750 or so leds, independently (of Course....why should this be easy?) on: December 21, 2013, 10:19:49 pm
I am looking to drive approx. 750 leds & monitor some buttons.

I was thinking the MCP23017 would do me right on an uno or mega. But If my Calculations are correct I can only drive 8 x 16 leds (128) per i2c channel. and the Arduino's only have One set of CLK/DAT pins.

I was told (or so I thought) I can run much more than that. Am I missing something or am I right in being limited to only 128 additional i/o pins?

What other options are out there besides charlieplexing?


THANKS!
11  Using Arduino / Displays / Re: LCD Display issue on: January 25, 2013, 03:22:13 pm
sorry,,,the error says TFT was not declared in this scope.

But isn't it included in the header?
12  Using Arduino / Displays / LCD Display issue on: January 24, 2013, 06:57:11 pm
I try this code and keep getting an error,,, and am only a hobbyist. suggestions are appreciated.

I am using a MEGA and a SEEEDUINO 2.8 TFT Shield.
 

the error is in: Tft.init();  //init TFT library

//
#include <stdint.h>
#include <TFT.h>

void setup()
{

Tft.init();  //init TFT library

/*  Demo of
    void drawCircle(int poX, int poY, int r,unsigned int color) and
    void fillCircle(int poX, int poY, int r,unsigned int color);
*/
Tft.drawCircle(100, 100, 30,YELLOW);
Tft.drawCircle(100, 200, 40,CYAN);
Tft.fillCircle(200, 100, 30,RED);
Tft.fillCircle(200, 200, 30,BLUE);
}

void loop()
{
 
}


Thanks
13  Using Arduino / LEDs and Multiplexing / Re: 74HC164N Binary Help on: July 09, 2012, 09:32:53 pm
Ok...there are 10 people in this world. Ones that understand Binary and those that dont....

I get the joke but not shifting binary to a shift register.


I am sending a string:
B00000000;
B10000000;
B11000000;

thinking this would translate to turning each led on sequentially...I was wrong...

I could use just a bit more direction.

Thanks!!

++EDIT++

Realized i was using LSB not MSB....changed the way it worked thanks!
14  Using Arduino / LEDs and Multiplexing / 74HC164N Binary Help on: July 08, 2012, 06:43:02 pm
I am trying to use 3 74HC164N's to control 22 leds.

I am new to the Arduino Sandbox, so please bare with me.


How do I daisy chain the 3 shift registers? (I figured I should connect the data in to Q7 on the previous register)
but where does clock go?

also since I have expanded this to 3 shift Registers what does the bit string look like? If its 8-bit for one...is it 16 bit for 2? 24 bit for 3?

ie one register = B00110101
   two register = B00110100011010111?

(probably not...)

Im really LOST...
15  Using Arduino / Programming Questions / Re: Odd behavior shiftOut and Servo control on: June 19, 2012, 06:42:54 pm
dont know what i did...but it works now.....no changes in code....maybe a loose wire...but thanks for your help.


Thanks as always
Pages: [1] 2 3