Show Posts
Pages: [1] 2 3 ... 84
1  Community / Exhibition / Gallery / Re: Scrolling LED matrix display - Parola for Arduino on: Today at 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.
2  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.
3  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.
4  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.
5  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
6  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.
7  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?
8  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.
9  Community / Exhibition / Gallery / Re: Scrolling LED matrix display - Parola for Arduino on: July 13, 2014, 10:16:56 pm
What is being reported as an error is something I thought was fixed some time ago, so can you check you have the latest version of FontBuilder and the library files?

Basically the problem is that in C++ is a line ends with '\' the compiler thinks that it continues on the next line.

Looks for a line that looks like this in the font .h file (in the libraries/MD_Parola folder)
Code:
5, 2, 4, 8, 16, 32, // 92 - \
and change it to this
Code:
5, 2, 4, 8, 16, 32, // 92 - '\'
By putting the character in single quotes it changes the special meaning of the character at the end of the line.
10  Using Arduino / Programming Questions / Re: Program can't open file on SD card on: July 13, 2014, 07:59:36 pm
I don't use the SD library because I use SDFat, however, the line
Code:
if (myFile!=false)
is different from the shorter example and could be the problem.

myFile can be evaluated as a logical expression - as in "(myfile)" - because the C++ compiler will treat any non-zero value as 'true'. So a NULL pointer (typically zero) will evaluate as false, although I would prefer to explicitly use "pointer == NULL". By comparing "myFile != false" the expression is only logically true if myFile is not equal to the value false (and I don't know what it is). Maybe changing this to the same logic as the simpler example could make a difference.
11  Using Arduino / Programming Questions / Re: LCD Keypad Shield Debounce on: July 11, 2014, 03:39:19 am
In my code libraries linked from the signature below, I have a small library to handle the analog buttons found in the LCD shield. You may be able to see how to do what you want from reading that code.

Basically you need to detect the transition from off to on rather than the on state itself.
12  Using Arduino / Programming Questions / Re: Compare array to set of numbers on: July 07, 2014, 04:54:10 pm
Where is the data array being set with the data from the device?

The only place I can see that data[] is initialised is when you print the data in the debug message. Before that it is undefined.
Code:
for ( i = 0; i < 32; i++)
{    
      data[i] = ds.read();        
      Serial.print(data[i]);      
      Serial.print(" ");          
}
13  Using Arduino / Storage / Re: SdFat behaviour has changed - anyone know what is going on? on: July 07, 2014, 02:20:13 am
That worked. Thanks.
14  Using Arduino / LEDs and Multiplexing / Re: Push Button Array on: July 06, 2014, 04:57:35 pm
This implementation using 3 digital control lines and a 4017 may be of interest: http://forum.arduino.cc/index.php?topic=235438
15  Using Arduino / Storage / SdFat behaviour has changed - anyone know what is going on? [SOLVED] on: July 06, 2014, 03:40:48 am
I had existing code using and older version of the SdFat library that worked fine and now it has stopped working after installing the newest version (20131225) . IDE version 1.0.5.

Essentially I am trying to create a file called PLAYLIST.TXT that contains the names of all the other files on the SD card. This is done using the openNext() function. PLAYLIST.TXT is created on the SD card but openNext() does not find any files.

I tried the openNext() example from the library and it worked ok, listing all the files. I modified the same example to just open the playlist file and then close it, and it also does not find the files (just prints out 'Done!' with no files listed) - listing below. Commenting out the playlist file handling in my code also results in the file names being listed.

Anyone seen this change of behaviour and is there workaround?

Code:
/*
 * Open all files in the root dir and print their filename and modify date/time
 */
#include <SdFat.h>

// SD chip select pin
const uint8_t chipSelect = SS;

// file system object
SdFat sd;

SdFile file;
SdFile myfile; // <<-- my mod

// define a serial output stream
ArduinoOutStream cout(Serial);
//------------------------------------------------------------------------------
void setup() {
  Serial.begin(9600);
  while (!Serial) {} // wait for Leonardo
  delay(1000);
  
  // initialize the SD card at SPI_HALF_SPEED to avoid bus errors with
  // breadboards.  use SPI_FULL_SPEED for better performance.
  if (!sd.begin(chipSelect, SPI_HALF_SPEED)) sd.initErrorHalt();

  myfile.open("PLAYLIST.TXT", O_CREAT|O_WRITE); // <<-- my mod
  
  // open next file in root.  The volume working directory, vwd, is root
  while (file.openNext(sd.vwd(), O_READ)) {
    file.printName(&Serial);
    cout << ' ';
    file.printModifyDateTime(&Serial);
    cout << endl;
    file.close();
  }
  cout << "\nDone!" << endl;
  
  myfile.close(); // <<-- my mod
}
//------------------------------------------------------------------------------
void loop() {}

Pages: [1] 2 3 ... 84