Show Posts
Pages: [1] 2 3 ... 650
1  Using Arduino / Project Guidance / Re: Another an HTTP POST question on: October 01, 2014, 11:00:39 pm
Quote
FYI, POSTed data needs to be in the form of name=value&name2=value2&name3=value3 (etc.)

I would think that would be the case only if that is the particular format the server is expecting.
2  Using Arduino / Programming Questions / Re: Help with Serial.parseInt on: October 01, 2014, 07:59:52 pm
Homework item: read the "How to use this forum - please read." stickie about how to post code.
3  Using Arduino / Motors, Mechanics, and Power / Re: Question Servo motor on: October 01, 2014, 07:07:33 pm
Quote
I want the axis to rotate full circles, but with a particular degree at a time.

Perhaps you should use a different type of ball feed. To use a servo, you could have the servo lift a ball entry gate while lowering the exit gate to load a ball, then lift the exit gate while lowering the entry gate to release the ball. 
4  Using Arduino / Programming Questions / Re: Ethernet Shield won't connect but works fine as a server on: September 30, 2014, 11:27:55 pm
Basic client test code you can try to see if you get an error response (server was shut down for good at midnight).

Code:
//zoomkat 9-22-12
//simple client test
//for use with IDE 1.0.1
//with DNS, DHCP, and Host
//open serial monitor and send an e to test
//for use with W5100 based ethernet shields
//remove SD card if inserted

#include <SPI.h>
#include <Ethernet.h>

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; //physical mac address

char serverName[] = "web.comporium.net"; // zoomkat's test web page server
EthernetClient client;

//////////////////////

void setup(){

  if (Ethernet.begin(mac) == 0) {
    Serial.println("Failed to configure Ethernet using DHCP");
    // no point in carrying on, so do nothing forevermore:
    while(true);
  }

  Serial.begin(9600);
  Serial.println("Better client test 9/22/12"); // so I can keep track of what is loaded
  Serial.println("Send an e in serial monitor to test"); // what to do to test
}

void loop(){
  // check for serial input
  if (Serial.available() > 0) //if something in serial buffer
  {
    byte inChar; // sets inChar as a byte
    inChar = Serial.read(); //gets byte from buffer
    if(inChar == 'e') // checks to see byte is an e
    {
      sendGET(); // call sendGET function below when byte is an e
    }
  } 
}

//////////////////////////

void sendGET() //client function to send/receive GET request data.
{
  if (client.connect(serverName, 80)) {  //starts client connection, checks for connection
    Serial.println("connected");
    client.println("GET /~shb/arduino.txt HTTP/1.1"); //download text
    client.println("Host: web.comporium.net");
    client.println("Connection: close");  //close 1.1 persistent connection 
    client.println(); //end of get request
  }
  else {
    Serial.println("connection failed"); //error message if no client connect
    Serial.println();
  }

  while(client.connected() && !client.available()) delay(1); //waits for data
  while (client.connected() || client.available()) { //connected or data available
    char c = client.read(); //gets byte from ethernet buffer
    Serial.print(c); //prints byte to serial monitor
  }

  Serial.println();
  Serial.println("disconnecting.");
  Serial.println("==================");
  Serial.println();
  client.stop(); //stop client

}
5  Using Arduino / Project Guidance / Re: What's happening with my robot? on: September 30, 2014, 11:15:40 pm
Perhaps make a mini Faraday cage.

http://en.wikipedia.org/wiki/Faraday_cage
6  Using Arduino / Motors, Mechanics, and Power / Re: how to squeeze an object with a servo motor? on: September 30, 2014, 11:09:01 pm
Remember you will need a really good power supply for the big servos.

http://www.hobbyking.com/hobbyking/store/__16643__VS_11_Vigor_Extra_Large_Servo_19sec_19kg_103g.html

http://www.hobbyking.com/hobbyking/store/__23491__HK15338_Giant_MG_Digital_Servo_175g_25kg_0_21s.html

http://www.hobbyking.com/hobbyking/store/__18743__Vigor_VSD_11YMB_MG_HV_Extra_Large_360_Degree_Winch_Servo_0_75sec_40kg_150g.html
7  Using Arduino / Networking, Protocols, and Devices / Re: SMS message truncating at 'W' when sending SMS through SIM900 GSM shield!! on: September 30, 2014, 10:44:14 pm
I think a w (or W?) may be an AT wait for dial tone command.
8  Using Arduino / Programming Questions / Re: Servo motor with push button on: September 30, 2014, 07:27:48 pm
Basic two button servo code. You can add +10 or -10 incrementing for each servo.

Code:
//zoomkat servo button test 12-29-2011
// Powering a servo from the arduino usually *DOES NOT WORK*.

#include <Servo.h>
int button1 = 4; //button pin, connect to ground to move servo
int press1 = 0;
int button2 = 5; //button pin, connect to ground to move servo
int press2 = 0;
Servo servo1;

void setup()
{
  pinMode(button1, INPUT);
  pinMode(button2, INPUT);
  servo1.attach(7);
  digitalWrite(4, HIGH); //enable pullups to make pin high
  digitalWrite(5, HIGH); //enable pullups to make pin high
}

void loop()
{
  press1 = digitalRead(button1);
  if (press1 == LOW)
  {
    servo1.write(170);
  }   
 
  press2 = digitalRead(button2);
  if (press2 == LOW)
  {
    servo1.write(10);
  }
}

9  Using Arduino / Programming Questions / Re: Serial Communication -Driving 2 Servos with 2 Pot's with Xbee's on: September 30, 2014, 07:22:18 pm
Below is some servo test code I worked on some time back for controlling a servo robotic arm. You might try it just using serrial tx/rx/gnd between the arduinos instead of the xbees to see if it works.

TX code
Code:
//zoomkat multi pot/servo test 3-23-13
//includes dead band for testing and limit servo hunting
//view output using the serial monitor

#include <Servo.h>
Servo myservo1;  //declare servos
Servo myservo2;
Servo myservo3;
Servo myservo4;
Servo myservo5;

int potpin1 = 0;  //analog input pin A0
int potpin2 = 1;
int potpin3 = 2;
int potpin4 = 3;
int potpin5 = 4;

int newval1, oldval1;  //pot input values
int newval2, oldval2;
int newval3, oldval3;
int newval4, oldval4;
int newval5, oldval5;

void setup()
{
  Serial.begin(9600); 
  myservo1.attach(2); 
  myservo2.attach(3);
  myservo3.attach(4);
  myservo4.attach(5);
  myservo5.attach(6);
  Serial.println("testing multi pot servo"); 
}

void loop()
{
  newval1 = analogRead(potpin1);           
  newval1 = map(newval1, 0, 1023, 0, 179);
  if (newval1 < (oldval1-2) || newval1 > (oldval1+2)){ //dead band
    myservo1.write(newval1); //position the servo
    Serial.print(newval1); //print the new value for testing
    Serial.print("a,");
    oldval1=newval1; //set the current old value
  }

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

  newval3 = analogRead(potpin3);           
  newval3 = map(newval3, 0, 1023, 0, 179);
  if (newval1 < (oldval1-2) || newval3 > (oldval3+2)){ 
    myservo1.write(newval3);
    Serial.print(newval3);
    Serial.print("c,");
    oldval3=newval3;
  }

  newval4 = analogRead(potpin4);           
  newval4 = map(newval4, 0, 1023, 0, 179);
  if (newval1 < (oldval1-2) || newval4 > (oldval4+2)){ 
    myservo1.write(newval4);
    Serial.print(newval4);
    Serial.print("d,");
    oldval4=newval4;
  }

  newval5 = analogRead(potpin5);           
  newval5 = map(newval5, 0, 1023, 0, 179);
  if (newval1 < (oldval5-2) || newval5 > (oldval5+2)){ 
    myservo1.write(newval5);
    Serial.print(newval5);
    Serial.print("e,");
    oldval5=newval5;
  }
  delay(50);  //to slow loop for testing, adjust as needed
}


RX code
Code:
//zoomkat 11-22-12 simple delimited ',' string parse
//from serial port input (via serial monitor)
//and print result out serial port
//multi servos added

String readString;
#include <Servo.h>
Servo myservoa, myservob, myservoc, myservod, myservoe;  // create servo object to control a servo

void setup() {
  Serial.begin(9600);

  //myservoa.writeMicroseconds(1500); //set initial servo position if desired

  myservoa.attach(6);  //the pin for the servoa control
  myservob.attach(7);  //the pin for the servob control
  myservoc.attach(8);  //the pin for the servoc control
  myservod.attach(9);  //the pin for the servod control
  myservod.attach(10);  //the pin for the servoe control
  Serial.println("multi-servo-delimit-test-dual-input-11-22-12"); // so I can keep track of what is loaded
}

void loop() {

  //expect single strings like 700a, or 1500c, or 2000d,
  //or like 30c, or 90a, or 180d,
  //or combined like 30c,180b,70a,120d,

  if (Serial.available())  {
    char c = Serial.read();  //gets one byte from serial buffer
    if (c == ',') {
      if (readString.length() >1) {
        Serial.println(readString); //prints string to serial port out

        int n = readString.toInt();  //convert readString into a number

        // auto select appropriate value, copied from someone elses code.
        if(n >= 500)
        {
          Serial.print("writing Microseconds: ");
          Serial.println(n);
          if(readString.indexOf('a') >0) myservoa.writeMicroseconds(n);
          if(readString.indexOf('b') >0) myservob.writeMicroseconds(n);
          if(readString.indexOf('c') >0) myservoc.writeMicroseconds(n);
          if(readString.indexOf('d') >0) myservod.writeMicroseconds(n);
          if(readString.indexOf('e') >0) myservoe.writeMicroseconds(n);
        }
        else
        {   
          Serial.print("writing Angle: ");
          Serial.println(n);
          if(readString.indexOf('a') >0) myservoa.write(n);
          if(readString.indexOf('b') >0) myservob.write(n);
          if(readString.indexOf('c') >0) myservoc.write(n);
          if(readString.indexOf('d') >0) myservod.write(n);
          if(readString.indexOf('e') >0) myservoe.write(n);
        }
         readString=""; //clears variable for new input
      }
    } 
    else {     
      readString += c; //makes the string readString
    }
  }
}

10  Using Arduino / Project Guidance / Re: What's happening with my robot? on: September 30, 2014, 07:12:45 pm
Quote
the problem comes when I power on the GSM module... due to EMI in the air and in the circuit.

Could be a power issue instead of EMI. I've seen the RC guys have their transmitter antennas right next to their planes checking checking the controls, and their servos don't go crazy. If the GSM module RF emissions are interfering with the mega chip itself, then you have bigger issues.
11  Using Arduino / Project Guidance / Re: What's happening with my robot? on: September 30, 2014, 06:42:58 pm
Quote
I need a solution. Sorry for being so persistent, but I spent lot of time on this project and money, and now this is making me crazy.

With failure after five pages of post, I'd suggest you start over and get your servos working properly then introduce the GSM part of your project.
12  Using Arduino / Project Guidance / Re: I'm making an internet connected washer and dryer ball on: September 30, 2014, 06:28:48 pm
You could put a 120vac relay across the drum motor leads. When the motor is energized, the relay is energized. When the motor is off, the relay is deenergized. just check the relay contact status. Or you could use a brick and a piezo shock sensor.
13  Using Arduino / Motors, Mechanics, and Power / Re: Controlling six brushless motors using dpdt relays help [Solved] on: September 29, 2014, 11:09:53 pm
Have you actually tried reversing two of the three wires between the ESC and motor to see if the motor runs in reverse?  If so, two of the three wires could be switched with a relay like below.  The 35ma relay coil current might be a little high for an arduino pin to directly supply.


14  Using Arduino / Programming Questions / Re: Servo Problems on: September 29, 2014, 10:56:10 pm
Quote
then my computer flashes an error message stating that the connected USB device is consuming too much power, and that the computer has cut off its power to the USB port in order to protect its components.

If you are powering the servo from the arduino, the servo is probably causing the arduino to reset due to low voltage, as well as overpowering the USB port on the pc.
15  Using Arduino / Programming Questions / Re: Simple Communication System between Internet Connected Services on: September 29, 2014, 10:30:46 pm
Quote
I'm basically talking about a service that allows you to send data in a single format which then transforms it into something understood by another service/device, without having to figure out every single device/service's language.

Seems like HTTP client/server protocol (and maybe others) generally do that. what would be unique about your new service?
Pages: [1] 2 3 ... 650