Show Posts
Pages: 1 [2] 3 4
16  Using Arduino / Networking, Protocols, and Devices / Re: SPI Led module Question on: January 25, 2013, 02:42:04 pm
Hello PaulS,


Sorry for indistinct , but this is my question :

Quote
You can have one displaying something and 7 displaying nothing

Regards ,

ArduinoPat
17  Using Arduino / Networking, Protocols, and Devices / Re: SPI Led module Question on: January 25, 2013, 02:20:13 pm
Hi PaulS,

Now my next question,
How to bring these 7 segment LED ( 7 pc ) out of service and one still working ??

All these 74hc595 are coupled like a BUS ??? ( am i right ?? )

Maybe you can help to put me at the right direction,

I have tryed to find this at the sketch but there are no such kind of parameters regarding this ?

Code:
//Pin connected to latch pin (ST_CP) of 74HC595
const int latchPin = 8;
//Pin connected to clock pin (SH_CP) of 74HC595
const int clockPin = 3;
////Pin connected to Data in (DS) of 74HC595
const int dataPin = 9;
byte Tab[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,0xff};
void setup() {
  //set pins to output because they are addressed in the main loop
  pinMode(latchPin, OUTPUT);
  pinMode(dataPin, OUTPUT); 
  pinMode(clockPin, OUTPUT);
  Serial.begin(9600);
  Serial.println("reset");
}
void loop() {
  if (Serial.available() > 0) {
    // ASCII '0' through '9' characters are
    // represented by the values 48 through 57.
    // so if the user types a number from 0 through 9 in ASCII,
    // you can subtract 48 to get the actual value:
  int bitToSet = Serial.read() - 48;
  // write to the shift register with the correct bit set high:
  digitalWrite(latchPin, LOW);
  // shift the bits out:
  shiftOut(dataPin, clockPin, MSBFIRST, Tab[bitToSet]);
    // turn on the output so the LEDs can light up:
  digitalWrite(latchPin, HIGH);
  }
}


I hope you can support me about this,

Regards,

ArduinoPat
18  Using Arduino / Networking, Protocols, and Devices / Re: SPI Led module Question on: January 25, 2013, 01:46:32 pm
Hello PaulS,

Now all displays ( 8 x 7segment leds display ) shows the count up or down.
But i mean , is this also possible to bring 7 segments "out of service "  and only one 7segment led display will show the count UP or down.



I hope you understand my question ,

Many thanks,

Regards

ArduinoPat
19  Using Arduino / Networking, Protocols, and Devices / SPI Led module Question on: January 25, 2013, 10:18:41 am
Hi All,

I have bought a SPI Led Module , find attached the link:
http://www.dfrobot.com/wiki/index.php?title=SPI_LED_Module_(SKU:DFR0090)

I test the sketch and it works , but is it possible to run one LED unit ??
Now all LED segments units are showing the same numbers ( Loop)

All is working with the 74HC595 ( 8x / led segment unit ) 

I hope it's possible to do this ?

Regards ,

ArduinoPat
20  International / Nederlands / Re: Toepassen Max 7219 , Matrix 8x8 Led on: January 20, 2013, 01:33:51 pm
Ik heb de een sketch al uitgevoerd zonder libraries , dit functioneert goed,

MAAR , Ben er achter gekomen dat de release 0022 wel werkt met de Max 7219
wel vreemd dat deze het eerst niet deed, heb hem twee keer geinstalleerd , en nu is het voor elkaar  smiley-roll

Hier zat het dus het probleem in dat deze op mijn versie niet werkt ( Versie 1.0 ) ??

Met Vriendelijke Groet,

ArduinoPat,

21  International / Nederlands / Re: Toepassen Max 7219 , Matrix 8x8 Led on: January 20, 2013, 09:01:45 am
Goedenmiddag Stealh0113,

Ik heb deze ook zo geplaatst in een Library Map,
Ook het example net zoals jou bijgevoegde file,

Zelf denk ik dat de Sprite.h en de Matrix.h niet juist zijn ?

Ik hoop dat iemand nog een andere invulling hierop geeft,

Alvast bedankt ,

ArduinoPat
22  International / Nederlands / Toepassen Max 7219 , Matrix 8x8 Led on: January 20, 2013, 08:23:19 am
Goedenmiddag ,

Ben aan het experimenteren met de MAtrix 8x8 en een Max7219,
Het programma welke ik wil toepassen is vanuit het Cookbook Page 280 , 7.13

**sketch niet hierin gezet met max overschrijding characters **

Maar loop nu vast op de Library, In het boek staat wel een verwijzing naar deze maar heb deze opgeslagen in de Library MAP.

Maar krijg de ene na de andere foutmelding.


Post aangepast :

Heb even de release 0022 geinstalleerd , maar het werkt helaas nog steeds niet:



De Library Matrix.ccp ziet er als volgt uit:

Code:
/*
  Matrix.cpp - Max7219 LED Matrix library for Arduino & Wiring
  Copyright (c) 2006 Nicholas Zambetti.  All right reserved.

  This library is free software; you can redistribute it and/or
  modify it under the terms of the GNU Lesser General Public
  License as published by the Free Software Foundation; either
  version 2.1 of the License, or (at your option) any later version.

  This library is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  Lesser General Public License for more details.

  You should have received a copy of the GNU Lesser General Public
  License along with this library; if not, write to the Free Software
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
*/

// TODO: Support segment displays in api?
// TODO: Support varying vendor layouts?

/******************************************************************************
 * Includes
 ******************************************************************************/

extern "C" {
  // AVR LibC Includes
  #include <inttypes.h>
  #include <stdlib.h>

  // Wiring Core Includes
  #undef abs
  #include "WConstants.h"

  // Wiring Core Prototypes
  //void pinMode(uint8_t, uint8_t);
  //void digitalWrite(int, uint8_t);
}

#include "Sprite.h"
#include "Matrix.h"

/******************************************************************************
 * Definitions
 ******************************************************************************/

// Matrix registers
#define REG_NOOP   0x00
#define REG_DIGIT0 0x01
#define REG_DIGIT1 0x02
#define REG_DIGIT2 0x03
#define REG_DIGIT3 0x04
#define REG_DIGIT4 0x05
#define REG_DIGIT5 0x06
#define REG_DIGIT6 0x07
#define REG_DIGIT7 0x08
#define REG_DECODEMODE  0x09
#define REG_INTENSITY   0x0A
#define REG_SCANLIMIT   0x0B
#define REG_SHUTDOWN    0x0C
#define REG_DISPLAYTEST 0x0F

/******************************************************************************
 * Constructors
 ******************************************************************************/

Matrix::Matrix(uint8_t data, uint8_t clock, uint8_t load, uint8_t screens /* = 1 */)
{
  // record pins for sw spi
  _pinData = data;
  _pinClock = clock;
  _pinLoad = load;

  // set ddr for sw spi pins
  pinMode(_pinClock, OUTPUT);
  pinMode(_pinData, OUTPUT);
  pinMode(_pinLoad, OUTPUT);

  // allocate screenbuffers
  _screens = screens;
  _buffer = (uint8_t*)calloc(_screens, 64);
  _maximumX = (_screens * 8);

  // initialize registers
  clear();             // clear display
  setScanLimit(0x07);  // use all rows/digits
  setBrightness(0x0F); // maximum brightness
  setRegister(REG_SHUTDOWN, 0x01);    // normal operation
  setRegister(REG_DECODEMODE, 0x00);  // pixels not integers
  setRegister(REG_DISPLAYTEST, 0x00); // not in test mode
}

/******************************************************************************
 * MAX7219 SPI
 ******************************************************************************/

// sends a single byte by sw spi (no latching)
void Matrix::putByte(uint8_t data)
{
  uint8_t i = 8;
  uint8_t mask;
  while(i > 0) {
    mask = 0x01 << (i - 1);         // get bitmask
    digitalWrite(_pinClock, LOW);   // tick
    if (data & mask){               // choose bit
      digitalWrite(_pinData, HIGH); // set 1
    }else{
      digitalWrite(_pinData, LOW);  // set 0
    }
    digitalWrite(_pinClock, HIGH);  // tock
    --i;                            // move to lesser bit
  }
}

// sets register to a byte value for all screens
void Matrix::setRegister(uint8_t reg, uint8_t data)
{
  digitalWrite(_pinLoad, LOW); // begin
  for(uint8_t i = 0; i < _screens; ++i){
    putByte(reg);  // specify register
    putByte(data); // send data
  }
  digitalWrite(_pinLoad, HIGH);  // latch in data
  digitalWrite(_pinLoad, LOW); // end
}

// syncs row of display with buffer
void Matrix::syncRow(uint8_t row)
{
  if (!_buffer) return;
  
  // uint8_t's can't be negative, so don't test for negative row
  if (row >= 8) return;
  digitalWrite(_pinLoad, LOW); // begin
  for(uint8_t i = 0; i < _screens; ++i){
    putByte(8 - row);                // specify register
    putByte(_buffer[row + (8 * i)]); // send data
  }
  digitalWrite(_pinLoad, HIGH);  // latch in data
  digitalWrite(_pinLoad, LOW); // end
}

/******************************************************************************
 * MAX7219 Configuration
 ******************************************************************************/

// sets how many digits are displayed
void Matrix::setScanLimit(uint8_t value)
{
  setRegister(REG_SCANLIMIT, value & 0x07);
}

// sets brightness of the display
void Matrix::setBrightness(uint8_t value)
{
  setRegister(REG_INTENSITY, value & 0x0F);
}

/******************************************************************************
 * Helper Functions
 ******************************************************************************/

void Matrix::buffer(uint8_t x, uint8_t y, uint8_t value)
{
  if (!_buffer) return;
  
  // uint8_t's can't be negative, so don't test for negative x and y.
  if (x >= _maximumX || y >= 8) return;

  uint8_t offset = x; // record x
  x %= 8;             // make x relative to a single matrix
  offset -= x;        // calculate buffer offset

  // wrap shift relative x for nexus module layout
  if (x == 0){
    x = 8;
  }
  --x;

  // record value in buffer
  if(value){
    _buffer[y + offset] |= 0x01 << x;
  }else{
    _buffer[y + offset] &= ~(0x01 << x);
  }
}

/******************************************************************************
 * User API
 ******************************************************************************/

// buffers and writes to screen
void Matrix::write(uint8_t x, uint8_t y, uint8_t value)
{
  buffer(x, y, value);
  
  // update affected row
  syncRow(y);
}

void Matrix::write(uint8_t x, uint8_t y, Sprite sprite)
{
  for (uint8_t i = 0; i < sprite.height(); i++){
    for (uint8_t j = 0; j < sprite.width(); j++)
      buffer(x + j, y + i, sprite.read(j, i));
      
    syncRow(y + i);
  }
}

// clears screens and buffers
void Matrix::clear(void)
{
  if (!_buffer) return;

  // clear buffer
  for(uint8_t i = 0; i < 8; ++i){
    for(uint8_t j = 0; j < _screens; ++j){
      _buffer[i + (8 * j)] = 0x00;
    }
  }

  // clear registers
  for(uint8_t i = 0; i < 8; ++i){
    syncRow(i);
  }
}


De Library Matrix.h ziet er als volgt uit:

Code:
/*
  Matrix.h - Max7219 LED Matrix library for Arduino & Wiring
  Copyright (c) 2006 Nicholas Zambetti.  All right reserved.

  This library is free software; you can redistribute it and/or
  modify it under the terms of the GNU Lesser General Public
  License as published by the Free Software Foundation; either
  version 2.1 of the License, or (at your option) any later version.

  This library is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  Lesser General Public License for more details.

  You should have received a copy of the GNU Lesser General Public
  License along with this library; if not, write to the Free Software
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
*/

#ifndef Matrix_h
#define Matrix_h

#include <inttypes.h>

class Sprite;

class Matrix
{
  private:
    uint8_t _pinData;
    uint8_t _pinClock;
    uint8_t _pinLoad;

    uint8_t* _buffer;
    uint8_t _screens;
    uint8_t _maximumX;

    void putByte(uint8_t);
    void setRegister(uint8_t, uint8_t);
    void syncRow(uint8_t);

    void setScanLimit(uint8_t);

    void buffer(uint8_t, uint8_t, uint8_t);
  public:
    Matrix(uint8_t, uint8_t, uint8_t, uint8_t = 1);
    void setBrightness(uint8_t);
    void write(uint8_t, uint8_t, uint8_t);
    void write(uint8_t, uint8_t, Sprite);
    void clear(void);
};

#endif


Ondanks een sketch en Library vanaf de doorverwezen link , vanuit het cookbook komen er nog steeds foutmeldingen ??

Weet iemand mischien wat er hier mis gaat ??

Alvast bedankt voor het lezen,

ArduinoPat
23  International / Nederlands / ++ OPGELOST ++ Scroll text met PCF8574A I2C on: December 16, 2012, 12:52:40 pm
Hoi Rob,

Helemaal super , dit blijkt te werken !!!   smiley-grin

Many thanks ,

Sorry voor late reply ,

Fijne dagen toegewenst en een prettige jaarwisseling voor 2013

Groet,

Patrick, ArduinoPat, Maarssen
24  International / Nederlands / Re: Scroll text met PCF8574A I2C on: December 01, 2012, 04:19:04 pm
Goedenavond Rob,

Helaas gaat dit ook niet lukken  smiley-mad
Nu laat die de vaste tekst staan op rij 1 , en zie ik in rij 2 nu in het eerste blok steeds 1 letter weergeven ( van mijn scrolltext )


Ik denk wat ik wil niet gaat lukken ,

Code:
#include <Wire.h>
#include <LiquidCrystal_I2C.h>

const int numRows = 2;
const int numCols = 16;

const char textString[] = "                  * ArduinoPat *        ";
const int textLen = sizeof(textString) -1; // the number of characters

LiquidCrystal_I2C lcd(0x27, 16, 2);

void setup()
{
  lcd.init();
  lcd.backlight();
  lcd.setCursor(0, 0);
  lcd.print("Vaste Tekst");
}

void loop()
{
    for (int position = 0; position  < textLen; position++)
    {
      lcd.setCursor(0,1);  // of moet dit zijn 1,0?
      lcd.print(textString[position]);
      delay(150);
    }
    for (int position = textLen; position  >0; position--)
    {
      lcd.setCursor(0,1);
      lcd.print(textString[position]);
      delay(150);
    }
}


Maar voor als nog hartelijk dank voor jou input !!
25  International / Nederlands / Re: Scroll text met PCF8574A I2C on: December 01, 2012, 03:28:47 pm
Beste JO3RI,

Dit gaat helaas niet op , beide teksten scrollen ook met deze code ??
Ik heb al van alles geprobeerd, maar ben er nog niet uit  smiley-mad

Code:
/*
  Scroll
  * this sketch scrolls text left when tilted
  * text scrolls right when not tilted.
 */

#include <Wire.h>
#include <LiquidCrystal_I2C.h>

// initialize the library with the numbers of the interface pins

const int numRows = 2;
const int numCols = 16;



const char textString[] = "                  * ArduinoPat *      ";
const int textLen = sizeof(textString) -1; // the number of characters

LiquidCrystal_I2C lcd(0x27,16,2);

void setup()
{
   lcd.init();
   lcd.backlight();
  // set up the LCD's number of columns and rows:
  lcd.setCursor(0, 1);
  lcd.print(textString);
 
  lcd.setCursor(0, 0);
  lcd.print("Vaste Tekst");
}

void loop()
{
  {
    // here if tilted left so scroll text left
   
    for (int position = 0; position  < textLen; position++)
    {
     
      lcd.scrollDisplayLeft();
      delay(150);
    }
  }
 
  {
    // here if previously tilted but now flat, so scroll text right
   
    for (int position = 0; position  < textLen; position++)
    {
     
      lcd.scrollDisplayRight();
      delay(150);
    }
  }
}
     
   

Misschien iemnand nog een optie ??
26  International / Nederlands / ++OPGELOST ++ Scroll text met PCF8574A I2C on: November 17, 2012, 04:03:49 pm
Hallo Allen,

Ik probeer hem eens op het NL-Forum,

Ik ben bezig met een I2c schakeling , wat nu werkt,
De LCD gekoppeld aan een PCF8574A ,
Nu heb ik in ROW 1 een scrollende text , dit werkt goed.
Maar wil een vaste text in ROW 2  , dit werkt dus niet , deze scrollt namelijk ook mee wat dus niet de bedoeling is.

Dit is mijn setup:




En dit is mijn Sketch:


Code:
/*
  Scroll
  * this sketch scrolls text left when tilted
  * text scrolls right when not tilted.
 */

#include <Wire.h>
#include <LiquidCrystal_I2C.h>

// initialize the library with the numbers of the interface pins

const int numRows = 2;
const int numCols = 16;



const char textString[] = "                  * ArduinoPat *      ";
const int textLen = sizeof(textString) -1; // the number of characters

LiquidCrystal_I2C lcd(0x38,16,2);

void setup()
{
   lcd.init();
   lcd.backlight();
  // set up the LCD's number of columns and rows:
  
  lcd.print(textString);
}

void loop()
{
  {
    // here if tilted left so scroll text left
  
    for (int position = 0; position  < textLen; position++)
    {
      lcd.scrollDisplayLeft();
      delay(150);
    }
  }
 
  {
    // here if previously tilted but now flat, so scroll text right
    
    for (int position = 0; position  < textLen; position++)
    {
      lcd.scrollDisplayRight();
      delay(150);
    }
  }
}
      
    


Ik hoop dat iemand mij hiermee op weg kan helpen,

Alvast bedankt,

ArduinoPat
27  Using Arduino / Programming Questions / Re: Scroll Text LCD Row 1 , no scroll text at Row 2 on: November 17, 2012, 12:57:40 pm
Dear PaulS

Thanks for reply,

I want a text show at row 2 but without scroll effect,

Row 1 is scrolling text now , and that is what worked well now,

Maby you can show me an option to bring this at my sketch

Thanks,

ArduinoPat
28  Using Arduino / Programming Questions / Scroll Text LCD Row 1 , no scroll text at Row 2 on: November 17, 2012, 12:41:54 pm
Dear All,

Here my setup ; Arduino Uno , LCD  connected with the PCF8574A ( I2C )  



I have experiment with the follow sketch:
Code:
/*
  Scroll
  * this sketch scrolls text left when tilted
  * text scrolls right when not tilted.
 */

#include <Wire.h>
#include <LiquidCrystal_I2C.h>

const int numRows = 2;
const int numCols = 16;

const char textString[] = "                  * ArduinoPat *      ";
const int textLen = sizeof(textString) -1;
boolean isTilted = false;
LiquidCrystal_I2C lcd(0x38,16,2);

void setup()
{
   lcd.init();
   lcd.backlight();
   lcd.begin(numCols, numRows);
   lcd.print(textString);
}

void loop()
{
  {
   for (int position = 0; position  < textLen; position++)
    {
      lcd.scrollDisplayLeft();
      delay(150);
    }
  }
  {
    for (int position = 0; position  < textLen; position++)
    {
      lcd.scrollDisplayRight();
      delay(150);
    }
  }
}
      
    


In Row one the text scrolls ( that's what i want )
But i will also put text at Row two, but whatever i try , this text will scroll either.

Maby some of you can give me a correct answer , the text will stay at Row two.

Many thanks for reading this topic


Regards ,

ArduinoPat
29  Using Arduino / General Electronics / Re: PC8574 Driving LED , LOW LED Brighting on: November 11, 2012, 12:33:18 pm
Still less bright LEDS , in combination with the PCF8574  smiley-sad



I will investigate this and find out , till then i will send this at this Forum   smiley

Best Regards ,

ArduinoPat,
30  Using Arduino / General Electronics / Re: PC8574 Driving LED , LOW LED Brighting on: November 11, 2012, 11:08:09 am
I have tryed without the PC8574 , An=d make only a Bargraph with the Arduino,
Now the LEDS are real bright !


Pages: 1 [2] 3 4