Show Posts
Pages: 1 ... 1885 1886 [1887] 1888 1889 ... 3265
28291  Using Arduino / Programming Questions / Re: LCD Display Programming - memory of numbers on: March 21, 2012, 01:20:26 pm
Quote
To print some spaces after the number is it as simple as changing the following?
No.

Code:
lcd.print(analogValue*0.01566);
lcd.print("  ");
28292  Using Arduino / Programming Questions / Re: testing the contents of a char array on: March 21, 2012, 01:13:12 pm
Quote
But Im getting no ware with it.
Is this right, or is there a better way please.
If it were the right way, it would work, wouldn't it. So, clearly it is not.

Look at the strcmp() function, if MsgField is NULL terminated. If it isn't, make it NULL terminated.
28293  Using Arduino / Programming Questions / Re: I need help with a little code entry pad. on: March 21, 2012, 01:08:35 pm
Quote
Basically when a button is hit i want the arduino to register it, save it in attempt[]
Then, you need to add a bit more code:
  for(x=0; x<9; x++)
  {
    if(oldstate[ x ] != state[ x ])
    {
     if(state[ x ] == HIGH) // Was the switch just pressed?
      {

         attempt[ 0 ] = buttons[ x ]; //Set attempt (Just first index for now) to buttons pressed
         time = millis();
     }
    }
  }
28294  Using Arduino / Programming Questions / Re: IR signals to MIDI output via USB on: March 21, 2012, 01:05:09 pm
Quote
so then, i stopped the converter and opened up the arduino program to look at the serial monitor... thats when i found out that its just putting out a bunch of E's...
So, you know that the Arduino is outputting data to the serial port.

Quote
I tried using the serial to midi converter by itself, and it was detecting messages through the serial connection, but it wasn't turning them into MIDI signals... (or the messages are not in the right format to be turned to MIDI?)
I'm not sure what the difference is. You are not getting MIDI out of the program, so either the program is not working (unlikely if it worked before) or you are nut supplying it good input. I have no idea which it is, or what good input looks like.

28295  Using Arduino / Programming Questions / Re: I need help with a little code entry pad. on: March 21, 2012, 12:54:00 pm
Quote
if the oldstate array isnt made until the end of the loop, how am i meant to compare the the state with oldstate before its even made
The array is "made" when you declare it as a global variable. Is it populated with a bunch of default values, appropriate to the type of the array. Arrays of type int, byte, long, etc. are initialized to 0 (which corresponds to LOW).

You may need a little more work in loop(). Right now, you are setting the value in attempt[0] to the pin number that changed state. This sounds good, until you consider that releasing the switch also generates a state change. So, pressing a switch will affect attempt[0] and releasing the switch will affect attempt[0]. Is this what you want? Or, do you just want to know when switch i has been pressed?
28296  Using Arduino / Programming Questions / Re: IR signals to MIDI output via USB on: March 21, 2012, 12:39:51 pm
Quote
and then I'm using a serial to midi converter to turn them into MIDI signals my computer can read
Which means that it needs access to the serial port that the Arduino is connected to. But, it can't get that access because you have the Serial Monitor application using that serial port.
28297  Using Arduino / Programming Questions / Re: Problem with serial.write() implementation using interrupt on: March 21, 2012, 12:37:14 pm
What version of the IDE are you using? In 1.0, serial output is already interrupt based.
28298  Using Arduino / Programming Questions / Re: LCD Display Programming - memory of numbers on: March 21, 2012, 12:34:32 pm
Quote
How can i get around this problem? i think  i am right in saying that it is caused by the digits being shifted to the left and not erasing the previous information that left there.
You are correct. There are a couple of ways to solve the problem. One involves having sprintf() format the string to printed, so that you always get the same number of characters in the string. The other is to simply print a couple of spaces after the number.
28299  Using Arduino / Programming Questions / Re: I need help with a little code entry pad. on: March 21, 2012, 11:39:17 am
Quote
OK, i started again, but i have a feeling i've already made a mistake
No. So far, so good. The 1 element arrays need work, but I assume you have plans that dictate a larger array in the near future.
28300  Using Arduino / Networking, Protocols, and Devices / Re: GPS(EM406a) Confusion(serial problem i think) on: March 21, 2012, 10:56:31 am
Quote
Hmm I tried to switch to port 2/3
Is your GPS taking to pins 2 and 3?

Because you aren't reading from those pins.

Your stupid infinite loop inside loop is preventing loop() from doing anything.
28301  Using Arduino / Networking, Protocols, and Devices / Re: how to interface Arduino with Bluetooth module (HC-06). on: March 21, 2012, 10:02:18 am
Quote
Can I directly interface/connect the RX & TX pins of my arduino with the TX & RX pins of the BT module?
That's how it is normally done, if the module is TTL level.
28302  Using Arduino / Programming Questions / Re: Problems input capture timer1 on: March 21, 2012, 09:56:58 am
Quote
Or is this even a bad idea to be using for debugging?
Yes, it is a bad idea. Flash an LED or something quick to confirm that the ISR is being called.
28303  Using Arduino / Programming Questions / Re: Need a Librarian on: March 21, 2012, 09:55:14 am
You put a user downloaded library in the Arduino core library folder. That is not where it goes.
28304  Using Arduino / Project Guidance / Re: using arduino for atmega8535 on: March 21, 2012, 09:06:40 am
Quote
The reason im asking this is because all the arduino boards have specific pin mapping so how am i supposed to use arduino for atmega8535
What makes you think that you even can? There is a reason particular chips are used and supported. Off that path, you are pretty much on your own.
28305  Topics / Robotics / Re: Non blocking steppor motor control on: March 21, 2012, 09:02:03 am
Quote
the stepper controlers that i have
are?

Quote
it seems to work by having two control pins
Is it the stepper motor, your controller, or the library?

Quote
would it be possible to use something similar to the servo library to send out the neccesary pulses and keep the rest of the code "unblocked"?
No, because the pulses sent to a servo and the pulses sent a stepper controller are for entirely different purposes.

You can minimize the time that the library blocks by not trying to step more than one step at a time. Of course, this means that YOU have to determine when to send the next step instruction for each of the 6 motors.
Pages: 1 ... 1885 1886 [1887] 1888 1889 ... 3265