Show Posts
Pages: 1 2 [3] 4 5 ... 86
31  Community / Exhibition / Gallery / Re: Scrolling LED matrix display - Parola for Arduino on: July 27, 2014, 02:40:02 pm
The USE_HW is used to select the type of hardware module that you have got.

Irrespective of the hardware, the interface to the hardware is the same (SPI). SPI can be implemented in software or you can use the CPU supported hardware implementation. If you specify all the pins, then the library will assume that you are implementing the software version of SPI. If you only specify the CS pin then it defaults to the hardware implementation, where the pins are set by the type of hardware CPU you use.

All of this is in the MD_MAX72xx library documentation.

My setup is for an Arduino Uno and I use the Parola module.
32  Using Arduino / Sensors / Re: TCS3200 with Arduino Uno on: July 26, 2014, 09:38:54 pm
When you are using the sensor, are you shielding it from externally reflected light? If you are using the sensor as-is in the picture you linked to, you will get different results depending on the light level and other objects in the room.

If you see in my documentation, I built a black cardboard shielding around the LEDs and the sensor. Then when I want to sense, I lock out all the external light from the sensor by putting the shroud in contact with the material to be identified. this stops the external light from influencing the reading and I get the same every time.

I would also say that the colours on the screen will look different from colours in real life because they are produced differently.
33  Community / Exhibition / Gallery / Re: Scrolling LED matrix display - Parola for Arduino on: July 25, 2014, 04:59:21 pm
Look in the _lib header file. Each of the specifics is converted to a series of other transformations.
34  Community / Exhibition / Gallery / Re: Scrolling LED matrix display - Parola for Arduino on: July 25, 2014, 06:09:26 am
@confusered

It took a while but the answer is obvious (finally!). The pins you are selecting for the creation of the Parola object are the same pins that are defined for native-SPI hardware control. If you use the type of constructor you did, it defaults to non-native control (using these same pins). SDFat uses the same pins but with hardware controls. This overrides the non-native SPI and a mess results for the display.

Changing the constructor so that only the CS pin is defined works. This is the code that works on my system. I have left all the debug code in and you will see it has a slightly different structure. I believe that the implementation of String is buggy, so it is best to avoid it.

Code:
#include <MemoryFree.h>
#include <MD_Parola.h>
#include <MD_MAX72xx.h>

#define  USE_SDFAT  1

#define MAX_DEVICES 4
#define CLK_PIN 13
#define DATA_PIN 12
#define CS_PIN 10

// Generic output pins
MD_Parola P = MD_Parola(CS_PIN, MAX_DEVICES);

#define SPEED_TIME 25
#define PAUSE_TIME 2000

char newstring[10] = "1234";
char datastring[10]  = "abcd";

#if  USE_SDFAT
#include <SdFat.h>
SdFat sd;

const int chipSelect = 4;
long index = 0;
#endif

void setup(void)
{
#if  USE_SDFAT
  sd.begin(chipSelect, SPI_FULL_SPEED);
#endif

  P.begin();    //starts parola
//  P.displayScroll(datastring, LEFT, SCROLL_LEFT, SPEED_TIME);
  P.displayText(datastring, CENTER, SPEED_TIME, PAUSE_TIME, SCROLL_LEFT, SCROLL_LEFT);

  Serial.begin(57600);
  Serial.println(F("[SDwithParola]"));
  Serial.print(F("freeMemory()="));
  Serial.println(freeMemory());
}

void loop(void)
{
  if (P.displayAnimate()) // animates and returns true when an animation is completed
  {
    getword();
    strcpy(datastring, newstring);
    Serial.print(F("datastring = "));
    Serial.println(datastring);
    Serial.println();
    P.displayReset();
  }
}

void getword()
{
#if  USE_SDFAT
  SdFile myFile;
  long index;
  
  if (!myFile.open("WORDS.TXT", O_READ))  //Open the file for reading
  {
    strcpy(newstring, "Error");
  }
  else
  {
    index = random(100) * 4;   // offset of a random number from 0 to the word count
    Serial.println(index);
    myFile.seekSet(index);      // go to position
    myFile.read(newstring, 4);  // read the word
    newstring[4] = '\0';
  }

  Serial.print(F("newstring  = "));
  Serial.println(newstring);  // Print the string to serial
  myFile.close();
#endif
}
35  Community / Exhibition / Gallery / Re: Scrolling LED matrix display - Parola for Arduino on: July 25, 2014, 02:48:45 am
Quote
i was working on writing some kind of control if the hours are 9 or less to only show 1 digit for the Hours, while i'm trying  i found out that if i only change this line,  sprintf(psz, "%02d%c%02d", RTC.h, (f ? ':' : ' '), RTC.m); to sprintf(psz, "%01d%c%02d", RTC.h, (f ? ':' : ' '), RTC.m); the display will work exactly like i want, single digit hour when 9 or less and two digits when 10 - 12 . simple but works !!!.

A personal preference comes into play for me. This will work well if the date is just scrolled across the screen, but if you are putting the date in a particular field, it will be a different width and will step jump across when the hours change from one digit to two. This is not the behaviour users expect from a clock, as they are used to seeing the digits remain in the same place.

Quote
The second thing i wanted to ask about  is the DS_1307 serial time adjusting  program , it keeps giving wrong times  and some times not responding , is it written so only the time can be adjusted in 24h mode and then i cans witch to 12h mode.
because  if its in 12H mode  it will not accept the time_date string and gives back (bad (t)) or it will run along line of rubbish characters.

Yes. It is just meant to be a utility to get around the issue of setting time accurately. I can live with this.
36  Community / Exhibition / Gallery / Re: Scrolling LED matrix display - Parola for Arduino on: July 25, 2014, 02:42:55 am
Hola nikomaz!

The orientation of the matrix can be adjusted in the software, but you need to do it in the MD_MAX72xx library. What to do is described in the documentation for the library. You will need to set some compile time switches to make it work - afsaisi has already told you a bit but exactly what you need to do will depend on how your matrix is wired up.
37  Community / Exhibition / Gallery / Re: Scrolling LED matrix display - Parola for Arduino on: July 23, 2014, 10:23:38 pm
Try changing the CS pin to a free pin that is not 10 in the Parola initialiser.
38  Community / Exhibition / Gallery / Re: Scrolling LED matrix display - Parola for Arduino on: July 23, 2014, 07:10:10 am
Do you have enough RAM to run both of these? On an Uno there is about 2k or RAM for stack and heap storage. The SD card buffer will already take up about 512 bytes. There is a function that you can add to your programs to display the amount of free RAM (search for it, I forget the name at this stage). Do each program separately and add it up. The actual total will be a little less than the sum of the two because of common elements that will only be counted once when combined, but you should get an impression if this is a problem.

If this is not the case, then you will need to be specific about what 'dies' when sd.begin() is called.
39  Community / Exhibition / Gallery / Re: Scrolling LED matrix display - Parola for Arduino on: July 18, 2014, 05:23:42 am
You want to keep the time string the same length so that the time does not jump around in the field. I would define a blank character the same width as zero then use that instead if the leading zero.
40  Using Arduino / Audio / Re: Midi-Out does not work well on: July 18, 2014, 04:31:06 am
You are correct. That code plays one note only.
41  Community / Exhibition / Gallery / Re: Scrolling LED matrix display - Parola for Arduino on: July 16, 2014, 01:24:39 pm
The DS1307 library has an example program where which uses the serial monitor to interact with the RTC. One of the functions is to set the current time and date.
42  Community / Exhibition / Gallery / Re: Scrolling LED matrix display - Parola for Arduino on: July 15, 2014, 02:55:43 am
I understand the complexity of the Arabic script and how the letters look different depending on where they are in a word. That is why, with no training and no feel for the language I did not want to even consider any automatic parsing of sentences for adjustment. I hope you can do a good job smiley
43  Community / Exhibition / Gallery / Re: Scrolling LED matrix display - Parola for Arduino on: July 14, 2014, 07:30:47 pm
Good that you got it working.

I downloaded the library from the Codeplex site and the '// that you saw is not in the download, so I have no explanation.

The inter character spacing can be adjusted by the method setChararacterSpacing(). It is fully under calling program control and is documented in the library html docs. 5x7 is not a limit and there are many characters defined that are bigger than this. The font builder can handle much bigger matrices.
44  Community / Exhibition / Gallery / Re: Scrolling LED matrix display - Parola for Arduino on: July 14, 2014, 02:58:23 am
I have tried to compile with the setup I have an cannot get the same result as you do.

The error is what it says it is - a stray \ somewhere.

Try the following:
1. Can you compile and run the MD_MAX72xx example MD_Test? If you can the problem is not in the MD_MAX library.
2. What examples in the Parola library can you compile and run?
45  Using Arduino / Programming Questions / Re: LCD Keypad Shield Debounce on: July 14, 2014, 02:01:29 am
I have just found out the same thing about the 'A0'. It should not be like that so I will keep looking at it.

You need to implement a finite state machine. Basically the code will look something like this:
Code:
void updateDisplay()
{
  static uint 8_t state = 0;
  char c = lcd.getKey();

  switch (state)
  {
  case 0:
    if (c==SELECT)  state = 1;
      break;

  case 1:
    // display fan 1 reading
    state = 2;
    break;

  case 2:
    if (c == DOWN)   state = 3:
    break;

   case 3:
   // display fan 2 reading
   state = 4;
   break;

  case 4:
    if (c==UP)  state = 1;
    else if (c == DOWN)  state = 5:
    break;

   case 5:
   // display fan 3 reading
   state = 6;
   break;

  case 6:
    if (c==UP)   state = 3;
    else if (c == DOWN)   state = 7:
    break;

   case 7:
   // display fan 3 reading
   state = 8;
   break;

  case 8:
    if (c==UP)  state = 5;
    break;

  default:
    state = 1;
    break;
  }
}

loop()
{
   // do stuff
  updateDisplay();
  // do more stuff
}

This can be done more elegantly, but the layout will help you get an idea of what is happening. This initially looks like it is doing nothing, but you need to track what the code is doing every time through loop() to understand how it works. A lot of other Arduino programs work this way, especially when you eliminate the delay() functions that cause problems in beginner code.
Pages: 1 2 [3] 4 5 ... 86