Re: serb robot internet basied

'void mousePressed()':

Are you using the correct Processing environment?

[edit]I've got it compiling OK using Processing 1.0.3 - you're not using the Arduino IDE to compile it, are you? [edit]Yes, I think you are. The sketch is written in Processing (Java) meant to run on a PC, not an Arduino[/edit][/edit]

yes , i am using the arduino 0018 software .

here is the link to the project

http://www.instructables.com/id/How-to-Make-a-Web-Connected-Robot-for-about-500/

in the software for arduino tab the file missing 05-webb arduino.zip

but in between there is a code (/* * Arduino Controlled Web Connected Robot (WEBB) - Serial Host ) but it goes in a straigth line

can even one help me

The Processing application talks to the Arduino using the serial port. The code you are trying to upload to the Arduino is NOT the code that goes on the Arduino.

You need to compile and run that code in Processing, and compile the correct code for the Arduino.

but it goes in a straigth line

It looks to me like all the code is there, you just need to make sure that it is correctly formatted.

(minor rant: had this been commented as a C program, it would (probably) have compiled, but the C++ line comments screw it up)

Have you looked at http://www.oomlout.com/serb?

[edit]

#define FORWARD 70        //F
#define BACKWARD 66       //B
#define LEFT 76           //L
#define RIGHT 82          //R
#define SETSPEED 83          //S
#define STOP 67           //C
#define SETSPEEDLEFT 88   //X
#define SETSPEEDRIGHT 89  //Y

Oh dear.

if ( dta = checkByte1){            //Checks for first check byte         
      dta = Serial.read();        
      if ( dta = checkByte2){

Oh dear, dear :o[/edit]

i have tried to reformat it but there is some error
while compiling or uploading

#include <Servo.h>
#define LEFTSERVOPIN 10 
#define RIGHTSERVOPIN 9
Servo leftServo; 
Servo rightServo; 
int leftSpeed = 50; 
int rightSpeed = 100; 
//-----------
void setup(){ 
Serial.begin(9600); 
Setup();
void loop() { 
SerialPort();
//-----------
SerialPort(){ 
if ( Serial.available() >= 5) {
dta = Serial.read();
if ( dta = checkByte1){ 
dta = Serial.read(); 
if ( dta = checkByte2){ 
dta = Serial.read();
if ( dta = checkByte3){ 
int command = Serial.read(); 
int param1 = Serial.read(); 

if (command == FORWARD){goForward(); 
delay(param1 * 100); 
goStop();} 
if(command == BACKWARD){goBackward();
delay(param1 * 100);
goStop();} 
if(command == LEFT){goLeft(); 
delay(param1 * 100); 
goStop();} 
if(command == RIGHT){goRight(); 
delay(param1 * 100); 
goStop();} 

if(command == SETSPEED){setSpeed(param1);} 
if(command == STOP){goStop();} 
if(command == SETSPEEDLEFT){setSpeedLeft(param1);} 
if(command == SETSPEEDRIGHT){setSpeedRight(param1);} 
 goLeft(); delay(150); goRight(); delay(150); goStop(); }
 //--------------------------------
Setup(){ setSpeed(leftSpeed);
pinMode(LEFTSERVOPIN, OUTPUT); 
pinMode(RIGHTSERVOPIN, OUTPUT); 
 leftServo.attach(LEFTSERVOPIN); 
 rightServo.attach(RIGHTSERVOPIN);
  goStop();}
 void setSpeed(int newSpeed){ 
 setSpeedLeft(newSpeed);
 setSpeedRight(newSpeed); 
 setSpeedLeft(int newSpeed){ if(newSpeed >= 100) {newSpeed = 100;} 
 if(newSpeed <= 0) {newSpeed = 0;} 
 setSpeedRight(int newSpeed){ if(newSpeed >= 100) {newSpeed = 100;} 
  if(newSpeed <= 0) {newSpeed = 0;} 
 void goForward(){ leftServo.write(90 + leftSpeed); 
 rightServo.write(90 - rightSpeed);
 void goBackward(){ leftServo.write(90 - leftSpeed); 
 rightServo.write(90 + rightSpeed);
 void goRight(){ leftServo.write(90 + leftSpeed);
 rightServo.write(90 + rightSpeed);
 void goLeft(){ leftServo.write(90 - leftSpeed);
 rightServo.write(90 - rightSpeed);
 void goStop(){ leftServo.write(90); 
 rightServo.write(90);

so can you plz i have been tring from almost 2 month

http://www.oomlout.com/serb
link is not working

You’re missing a large part of the code posted.
All of the “#define SETSPEED”, etc are missing from your code, and there’s a ton of missing “}”

Just get the code from the single line, and go through it methodically.
Don’t discard stuff that contains “#” or “}”

There’s no need to set the pinMode for a servo pin, because that is done automatically by the library.
The code for “checking” the three “A” characters is rubbish because the comparisons are assignments, so will always be true (unlees a “nul” character is received).

After a short wait, the link redirects here: http://www.oomlout.com/a/products/serb/

The first few lines hould look like this:

/* * Arduino Controlled Web Connected Robot (WEBB) - Serial Host 
* For more details visit: http://www.oomlout.com/serb  
*   * Behaviour: The Arduino listens to its Serial port for a command 
*    in format 254, 88, 88, (COMMAND), (TIME) 
*             Supported Commands - 'F' - 70 - Forward 
*                                  'B' - 66 - Backward 
*                                  'L' - 76 - Left 
*                                  'R' - 82 - Right 
*                                  'S' - 83 - Speed 
*                                  'X' - 88 - SetSpeedLeft 
*                                  'Y' - 89 - SetSpeedRight  
*                                  'C' - 67 - Stop  
*             Supported Times - 0 - 255 (0 to 25.5 Seconds) value * 100 milliseconds  
* 
* Wiring: Right Servo Signal - pin 9 
*          Left Servo Signal - pin 10  
* * License: This work is licenced under the Creative Commons  
*           Attribution-Share Alike 3.0 Unported License. To  
*          view a copy of this licence, visit  
*           http://creativecommons.org/licenses/by-sa/3.0/  
*           or send a letter to Creative Commons, 171 Second  
*           Street, Suite 300, San Francisco, California 94105,  
*           USA. 
*         
*/
//-------------------------------------------------------------------------
//START OF ARDUINO SERIAL SERVER PREAMBLE 
//Defining constants corresponding to each command (also the ascii code number) 
#define FORWARD 70        //F
#define BACKWARD 66       //B
#define LEFT 76           //L
#define RIGHT 82          //R
#define SETSPEED 83          //S
#define STOP 67           //C
#define SETSPEEDLEFT 88   //X
#define SETSPEEDRIGHT 89  //Y
/*The three check bytes (used to keep the robot from responding to random serial 
*data) currently "AAA" */
#define checkByte1 65    // "A"
#define checkByte2 65    // "A"
#define checkByte3 65    // "A" 
//--------------------------------------------------------------------------
// START OF ARDUINO CONTROLLED SERVO ROBOT (SERB) PREAMBLE 
#include <Servo.h>
#define LEFTSERVOPIN  10    //The pin the left servo is connected to 
#define RIGHTSERVOPIN  9    //The pin the right servo is connected to 
Servo leftServo;            
Servo rightServo;  
int leftSpeed = 50;   //holds the speed of the robots leftServo                        
//a percentage between 0 and 100 
int rightSpeed = 100;  
//holds the speed of the robots rightServo
//a percentage between 0 and 100 
// END OF ARDUINO CONTROLLED SERVO ROBOT (SERB) PREAMBLE 
//-------------------------------------------------------------------------- 
//Gets everything up and running 
void setup()
{   
  Serial.begin(9600);                //Starts the serial port   
  serbSetup();                       //sets the state of all neccesary                                       
                                     //pins and adds servos to your sketch 
}
//The main program loop 
void loop()                     
{   
  serbPollSerialPort();             //continuously looks to the serial port
  //if there is data it processes it 
}

(I got bored reading the comments at this point)

thanks for helping me so far. i am a starter at arduino stuff . i am in 11 grade i dont kown any programing.

if you have any free time can u debug this code for me plz

This whole thing looks familiar to me - I seem to recall converting that “one line monstrosity” into something approaching reality a few months ago for someone else on this forum…

:-?

Here it is:

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1275422015

i'm sorry, I have no idea what '11 grade' is - is that something to do with karate, or the Freemasons?

He probably meant "11th Grade" - which in America (not sure in other areas?) is called "Junior Year" in high school. Typically, schools are divided into primary - K-6th, secondary - or junior high - 7th-8th, and High School, 9th-12th grade levels - sometimes schools combine certain levels, depending on state and district; but typically, there are 12 grade levels in school (12 years), starting at roughly age 5, so when you graduate from high school (to continue to college, university, tech school, or workforce), you are around 17-18 years of age; so this individual is probably 16-17 years old (maybe 14 or 15, if he/she skipped grades due to academic ability or other reasons).

:)

I will say this much - he or she better be on a phone texting their BFF JILL (and/or had english as a second language) when they posted that...

If english is their first language, and they were typing on a regular computer keyboard, they have no excuse (assuming their age is near what I posted), and their teachers should be fired, their parents chastised, and they should be ashamed, and made to repeat a grade or two...

:P

thanks to both of you AWOL & cr0sh

the code did upload

the code is having some small problems

when i upload the code to arduino , the servo starts to rotate clockwise and when i open the serb robot pc software (which controls arduino) its the same but when i click the forword button the servo is speeds up . all the direction is working but it is not staying still.

how can i make it stand still ?

if you are not getting an idea , i will post a video ok

The servos are supposed to be stopped when you command them to 90 degrees, but depending on how they were modified, this may be off a little. Two ways to fix it: experimentation to find what 'angle' stops them, or simply 'detach' them when you want to stop, then re-attach when you want to move

Something to keep in mind; in the thread that I posted, you will notice that the original poster in that thread said he had to make a couple of small changes to get it to work properly, but he did -not- post what those changes were; also, there was a correction posted by another member of these forums indicating some issues with comparison vs value assignment. These issues and differences may explain why you are having issues. You should review these, and perhaps see if you can get into contact with the OP of that thread I posted to find out how he got his to work. Then, when you know things are working OK - please post the changed/updated code into this thread (and perhaps into the other thread as well), so that in the future, others won't have this issue...

:)

i contuct that guy (predatorjk) but he said he could not get it to work

sorrrrrry the code work fine which you gave

it was my hardware problem , but now its ok

the code is the same thanks