Show Posts
Pages: 1 ... 47 48 [49] 50 51 ... 197
721  Using Arduino / Project Guidance / Re: Help with 4wd rc car on: December 11, 2013, 03:25:19 am
That's a bad idea, don't have both battery power and the USB plugged in, it could damage the arduino. You might have a bad motor driver.

Added:
I did some reading on the adafruit website, and it turns out regular 9V batteries are no good, they are ok for the Arduino, but not the motor shield. You can use your other power supply to power the motors, just be sure to take off the jumper on the motor shield.
722  Using Arduino / Project Guidance / Re: Help with 4wd rc car on: December 11, 2013, 02:50:33 am
Is that motor library up to date? Also set speed has a range from 0-255.
723  Using Arduino / Project Guidance / Re: Help with 4wd rc car on: December 11, 2013, 01:53:26 am
Are you running it from the Arduino power port or the EXT port? Also what does your code look like?
724  Using Arduino / Programming Questions / Re: Yet another question about strings to chars on: December 11, 2013, 01:18:34 am
Type cast (eeSETTINGS.charAt(i)) as an int.

Code:
String data = "ABCD";

void setup(){
  Serial.begin(9600);
  for(unsigned int i=0; i<4; i++)
  {
    Serial.print( data[i]);
    Serial.print("  ");
    Serial.println((int) data[i]);
  }
}

void loop() {
}

Output:
Quote

A  65
B  66
C  67
D  68
725  Using Arduino / General Electronics / Re: Double RC circuit on: December 11, 2013, 12:22:08 am
Not only that, but when a cap is uncharged and the circuit is closed, both caps act as shorts. So once C1 starts to charge, slowly C2 begins to charge too. Now here is where is gets interesting. Once C2 is charging, C1 slowly discharges, adding more resistance to the circuit, and starts to split off the current to C2.

C2 will still charge, but now that both caps are charging at the same time, they are  acting as current dividers. Eventually (less than a second) the caps will equalize, but they will never reach the source voltage.This is because as Jack C pointed out they leak and want to refill.

The more stages you add, the lower the voltage on the caps will be.
Ideally both caps will equal the source voltage, but nothing is ideal.
726  Using Arduino / Project Guidance / Re: Combining and sending joystick values using RF transmitter/reciever on: December 10, 2013, 06:17:17 pm
Look into the sprintf() function, it will help out a lot .
727  Using Arduino / Project Guidance / Re: how to create a system which reads button presses on: December 10, 2013, 05:03:31 pm
Ok, simple. You can use the random() and randomSeed() functions to get the LEDs to blink.

Here is a simple button counter code.
Code:
const byte LED = 6;
const byte Button = 2;
byte ButtonState;
byte last = LOW;
int count = 0;

void setup() {
  Serial.begin(9600);
  pinMode(LED, OUTPUT);
  pinMode(Button, INPUT);
}

void loop() {
  ButtonState = digitalRead(Button);
 
  if(ButtonState && ButtonState != last) {
    analogWrite(LED, count += 5);// every time the button is pressed, count increases by 5. This can be changed to inc by 1
    Serial.println(count);
  }
 
  if(count > 255){
    digitalWrite(LED, LOW);
    count = 0;
  }
 
  last = ButtonState;
}
728  Using Arduino / Project Guidance / Re: Help joining two pieces of code together (I think I need to know about 'case'?) on: December 09, 2013, 09:13:41 pm
Instead of cases, (which you should still learn ) make a simple button latch.

Here is a simple button latch you can use. How you implement it into your code, is for you to learn how to do.

Code:
byte buttonPin = 2;
byte LED = 13;

byte buttonState;
byte latch;
byte lastState;

void setup(){
  Serial.begin(9600);
  pinMode(buttonPin, INPUT);
  pinMode(LED, OUTPUT);
}

void loop() {
  buttonState = digitalRead(buttonPin); // read the state of the button

  if(buttonState && buttonState != lastState){ //See if the button state is HIGH, and does not equal the last state
    latch = !latch; // flip the state of the LED
    digitalWrite(LED, latch ? HIGH : LOW); // state of LED according to latch state
    Serial.println(latch); // visual of latch state
  }
  lastState = buttonState; // update last state
}
729  Using Arduino / Project Guidance / Re: Arduino UNO not receiving serial data(TX) from Bluetooth module on: December 09, 2013, 09:09:18 pm
Can you show me a video or post a picture of your setup? Bluetooth chat should have worked.
730  Using Arduino / Programming Questions / Re: Spliting serial strings, then convert to int on: December 09, 2013, 09:07:58 pm
Your welcome.
731  Using Arduino / Programming Questions / Re: Spliting serial strings, then convert to int on: December 09, 2013, 04:32:48 pm
If you can, see what the actual value is that's going to the LEDs.
732  Using Arduino / Programming Questions / Re: Spliting serial strings, then convert to int on: December 09, 2013, 04:10:02 pm
All good now? Could you make a video, I would love to see it.
733  Using Arduino / Programming Questions / Re: Spliting serial strings, then convert to int on: December 09, 2013, 03:39:37 pm
I think the issue here is the difference between Strings and strings. One is a string object the other is an array of chars. You might need to use another method than what I gave you.

Does it work with the Arduino serial monitor? Try it with just entering the string into the Arduino serial monitor and see if it works or not. What I gave you is meant for char arrays not Strings.

Post both codes if you can.
734  Using Arduino / Programming Questions / Re: Spliting serial strings, then convert to int on: December 09, 2013, 03:05:38 pm
Are you sending a string of chars or ints?
See what happens if you change c to int instead of char and take away " - '0' "
735  Using Arduino / Programming Questions / Re: Spliting serial strings, then convert to int on: December 09, 2013, 02:49:20 pm
See what the raw data is going to the arduino.
Pages: 1 ... 47 48 [49] 50 51 ... 197