Loading...
  Show Posts
Pages: 1 ... 14 15 [16] 17 18 ... 106
226  Using Arduino / Programming Questions / Re: Virtual Wire Problem on: April 17, 2013, 01:18:27 pm
That does not look like your sketch folder. It needs to be in the sketch folder under libraries. If there is no libraries folder, make one.
227  Using Arduino / Programming Questions / Re: Virtual Wire Problem on: April 17, 2013, 01:12:43 pm
Where did you put/install the virtualwire library?
228  Using Arduino / Project Guidance / Re: Need a help with Servo and IR sensor on: April 17, 2013, 12:40:53 pm
Instead of jumping right in with both the servo and sensor, test them both individually.

Your servo will not work properly, running on the 5 volts from the arduino. You will harm the arduino if you continue to do that. Get a separate power supply around 6 volts to power the servo.

Also the best way to see if your sensor is working, is to use the serial monitor.
Add Serial.begin(9600); to setup() and use Serial.println(analogRead(IRpin)); to see the values your getting from the sensor.
229  Using Arduino / Project Guidance / Re: Need a help with Servo and IR sensor on: April 17, 2013, 11:38:07 am
Change "directionState = ~directionState;"  => "directionState = !directionState;"

Analog pins are usually defined as A0 - A5;
 
230  Using Arduino / Motors, Mechanics, and Power / Re: Forwards, stop, and backwards control of 10V DC motor on: April 17, 2013, 10:02:36 am
Post your full code.
231  Using Arduino / Project Guidance / Re: Need help with my project on: April 16, 2013, 10:58:47 pm
I'm not sure what this code is intended to do, but it's garbage. Just make a simple code that uses a FOR loop that send number 0 - 100. Actually, I think this code does just that, but makes it look SO much more complicated than it needs to be.

Quick question, what program are you using to connect to the bluesmirf and see the data it's transmitting to the computer?
232  Using Arduino / Programming Questions / Re: ASCII to int (yes, another one) on: April 16, 2013, 05:36:19 pm
Quote
I have a char array containing the 6 bytes of data sent from the platform. This is then split into three char arrays, one for each R, G and B. Where I'm stuck is turning this into an int.

Have you tried strtok(), and then use atoi?
233  Using Arduino / Programming Questions / Re: ASCII to int (yes, another one) on: April 16, 2013, 05:15:59 pm
sprintf( /*char array*/, /* how you want to show it*/, /* your data*/);
sprintf(buff, "%d ",ninjaBlock.srtDATA);
234  Using Arduino / Programming Questions / Re: Code Error :- Ping Robot on: April 16, 2013, 01:50:40 pm
I have a few minor questions.

1) Why is your ping signal set as an output?
2) Why is this set the way it is. "Serial.begin(96500);"
3) How can "val = digitalRead(signal); " read anything if it is set as an output?
4) Why?
Quote
while(val == LOW) {                   // Loop until pin reads a high value
    val = digitalRead(signal);
}

5) This is doing nothing, if(timecount > 0){ }
6) Where is pulseduration?
7) This will give you problems,
Quote
if( signal > 500){
   ls.write(0);
 }
 
 if( signal > 450){
   rs.write(0);
 }
8 ) Why is this not in [ code ] [/ code] tags?

Last question, your pig sensor lights up?
235  Using Arduino / Project Guidance / Re: Need help with my project on: April 16, 2013, 12:29:03 pm
If you have written any code so far, Post it. Also is the bluesmirf paired correctly to the computer?
236  Using Arduino / Programming Questions / Re: Basic Arduino Setup codes issues on: April 16, 2013, 10:39:52 am
To see the motor actually move longer, change delay(1); to delay(1000); 
237  Using Arduino / Project Guidance / Re: Turning on/off a light bulb on: April 16, 2013, 09:02:25 am
Quote
i'd simply like to build a basic project to turn off/on light bulbs
Maybe you should start smaller with LEDs. The arduino software provides you with example codes you can do whatever you want with. Start with the basics and work your way up.

Turning on/off an LED with code is extremely simple, and even simpler with just a battery, an LED and a switch.
Quote
I know a bit C/C++ and nothing besides that
Thats perfect for this, because it requires very little knowledge to do this.
238  Topics / Robotics / Re: 2 motors controlled by one joystick on: April 16, 2013, 07:26:27 am
I did something simular with DC motors. It uses 2 variable "z" -forward movement and "y" - left and right movement.
Note this is only a snip of the full code, the rest is just receiving the data and sending it to here. You may also be able to alter it to use servos instead of DC motors.

Hope this gives you some ideas.

Code:
int DRV2 = map(z, -15, 0, 255, 0);
  int DRV1 = map(z, 0, 15, 0, 255);
  int STRL = map(y, -10, 0, 255, 0);
  int STRR = map(y, 0, 10, 0, 255);
  //constrain((DRV1,DRV2,STRL,STRR),0,255);

/*Serial.print(DRV1);
Serial.print(",");
Serial.print(DRV2);
Serial.print(",");
Serial.print(STRL);
Serial.print(",");
Serial.print(STRR);
//Serial.print(",");
//Serial.print(y);
Serial.println();*/

  if(z > 0)//forwards with skew left or right             
  {
    //Serial.println("Driving");
    analogWrite(M1L, constrain(abs(DRV1 - STRL),0,255)); analogWrite(M1R, constrain(abs(DRV1 - STRR),0,255));   
    digitalWrite(M2L, LOW);                                             digitalWrite(M2R, LOW);   
  }
  else if(z < 0)//backwards with skew left or right             
  {
    //Serial.println("Driving");
    digitalWrite(M1L, LOW);                                             digitalWrite(M1R, LOW);   
    analogWrite(M2L, constrain(abs(DRV2 - STRL),0,255)); analogWrite(M2R, constrain(abs(DRV2 - STRR),0,255));   
  }
   else if(z < 4 && z > -4 && y > 0)//Right   (+-4 = limits before movement)           
  {
    //Serial.println("Driving");
    digitalWrite(M2L, LOW); analogWrite(M2R, STRR);   
    analogWrite(M1L, STRR); digitalWrite(M1R, LOW);
  }
  else if(z < 4 && z > -4 && y < 0)//Left             
  {
     //Serial.println("Driving");
    analogWrite(M2L, STRL); digitalWrite(M2R, LOW);   
    digitalWrite(M1L, LOW); analogWrite(M1R, STRL);   
  }

  else //full stop
  {
    digitalWrite(M1L, LOW); digitalWrite(M1R, LOW);       
    digitalWrite(M2L, LOW); digitalWrite(M2R, LOW);   
  }
239  Using Arduino / Project Guidance / Re: Arduino uno + Keypad = calculator on: April 16, 2013, 07:01:15 am
Something to give you an idea. Add and subtract with keypad
240  Using Arduino / Programming Questions / Re: Split a string into two integer values on: April 15, 2013, 08:57:38 am
Full code
Pages: 1 ... 14 15 [16] 17 18 ... 106