Show Posts
Pages: 1 ... 69 70 [71] 72 73 ... 342
1051  Using Arduino / Programming Questions / Re: Combining Codes on: August 05, 2014, 01:35:20 pm
That servo code doesn't look like servo code to me: as its comment says, it's speed control of a normal motor.... speeds it up then slows down.

But if it was servo code, it would be quite easy to do what you want: in loop() you just do the servo movement followed by the dc motor stuff. edit.... Making sure firstly, that you don't have a clash on pin assignments and variable names.

Get that servo part sorted first though: maybe you just posted the wrong code?

Oh, and please use code tags so that

Code:
your code;
looks
{
like
this
}
1052  Using Arduino / Programming Questions / Re: [RESOLVED] on: August 05, 2014, 12:18:53 pm
Now change the title back to what it was originally with RESOLVED in front, not just RESOLVED on its own.

Btw, it is totally unnecessary to put NOT RESOLVED like you have been doing..... that makes it seem you're in a huge hurry and chasing members to answer.
1053  Using Arduino / Programming Questions / Re: Program lock up on: August 05, 2014, 12:15:16 pm
Never use delay() in a program!

That's a bit harsh. I'm sure there are cases where its use is justified or at least acceptable, although I understand "where you're coming from" as the cliché goes.

How about this snippet.....

Code:
// below is the write function, untouched from playground, except ***
void i2c_eeprom_write_byte( int deviceaddress, unsigned int eeaddress, byte data ) {
  int rdata = data;
  Wire.beginTransmission(deviceaddress);
  Wire.write((int)(eeaddress >> 8)); // MSB
  Wire.write((int)(eeaddress & 0xFF)); // LSB
  Wire.write(rdata);
  Wire.endTransmission();
  delay(5);  //added at cattledog's suggestion *** <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
}

..... where without the delay(5) on the end it didn't work.
1054  Using Arduino / General Electronics / Re: Opto coupler wiring basic on: August 05, 2014, 11:15:25 am
Thanks for reply. I have 24vdc signal from proxy & other sensors. To keep my aurduino board safe side wan to isolate this signal. Since arduino support 5v or 3.3v as input, want to convert this signal to his level with isolation.

Well my Reply#13 should get you going.....
1055  Using Arduino / Programming Questions / Re: arduino, data from serial monitor to lcd on: August 05, 2014, 11:11:53 am
Quote
ut surely you want that inside loop() not setup()?

im open for criticism

Well in setup() you haven't measured the distance, have you, and even if you had it would only go once. It gets read over and over in loop(), so I'd guess that's when you want to display it. Might add a short delay just after that so the lcd doesn't go too haywire.... try without.
1056  Using Arduino / Programming Questions / Re: arduino, data from serial monitor to lcd on: August 05, 2014, 10:59:37 am
as you can see i missiong only the part with lcd.print

But surely you want that inside loop() not setup()?

And I reckon it just needs to say lcd.print(distance);
1057  Using Arduino / Motors, Mechanics, and Power / Re: simple car on: August 05, 2014, 10:53:14 am
can you help me?

I did.... the tutorial I linked to shows you exactly what to do. It gives you code and a circuit: the switch controls direction of the motor, the potentiometer controls speed.
1058  Using Arduino / General Electronics / Re: Opto coupler wiring basic on: August 05, 2014, 10:46:54 am
Are you sure he wants to opto isolate?

Well I'm just going by this:

Is there any IC (Optocoupler) available to have 24vdc digital input convert to 5vdc
1059  Using Arduino / Motors, Mechanics, and Power / Re: simple car on: August 05, 2014, 10:33:57 am
i have the brifge from the starter kit

... which according to this, is a 293 so you're good to go....
1060  Using Arduino / Programming Questions / Re: Hit Counter - Problem with "HIGH" command/code on: August 05, 2014, 10:31:47 am
I gave the Pull-Up resistor a try but when I did that the hit counter no longer counted. The number of hits started at 1 and would not count even when a 9v battery was attached.

Best show the circuit for that, and as steinie44 points out, don't be putting 9V in an Arduino other than as power, def not in an i/o pin.

(Pullups invert your logic btw: the pin is high normally, and goes to ground (low) when the switch is closed)
1061  Using Arduino / Motors, Mechanics, and Power / Re: simple car on: August 05, 2014, 10:23:50 am
You ought to post the code you have so far, and the circuit. Also describe what you mean by "its [sic] not working"

What h-bridge do you have?- although they're basically the same in principal, they vary in detail like voltages, currents, pin layouts.

This tutorial might help; it uses an L293 h-bridge.

edit: wrong link given, fixed now
1062  Using Arduino / Programming Questions / Re: Hit Counter - Problem with "HIGH" command/code on: August 05, 2014, 10:14:14 am
Have you got those pins wired with pullup/pulldown resistors? If neither, then when the switch is open, its state is not guaranteed, exactly as you are finding.

Have a look here. Built-in pullups are easiest to implement: code only, no extra hardware.
1063  Using Arduino / Project Guidance / Re: where/how to place "blink without delay" on: August 05, 2014, 07:07:52 am
Quote
the 2 periods in MY code are seperated by the day/night which is not time based.

True, but they are event based (sunrise / sunset)....
1064  Using Arduino / Programming Questions / Re: I need a little help :)) on: August 05, 2014, 06:37:12 am
In fact you may want to add two spaces (shown as underscores below) to separate the pieces on the screen:

 
Code:
Serial.print("A(z)_"); Serial.print(LED1); Serial.print("_labaknak megfelelo LED-et outputba rakja");

And if you want that to be on the same line but separate from whatever comes later, make the last one a println:

 
Code:
Serial.print("A(z)_"); Serial.print(LED1); Serial.println("_labaknak megfelelo LED-et outputba rakja");
1065  Using Arduino / General Electronics / Re: Opto coupler wiring basic on: August 05, 2014, 06:33:35 am
Wouldn't a voltage divider work? - Scotty

Yeah but he said he wanted opto-isolation...

Quote
Is there any IC (Optocoupler) available to have 24vdc digital input convert to 5vdc
Pages: 1 ... 69 70 [71] 72 73 ... 342