Show Posts
Pages: 1 ... 52 53 [54] 55 56 ... 196
796  Using Arduino / Programming Questions / Re: newbie needs some coding help for leds please on: November 23, 2013, 06:40:34 pm
There are SD card modules and external EEPROM modules that you could maybe use to store the images. That might be good to look into.
797  Using Arduino / Programming Questions / Re: newbie needs some coding help for leds please on: November 23, 2013, 06:03:18 pm
It sounds like a fun little project! If you ever get it working, maybe you can patent it as a new toy.
798  Using Arduino / Programming Questions / Re: Using a 4 by4 Keypad to Get an Integer on: November 23, 2013, 01:27:55 pm
What I gave was meant to point the OP in the right direction, it was not meant to work without first filling the rest in. If you actually looked at my code, when would if(getKey() >= '0' && getKey()  <= '9') // it's a digit ever work on its own?

Yes it is a snippet, but sometimes that is all that is needed.
799  Using Arduino / Programming Questions / Re: Using a 4 by4 Keypad to Get an Integer on: November 23, 2013, 01:00:55 am
Simple code:

Code:
int Value = 0;
.
.
.
// Inside Loop or make into function
if(getKey() >= '0' && getKey()  <= '9') // it's a digit
{
   Value = Value * 10 + (getKey() - '0');
}

else if(getKey() == '>' )
{
 // step clockwise
 Value = 0; // Once the  stepper has stepped, reset Value back  to zero.
}

else if(getKey() == '<' )
{
 // step C-clockwise
 Value = 0;  // Once the  stepper has stepped, reset Value back  to zero.
}

else
 //print invalid entry
800  Using Arduino / Project Guidance / Re: push robot on: November 22, 2013, 10:45:54 am
20kg? You may need to get something like blender motors, or at least something with a lot of torque. As far as speed control, there does exist some motor controllers made for high current motors that can also interface with an Arduino. You need to look for a 10 - 20 Amp, Arduino compatible motor controller or similar.

Maybe this will work: HERE
801  Using Arduino / Project Guidance / Re: motor wireless transmittion on: November 21, 2013, 08:29:32 pm
Could you post a picture of it, circuit and all? It might not even be possible with an Arduino, but we won't know for sure until we see it.
802  Using Arduino / Project Guidance / Re: motor wireless transmittion on: November 21, 2013, 11:37:55 am
Do you have any schematics of da circuit?
803  Using Arduino / Project Guidance / Re: motor wireless transmittion on: November 21, 2013, 11:09:20 am
RF is good if you have little interference and a fair distance, but how far is it going to be away from the computer? You may need to use an Ethernet or Wifi connection.
804  Using Arduino / Programming Questions / Re: Keypad entry for a 24 hour time variable on: November 21, 2013, 05:40:16 am
Unless you plan on having a negative time, use unsigned int.
805  Using Arduino / Programming Questions / Re: Keypad entry for a 24 hour time variable on: November 20, 2013, 11:39:25 pm
Value = Value * 10 + (getKey() - '0');
The - '0' will convert the char value ( '4' char = 52 decimal, Ex: '4' - '0' = 4 decimal. Equivilant: 52 - 48 = 4 decimal) into a useable decimal value.
806  Using Arduino / Programming Questions / Re: int Value works one way, but not another... on: November 20, 2013, 10:35:08 pm
Your value range for your analogRead is 0 - 1023 and your dividing it by 777, then from that your multiply it by 128. It's an int, not a double, so if the value for analogRead is above or equal to 777, the quotient of analogRead and sensor_max will either be a 1 or 0. Afterwards you multiple it by 128, so your outcomes will always be 128 or 0.

Typecast analogRead to a double and make sensor_max a double too.
807  Using Arduino / Project Guidance / Re: Pair multiple Android devices to one HC-05 Bluetooth shield on: November 20, 2013, 09:49:49 pm
Most if not all bluetooth modules are one to one. So if you want to have multiple devices control a single arduino, then you will need to switch between them very fast. However this will mean briefly resetting the bluetooth module and pair it to the wanted device.
808  Using Arduino / Programming Questions / Re: New B in desperate need of guidence on: November 19, 2013, 10:55:30 pm
Format your code and look in your second FOR loop. Look at the else statement and you will see that your writing to the EEPROM when you shouldn't be. You should be writing in the if statement.
809  Using Arduino / Programming Questions / Re: New B in desperate need of guidence on: November 19, 2013, 10:22:13 pm
You need to rethink how you want to determine which led was last on.
Right now, you have a for loop that compares " i " to counter, and if i == counter, turn the led on, else turn the led off. That's fine. But you're also writing to the eeprom when you tell it to turn off the LED, but your not writing to the eeprom when the led is on

Fix that for loop around and it should work. To see what led was last on, use the same compare method, only this time instead of i == counter, have it as i == EEPROM(address).

Note: change int leds[] = {2,3,4}; to byte leds[] = {2,3,4};  An EEPROM address stores a single byte.
810  Using Arduino / Programming Questions / Re: newbie needs some coding help for leds please on: November 19, 2013, 09:02:54 pm
If you don't want the random numbers to be duplicates, then use this sketch I made.
Code:
long randNumber;
int Count = 20
int list[Count];
int i=0;
boolean found = false;

void setup(){
  for(int j =0; j<Count;j++)
    list[j] = 0; // set all the array blocks to 0

  Serial.begin(9600);
  randomSeed(1);
  delay(50);

  while(i < Count) // will cycle through until the array is filled
   {
    randNumber = random(1, Count); // lowest value is 1, and highest value is 20
    for(int L=0;L < i;L++) // will cycle through the list array and check the new number too
    {
      found = false;
      if(list[L] == randNumber) // if the random number IS found, then its a duplicate and discard it
      {
        found = true; // number has a duplicate, no good
        break;
      }
    }

    if( !found )// if the random number does NOT have a duplicate, add it to the list array
    {
        list[i] = randNumber;
        Serial.println(list[i]);
        i++;
    }
  }
}

void loop()
{
  //empty
}

Output with no duplicates:
Quote
12
8
9
18
10
14
4
19
17
11
13
1
7
6
3
2
16
15
5
Pages: 1 ... 52 53 [54] 55 56 ... 196