Loading...
  Show Posts
Pages: 1 ... 53 54 [55] 56 57 ... 106
811  Using Arduino / Project Guidance / Re: Capacitive Sensor No Output on: February 04, 2013, 12:25:13 pm
Ok, great, you got START. Now do a serial print of just "key" and see what values you get for each number pressed.
812  Using Arduino / Programming Questions / Re: Need help with reading keyboard into an array on: February 04, 2013, 09:48:54 am
Great! What did you change? Could you post your working code, with comments so others can see too?
813  Using Arduino / Programming Questions / Re: Need help with reading keyboard into an array on: February 04, 2013, 09:11:07 am
What library are you using from here? http://playground.arduino.cc//Main/PS2Keyboard
814  Using Arduino / Project Guidance / Re: Cheap way to connect an Arduino to a Android Smartphone via bluetooth on: February 04, 2013, 08:29:20 am
A simple code you can try is already provided to you in the Android examples, BlueToothChat. That is the same program I used to get started with, until I was able to break it down to what I needed, to make my own test app.

Get that code, pair the BT module and use a simple arduino code to toggle an LED on and off with "H" and "L".
815  Using Arduino / Programming Questions / Re: Need help with reading keyboard into an array on: February 04, 2013, 08:09:30 am
So when you press a key, your able to see its value on the lcd? Ok, so then store it in an array, and keep storing the chars until enter is pressed.

Code:
void loop() {

if (keyboard.available () > 0) {
    KB_chars = keyboard.read(); // new variable "KB_chars", instead of "c".  Better name.
    if ( KB_chars != PS2_ENTER){ //If the key(s) pressed is not PS2_ENTER, then store chars in array
       line[count++] = KB_chars;
       Serial.print(line[count]); // show chars being entered.
       }
    else {  // If PS2_ENTER is pressed, print them.
       line[count++] = '\0'; // once enter is pressed, count +1 then add zero-terminate 
       Serial.print(line); // Not sure if it will work like this, might need to convert it to a string first. I'll double check. print array
       //delay(20);
       count = 0; // reset counter
       }
   }
}
 
816  Using Arduino / Programming Questions / Re: Need help with reading keyboard into an array on: February 04, 2013, 12:31:17 am
Ok then, lets start from what you are able to get. BTW, your lcd address should not be just 0, it should be something like 0x20 or 0x??, otherwise it won't show anything.

Bed now, see you in 8 hours.
817  Using Arduino / Programming Questions / Re: Need help with reading keyboard into an array on: February 03, 2013, 10:30:26 pm
Ok then think of it like this. You want to enter an array of chars and send it when you press enter, so if the incoming chars are NOT "!=" EQUAL to "enter", store it, else print / write it.
818  Using Arduino / Programming Questions / Re: Need help with reading keyboard into an array on: February 03, 2013, 09:14:42 pm
Usually it's  'PS2_ENTER', with the single quotes ' '. We're you given an example with that ps2 library?
819  Using Arduino / Programming Questions / Re: Program stops after button press on: February 03, 2013, 08:46:23 pm
Don't do "== todelay", just do "> todelay"
820  Using Arduino / Programming Questions / Re: Having trouble tying multiple functions together on: February 03, 2013, 08:03:26 pm
What about reading it from serial and then store it in a temporary variable. Now with that variable you can check if any new incoming chars are different or not. If it is different, do another function, if not, do same function.

Use a while loop to compare the variables.
821  Using Arduino / Displays / Re: I2C LCD Display Problem (Only 16xSquares) on: February 03, 2013, 07:19:54 pm
Try it anyways, it goes it setup(). Is the lcd 16x2? Try changing the address to 0x20 or 0x27.
822  Using Arduino / Displays / Re: I2C LCD Display Problem (Only 16xSquares) on: February 03, 2013, 07:02:02 pm
Do you know if your library have a function call "lcd.init();"?
823  Using Arduino / Programming Questions / Re: Need help with reading keyboard into an array on: February 03, 2013, 03:51:52 pm
Your missing an opening bracket at your first IF statement.
824  Using Arduino / Project Guidance / Re: Capacitive Sensor No Output on: February 03, 2013, 01:20:08 pm
Your baud rate in the serial monitor says 300 baud, that is wrong! It should be 19200, not 300.
825  Using Arduino / Project Guidance / Re: Capacitive Sensor No Output on: February 03, 2013, 11:22:00 am
Did you by any chance set the baud rate in the actual serial monitor screen? In the bottom right corner, the default is 9600.
Pages: 1 ... 53 54 [55] 56 57 ... 106