Loading...
  Show Posts
Pages: 1 [2] 3 4 ... 435
16  Using Arduino / Project Guidance / Re: Using Arduino as a Parallel port -> usb bridge on: May 17, 2013, 02:53:31 pm
The USB to parallel port cables usually only support printers and may not work with other software. If you have a full sized pc, then you might consider a pci card like below.

http://www.geeks.com/details.asp?InvtId=JJ-P01411-S1-DT
17  Using Arduino / Networking, Protocols, and Devices / Re: ENTER key In Serial on: May 17, 2013, 02:34:22 pm
i need to program the arduino to send it on a software serial line when it recieves another serial message from the computer

In the below simple code the ln part of "Serial.println" adds a carriage return and line feed to what is being sent.

Code:
// zoomkat 7-30-11 serial I/O string test
// type a string in serial monitor. then send or enter
// for IDE 0019 and later

String readString;

void setup() {
  Serial.begin(9600);
  Serial.println("serial test 0021"); // so I can keep track of what is loaded
}

void loop() {

  while (Serial.available()) {
    delay(2);  //delay to allow byte to arrive in input buffer
    char c = Serial.read();
    readString += c;
  }

  if (readString.length() >0) {
    Serial.println(readString);

    readString="";
  }
}

18  Using Arduino / Programming Questions / Re: toggle led on: May 17, 2013, 11:14:29 am
i need a sample program for led to toggle, if i press a push button led must on and if i again press the same push button led must get off and wise versa. pls tel me the logic

You can try something like below:

Code:
//zoomkat LED button toggle test 11-08-2012

int button = 5; //button pin, connect to ground as button
int press = 0;
boolean toggle = true;

void setup()
{
  pinMode(13, OUTPUT); //LED on pin 13
  pinMode(button, INPUT); //arduino monitor pin state
  digitalWrite(5, HIGH); //enable pullups to make pin 5 high
}

void loop()
{
  press = digitalRead(button);
  if (press == LOW)
  {
    if(toggle)
    {
      digitalWrite(13, HIGH);   // set the LED on
      toggle = !toggle;
    }
    else
    {
      digitalWrite(13, LOW);    // set the LED off
      toggle = !toggle;
    }
  }
  delay(500);  //delay for debounce
}

19  Using Arduino / Programming Questions / Re: serial connections on: May 17, 2013, 10:36:46 am
just as a simple test, you could try the below code on both the uno and mega. Disconnect the wire between the uno rx pin and mega tx pin to prevent interference during the test, then send something using the uno serial monitor and see if it is echoed back to the uno serial monitor and appears on the mega serial monitor.

Code:
// zoomkat 7-30-11 serial I/O string test
// type a string in serial monitor. then send or enter
// for IDE 0019 and later

String readString;

void setup() {
  Serial.begin(9600);
  Serial.println("serial test 0021"); // so I can keep track of what is loaded
}

void loop() {

  while (Serial.available()) {
    delay(2);  //delay to allow byte to arrive in input buffer
    char c = Serial.read();
    readString += c;
  }

  if (readString.length() >0) {
    Serial.println(readString);

    readString="";
  }
}

20  Using Arduino / Motors, Mechanics, and Power / Re: Example of Servo Pan-Tilt control from Joystick on: May 17, 2013, 12:01:56 am
I made the below for future tinkering with joystick/pot servo control via an Ethernet/internet connection. It has a delay and dead band to make serial monitor viewing of what is going on easier, and to prevent an unneeded control position spew which might overload the receiving end. I haven't had a servo hooked up in quite a while, so I need to get back on that.

Code:
//zoomkat dual pot/servo test 12-29-12
//view output using the serial monitor

#include <Servo.h>
Servo myservo1;
Servo myservo2;

int potpin1 = 0;  //analog input pin A0
int potpin2 = 1;

int newval1, oldval1;
int newval2, oldval2;

void setup()
{
  Serial.begin(9600); 
  myservo1.attach(2); 
  myservo2.attach(3);
  Serial.println("testing dual pot servo"); 
}

void loop()
{
  newval1 = analogRead(potpin1);           
  newval1 = map(newval1, 0, 1023, 0, 179);
  if (newval1 < (oldval1-2) || newval1 > (oldval1+2)){ 
    myservo1.write(newval1);
    Serial.print("1- ");
    Serial.println(newval1);
    oldval1=newval1;
  }

  newval2 = analogRead(potpin2);
  newval2 = map(newval2, 0, 1023, 0, 179);
  if (newval2 < (oldval2-2) || newval2 > (oldval2+2)){ 
    myservo2.write(newval2);
    Serial.print("2- ");   
    Serial.println(newval2);
    oldval2=newval2;
  }
  delay(50);
}

21  Using Arduino / Networking, Protocols, and Devices / Re: How to convert a string from char to ASCII on: May 16, 2013, 10:19:31 pm
You might post a link to the betabrite protocol to give a better idea of just what the betabrite is expecting.
22  Using Arduino / Motors, Mechanics, and Power / Re: Continuous Servo/Relay issue on: May 16, 2013, 10:12:52 pm
Setups that might work for curtains.



23  Using Arduino / Motors, Mechanics, and Power / Re: High accuracy pan tilt turret on: May 16, 2013, 09:58:40 pm
servocity has a new worm gear drive assembly.

http://www.servocity.com/html/vertical_shaft_worm_drive_gear.html
24  Using Arduino / Motors, Mechanics, and Power / Re: Arduino restarts when DC motors are turned on on: May 16, 2013, 09:48:46 pm
If adding a cap doesn't work, I'll focus on further reducing EMI. Using two sources though is out of the question.

I doubt that the above will fix your problem. You might consider getting two UBECs on ebay for powering the arduino and motors from the same power source. I use the below setup to prevent the servos from causing a low voltage drop out of the servo chip when the servo motors start. 

25  Using Arduino / Motors, Mechanics, and Power / Re: Example of Servo Pan-Tilt control from Joystick on: May 16, 2013, 09:33:08 pm
I took a quick look and the delay below may be just an artifact from the servo "sweep" example. A delay does come in handy when printing to the serial monitor for observing values being generated.

Code:
delay(25);                      // wait for the servo to reach the position
26  Using Arduino / Networking, Protocols, and Devices / Re: How to convert a string from char to ASCII on: May 16, 2013, 08:33:06 pm
Quote
*********** BELOW WORKS FINE***************************************
String ThisMessage = ("This is some manually entered test data to display");  // This displays properly on the BetaBrite
*********** ABOVE WORKS FINE***************************************

If the above works, then you might try the below simple code with the serial monitor (assuming the arduino tx is connected to the betabrite rx, grounds are connected, baud rates set, etc.) and see if what is sent from the serial monitor is echoed back to the serial monitor and the betabrite. If that works, then progress is being made.

Code:
// zoomkat 7-30-11 serial I/O string test
// type a string in serial monitor. then send or enter
// for IDE 0019 and later

String readString;

void setup() {
  Serial.begin(9600);
  Serial.println("serial test 0021"); // so I can keep track of what is loaded
}

void loop() {

  while (Serial.available()) {
    delay(2);  //delay to allow byte to arrive in input buffer
    char c = Serial.read();
    readString += c;
  }

  if (readString.length() >0) {
    Serial.println(readString);

    readString="";
  }
}

27  Using Arduino / Networking, Protocols, and Devices / Re: How to convert a string from char to ASCII on: May 15, 2013, 11:57:12 pm
Have you tried a search like below for info?

https://www.google.com/search?hl=en&as_q=+betabrite+arduino&as_epq=&as_oq=&as_eq=&as_nlo=&as_nhi=&lr=&cr=&as_qdr=all&as_sitesearch=&as_occt=any&safe=images&tbs=&as_filetype=&as_rights=
28  Using Arduino / Project Guidance / Re: Automotive Compression Tester on: May 15, 2013, 11:25:44 pm
Don't forget the engine variables like engine hot/cold, throttle open/closed, air cleaner clean/dirty, and variations in engine cranking rpm.
29  Using Arduino / Networking, Protocols, and Devices / Re: Ethernet shield and log file on: May 14, 2013, 08:05:00 pm
Another version ? I can only find the same version. Adding "readSnDIPR()" to the library.
http://forum.arduino.cc/index.php?topic=135261.0
http://forum.arduino.cc/index.php?topic=74660.msg563006#msg563006

What happens may be the same, the modification of the library files to get there might be different.

http://forum.arduino.cc/index.php/topic,135082.0.html
30  Using Arduino / Networking, Protocols, and Devices / Re: Ethernet shield and log file on: May 14, 2013, 06:19:23 pm
There has been another version of getting the client IP address has been posted by SurferTim, but don't have a link to that posting.
Pages: 1 [2] 3 4 ... 435