Show Posts
Pages: 1 ... 30 31 [32] 33 34 ... 231
466  Using Arduino / Programming Questions / Re: Batt meter on: May 04, 2014, 11:39:49 pm
You could try and replace the map function with this and see if the values are any better.
Code:
double D_map(double data, double in_min, double in_max, double out_min, double out_max)//Map double
{
  return (data - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}
467  Using Arduino / Programming Questions / Re: Self Moving Cart With Bluetooth on: May 04, 2014, 09:56:41 pm
Quote
would you happen to have an idea of how to reset the bluetooth?
Sorry, I dont know how and the spec sheet doesn't say either.
468  Using Arduino / Programming Questions / Re: Self Moving Cart With Bluetooth on: May 04, 2014, 09:36:49 pm
The range does not appear to be able to change.
469  Using Arduino / Programming Questions / Re: Self Moving Cart With Bluetooth on: May 04, 2014, 09:18:16 pm
I don't think that's possible, to lower the range. But then again I don't know what BT shield you have.
470  Using Arduino / Programming Questions / Re: Self Moving Cart With Bluetooth on: May 04, 2014, 08:50:47 pm
You can debug your code using the serial monitor and see what values you are getting for distance and distance1. I highly recommend you change your code to use the NewPing library, it is far more accurate and it makes getting data from multiple sensor very easy.
471  Using Arduino / Programming Questions / Re: Self Moving Cart With Bluetooth on: May 04, 2014, 07:45:10 pm
"I'm stuck somewhere" doesn't really help us. Where are you stuck, and with what? I see your using the old method of reading a distance. Look into using the NewPing library, it will help you a lot and it will be easier for us to read your code. You also don't need that 500 millisecond delay in your loop, but if you do then also look into the Blink without delay example sketch.
472  Development / Other Software Development / VirtualWire ID on: May 04, 2014, 04:28:12 pm
This is a new simple library I made to allow someone to individually control multiple devices on the same frequency.

Constructor:
  VWID( char );
 
Data handlers:
  (void) transmit( char * );
  (boolean) receive(uint8_t * );

If anyone has multiple RF modules of the same frequency, let me know what you think of the library.

Is it helpful enough to add it to the playground?
473  Using Arduino / Programming Questions / Re: Nested If and arrays on: May 04, 2014, 12:26:21 am
I'm not really surprised it's not working. Lets break down your snippet.
Quote
// Say Contador is set to zero (0) and readString == "ON1" and SetRoutine == 0.
if (readString == "ON1")
{
       if (SetRoutine ==0)
       {
         Contador++; // Contador (0) + 1 = 1.
         digitalWrite(LED1, HIGH);
         Memoria[Contador] = 10; Memoria[ 1 ] = 10;
       }

Now say readString == "ON1" again and SetRoutine == 1
       if (SetRoutine == 1)
       {
         Contador++; (1) + 1 = 2
         digitalWrite(LED1, HIGH);
         Comparador[Contador] = 10; // Comparador[ 2 ] = 10;  
         if(Memoria[1] == Comparador[1]) // Memoria[ 1 ] = 10 and  Comparador[ 1 ] = NULL
         {
           a = 5;
         }
       }
}

These two will never be equal unless you reset Contador back to zero or have your code like this "if(Memoria[1] == Comparador[2])" instead.
474  Using Arduino / Programming Questions / Re: XOR and XNOR operations with 2 or 3 inputs on: May 02, 2014, 06:55:10 pm
Why not make them into macros?

Code:
#define XOR(a, b) boolean(a != b ? 1 : 0)
#define XNOR(a, b) boolean(a != b ? 0 : 1)

void setup(){
Serial.begin(115200);
delay(1);
Serial.println("XOR");
Serial.println(XOR(0,0));
Serial.println(XOR(0,1));
Serial.println(XOR(1,0));
Serial.println(XOR(1,1));
Serial.println("XNOR");
Serial.println(XNOR(0,0));
Serial.println(XNOR(0,1));
Serial.println(XNOR(1,0));
Serial.println(XNOR(1,1));
}

void loop() {
 
}

For multiple inputs, you can do this XNOR(x, XNOR(y, z));
475  Using Arduino / Project Guidance / Re: Light up stairs as you walk, need sensor advice on: May 02, 2014, 05:40:06 pm
Yea, those will work perfectly.
476  Using Arduino / Project Guidance / Re: Light up stairs as you walk, need sensor advice on: May 01, 2014, 07:58:58 pm
Cheap, and non-surface altering, ok, then laser beam with a photoresistor it is.

If the beam is broken, turn on the LED.
You actually don't need an arduino for this, all you need is a simple toy laser, a photoresistor, a transistor to turn on the LED, and a power source.
477  Using Arduino / Project Guidance / Re: Light up stairs as you walk, need sensor advice on: May 01, 2014, 07:24:46 pm
15 inputs, yes it can. The Uno has the 14 digital pins (12 if you want to use the serial monitor) and the 6 analog pins, that can also be digital in/outputs.

The best way to save pins would be to use shift register for the led strips and a multiplexer for the sensors.
As far as sensors, go you can have pressure, IR or ultrasonic sensors.

What is your spending budget? Different types of sensors cost more than others and you need 15.
478  Using Arduino / Project Guidance / Re: Connecting a 4*4 keypad on: May 01, 2014, 07:06:15 pm
To be honest, it really has to do with the OP knowledge and if he is able to understand how to convert his keypad to use an analog pin. If he is unable to do so, then its better to use the standard digital method, or the method you pointed out with the 74hc922 chip.

It is quite a hassle to convert a standard keypad to a analog keypad, if you don't know what you're doing.

But now he has options to go about and solve his problem.

479  Using Arduino / Project Guidance / Re: Connecting a 4*4 keypad on: May 01, 2014, 01:11:25 pm
True, but I mean others use set resistor values, mine allows the user to choose their own, just as long as the user tells the code what values are being used. The library does all the calculations and adjusts itself accordingly.

I used 4.7K and 1K resistor values, but that's only because I had a lot of them to spare.
480  Using Arduino / Project Guidance / Re: Connecting a 4*4 keypad on: May 01, 2014, 01:07:06 pm
Yea, but it works, look at the diagram.
Pages: 1 ... 30 31 [32] 33 34 ... 231