Loading...
  Show Posts
Pages: 1 ... 30 31 [32] 33 34 ... 105
466  Using Arduino / Motors, Mechanics, and Power / Re: Servo Problem (Jiggle and Power) on: March 12, 2013, 07:14:18 am
Do you have the ground on the arduino connected to the ground on the battery?
467  Using Arduino / Project Guidance / Re: Stepper motor with High Torque on: March 12, 2013, 07:02:25 am
Code?
468  Using Arduino / Project Guidance / Re: Stepper help on: March 12, 2013, 07:01:51 am
Code?
469  Using Arduino / Programming Questions / Re: convert serial string to long on: March 11, 2013, 02:42:59 pm
Question, why are you doing it this way?
Code:
decodeGS232(Serial.read());
//Serial read normally returns an int, but you want a char

and not this way?

Code:
char Data = Serial.read();
// Some way to store multiple chars in one array.
// Use an array,store the chars if new data is available and have a terminating char to tell
// it to stop storing data and send it out to the function. 
decodeGS232(Data);

Instead of doing process from int to char the long way, let the IDE do it. Just make the variable from the serial read a CHAR type and then manually insert a NULL char to then use atol()

No?
470  Using Arduino / Project Guidance / Re: Switching Control Signal on: March 11, 2013, 01:32:41 pm
With just transistors, it will get a little confusing. However if you want a simple way to do it, go with a DPDT relay or two SPDT relays.
471  Using Arduino / Project Guidance / Re: An Arduino Beginner: How Feasible is this Project for my Skills? on: March 11, 2013, 11:30:39 am
Reply #5 and 11. I laid it all out already.
472  Using Arduino / Programming Questions / Re: Push Button - Servo Motor - Variable problem on: March 11, 2013, 11:26:10 am
There is an example provided to you in the IDE called "button state change" This will do exactly what your discribing.
473  Using Arduino / Programming Questions / Re: Send/Recive between 2 arduinos on: March 11, 2013, 08:39:43 am
Why not try to debug it with the serial monitor? You should see what you are getting, and adjust your code from there.
474  Using Arduino / Project Guidance / Re: Switching Control Signal on: March 10, 2013, 11:02:17 pm
Your circuit is so so, its not the correct way to do it, but it may work. I can tell you, you will need a pull down resistor. 4.7K should be enough.

Look up the proper way to use transistors.
475  Using Arduino / Project Guidance / Re: Ardunio with Android on: March 10, 2013, 12:36:53 pm
There are bluetooth shields for arduino. Also there Modules you can get at digikey or eBay.
476  Using Arduino / Project Guidance / Re: Ardunio with Android on: March 10, 2013, 10:59:00 am
Mega ADK, is made for a USB connection, but it is a lot more expensive. Why can't you use bluetooth?
477  Using Arduino / Project Guidance / Re: Ardunio with Android on: March 10, 2013, 01:26:08 am
Well your not sending it directly to the Arduino, but to the Bluetooth or wifi adapter. Any Arduino will work, especially the Mega with ADK. You need to first learn Java and start with a simple sketch that will work in the serial monitor. If it works there, it will work with an android.
478  Using Arduino / Programming Questions / Re: LCD and Keypad help on: March 10, 2013, 12:50:29 am
Here,
Code:
/*
 || @version 1.0
 || @author Andrew Mascolo
 ||
 || @description
 || Simple use of keypad, password and LCD
 */
#include <Keypad.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x20,20,4);
char Data[20]; // 20 is the number of chars it can hold
char Master[] = {
  '1','3','5','4','2','6'};
int currentCommand = 0;
boolean good;
char customKey;

const byte ROWS = 4;
const byte COLS = 3;
char keys[ROWS][COLS] = {
  {
    '1','2','3'  }
  ,
  {
    '4','5','6'  }
  ,
  {
    '7','8','9'  }
  ,
  {
    '*','0','#'  }
};
 byte rowPins[ROWS] = {
  2,3,4,5}; //connect to the row pinouts of the keypad
 byte colPins[COLS] = {
  10,9,8}; //connect to the column pinouts of the keypad

//initialize an instance of class NewKeypad
Keypad customKeypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS);

void setup(){
  lcd.init();                      // initialize the lcd
  lcd.backlight();
}

void loop(){
  lcd.setCursor(0,0);
  lcd.print("Enter Password");
  customKey = customKeypad.getKey();
  if (customKey){
    Data[currentCommand] = customKey;
    lcd.setCursor(currentCommand,1);
    lcd.print(Data[currentCommand]);
    currentCommand++;
  }

  if(currentCommand == 6){
    delay(1000);
    for(int count = 0; count < currentCommand; count++){
      if(Data[count] == Master[count]) {
        good = true;
      }
      else {
        good = false;
        break;
      }
    }

    lcd.setCursor(0,0);
    if(good) {
      lcd.clear();
      lcd.print("Password is good");
      delay(1000);
      lcd.clear();
      clearData();
    }
    else {
      lcd.clear();
      lcd.print("Password is bad");
      delay(1000);
      lcd.clear();
      clearData();
    }
  }
  if(customKey == '*'){
    lcd.clear();
    lcd.setCursor(0,0);
    lcd.print("Change Password");
    clearData();
    while(customKey != '#'){
      customKey = customKeypad.getKey();
      if (customKey){
        Master[currentCommand] = customKey;
        lcd.setCursor(currentCommand,1);
        lcd.print(Master[currentCommand]);
        currentCommand++;
      }
    }
    if(customKey == '#') {
      lcd.clear();
      lcd.setCursor(0,0);
      lcd.print("Master is reset");
      delay(1000);
      clearData();
      lcd.clear();
    }
  }
}
void clearData() {
  while(currentCommand !=0){   // This can be used for any array size,
    Data[currentCommand--] = 0; //clear for new data
  }
  return;
}
479  Using Arduino / Programming Questions / Re: LCD and Keypad help on: March 10, 2013, 12:06:59 am
It does not go in the loop, it goes outside the loop. And if you put it in there, it will not work. Just set current command back to when your done with it the first time. I'll post me updated code later, and just learn from that.
480  Using Arduino / Programming Questions / Re: LCD and Keypad help on: March 09, 2013, 11:21:28 pm
You can put it anywhere, it's just used to ensure the data array is cleared. To be honest, it's really not needed, unless your password is shortened.
Pages: 1 ... 30 31 [32] 33 34 ... 105