Show Posts
Pages: 1 ... 37 38 [39] 40 41 ... 84
571  Using Arduino / Displays / Re: IIC/I2C/TWI 2004 20X4 Character LCD Module Display on: April 21, 2013, 07:32:08 pm
Can you compile any other software (eg, the blink sketch)? This establishes a baseline for whether your installation actually works.

Can you also try and just include LiquidCrystal.h (even if it does not ultimately work wih the hardware) to see if that will compile?

Are you including all the required libraries?

Which Arduino and what operating system on the computer?

Posting the actual error message would be helpful.
572  Using Arduino / Displays / Re: lcd graphic design on: April 21, 2013, 05:11:09 pm
Is this the sort of thing you are looking for? http://mikeyancey.com/hamcalc/lcd_characters.php
573  Using Arduino / Project Guidance / Re: Magnetic rotary encoder Code on: April 21, 2013, 05:02:22 pm
People will be more willing to help if you post the code you have written rather than expecting others to write it for you.

In case you don't know where to start:
1. You will need to sire up the sensor and verify that it works manually (ie, see the transition from 0-1) by either turning on a LED or writing to the serial display.
2. Once you have done this, then test it with the disk and see that you can detect when the disk rotates. Each time the transition from 0 to 1 (or 1 to 0) happens, then add count to some counter.
3. Once the counter reaches your required value, do whatevere you need (in this case turn on a LED).

All these smaller 'projects' are easy if you look for examples in this forum or on the web.
574  Using Arduino / Programming Questions / Re: 8x8 LED Matrix Pattern on: April 21, 2013, 03:00:51 am
Can you be more specific about what you mean?

Do you mean software to display the patterns or software to create the bitmaps to display on the screen?
575  Using Arduino / Audio / Re: Using arduino to trigger sound (Need Help, Am Noob) on: April 20, 2013, 04:02:36 pm
You will need to break this down into 2 parts:
1. Detect stuff with IR sensors. You need to get the sensors, witre them up and test to see that it all works.
2. Play sound. What type of sound will dictate the technology you need. Simple beeps can be done directly from the Arduino; playing MP3 will need specialised hardware.

The two are independent - the only connection is that when you detect you will play the sound.

If you want to plat the sound through big speakers you will probably also need an amplifier as the output levels from chips is not enough to drive something that big.

Hope this is a start. I think you should think about what you want to do first, then design the system around that.

576  Using Arduino / Programming Questions / Re: Serial.print() giving odd behaviour on: April 20, 2013, 03:23:25 pm
Nothing is acting 'weird'. If you share the same serial connection you will see messages from everything that uses that connection. As I have already said several times, you cannot mix MIDI and serial debug on the same serial line and expect it the output to be 'clean'.

If you are just using this for debugging, then live with it and move on. Once you remove the debug statements all that will be left if the midi. If you mean to use this for information, then you need to find a different solution for the messages (LCD 4 line display, for example) that is separate.
577  Using Arduino / Programming Questions / Re: Serial.print() giving odd behaviour on: April 20, 2013, 05:01:44 am
Think about what you have just written. The same com port has the midi and debug messages coming to it. What do you think the serial console is going to display?

Easy check. - don't send the midi message and see if your "print" problem disappears.
578  Using Arduino / Programming Questions / Re: Serial.print() giving odd behaviour on: April 20, 2013, 02:08:55 am
Maybe so, but the Arduino IDE must be getting the data to dsplay from somewhere any you only have one serial port open ..

Thge MIDi library is writing it's stuff to the serial port, same as Serial.print. What COM port is the Python script reading from and is this the same as the IDE?

It is far, far, far more likely that you have some error in the COM port config than there being a problem in the Serial.print library.
579  Using Arduino / Programming Questions / Re: Serial.print() giving odd behaviour on: April 20, 2013, 01:11:52 am
Is the MIDI and the Serial prnting one the same serial port?
580  Using Arduino / Programming Questions / Re: Problems with loading and reading an array on: April 18, 2013, 11:10:58 pm
Quote
which means some bits are going to slop all over the floor

As I understand it the compiler will take care of the conversion when you are assigning the data like this. It is a cause of many 'errors' reported by novices in the forum.

I agree that a cast would make it more explicit and clearer for the reader.
581  Using Arduino / Programming Questions / Re: Problems with loading and reading an array on: April 18, 2013, 10:06:54 pm
Quote
The array is technically only being created and seeded one time at this point

Technically yes, but once every 150 milliseconds because of your delay statement.

Loop runs continuously (at the end it starts again). Every time through the array is remade on the stack. If you happen to be pressing the button at the time it will put random numbers in the array, which then disappears and is remade again (with what is on the stack at the time). It may be that you have some of the data from before, but you may not.

When you press the second switch you print what is in the array, which could be rubbish. One easy way to check is to print the random numbers as they are put into the array.

Another is to put the array as a global variable so it remains in scope between calls to loop().
582  Using Arduino / LEDs and Multiplexing / Re: Where do I start with MAX7219 dot matrix eBay kits? on: April 18, 2013, 03:03:03 pm
I also have a library that I wrote to allow me to use similar devices as 'pixels' rather than buffers.

A version is in my library archive (link in the signature block below). Currently working on a much more advanced version but not ready for the public yet.
583  Using Arduino / Programming Questions / Re: Problems with loading and reading an array on: April 18, 2013, 02:56:15 pm
Shame about the array index. smiley

Try leaving the randomseed() out altogether (or put it once in setup()) and/or try making rdmNum array global (ie, not in loop). Does that make a difference?
584  Using Arduino / Programming Questions / Re: Problems with loading and reading an array on: April 17, 2013, 11:23:26 pm
That bit is easy, I thought you already fixed that.
Code:
rdmNum = random(1, 4);
should be
Code:
rdmNum[i] = random(1, 4);

In the first instance I think you are setting the address of the array to a random number. You need the array subscript.

Same goes for other places (eg, in your println);
585  Using Arduino / Programming Questions / Re: Problems with loading and reading an array on: April 17, 2013, 10:47:53 pm
Fair enough, but I would think that you immediately save time, effort and debugging by doing this:

Code:
CheckButton(uint8_t i)
{
  if (btnState[i] != btnLastState[i])
  {
    // I only want the state change and I don't want this to continue to loop while the button is still pressed
    if (btnState[i] == 1)
    {
       for (int i = 0; i < Level; i++)
      {    // Testing to just see what was loaded in the array.
         Serial.println(rdmNum);
       }
       Serial.println();
       Serial.println(sizeof(rdmNum));      // more testing about Array
    }
  }
  btnLastState[i] = btnState[i];      // Save the state so I can detect the change next time around
}

and then not repeat the same lines of code all over the place with different variable names.
Pages: 1 ... 37 38 [39] 40 41 ... 84