loading

Sitway code verify error: trying to download a sitway full balance rocker code into arduino, but get an error.

Trying to download full_balance_rocker_test.txt code onto my arduino.
It worked last week on my old computer, OSX 10.5, but won't work on my new computer 10.6.8.  Don't know if this has anything to do with the error.

When I download, the verify says "The 'BYTE' keyword is no longer supported.  The highlighted lines in the code that are highlighted are as follows: SaberSerial.print(0, BYTE);   //kill motors when first switched on
}

The error message includes the following text: As of Arduino 1.0, the 'BYTE' keyword is no longer supported.
Please use Serial.write() instead.

I tried replacing the 2 highlighted lines with the Serial.write() command, but not working.

Anyone have a suggestion?
Thanks,
Charlie

sort by: active | newest | oldest
snaggud2 years ago

Hi

Try using a older version of Arduino ---- like version 23

Laurie

Post a link to the original code. You look like you've deleted something.

Steve
organs (author)  steveastrouk5 years ago
Thanks, Steve.
The code is a download on the bottom of the page in this link:
https://www.instructables.com/id/SITWAY/step7/MOTOR-TEST/

I have not downloaded it to the board, because it will not verify. When I select verify, a message saying does not support BYTE anymore comes up and 3 places in the code are highlighted.
We tried the sample codes from the Arduino sample sketches and they seem to load fine.
Hope you might be able to identify the problem.

Thanks for your help,
Charlie
You did put softwareserial in the includes ?

Steve
organs (author)  steveastrouk5 years ago
The following line is in the code if that is what you meant by putting softwareserial in the includes:

#include

Even without the board being connected, it won't verify on the arduino sketchboard. Could this be because of our Mac OSX 10.6.8 computer? I clearly am an arduino code beginner, although have used arduino boards successfully in several projects.

You will find 3 lines of the following in the code below that are highlighted when I try to verify.
SaberSerial.print(0, BYTE); //kill motors when first switched on
}
The error message is that BYTE is no longer supported.
Thanks,
Charlie

Below is the code that I am trying to verify and upload.

//TWIN WHEELER MODIFIED FOR ARDUINO SIMPLIFIED SERIAL PROTOCOL TO SABERTOOTH V2

//**********THIS VERSION JUST TESTS COMMUNICATION BETWEEN ARDUINO AND SABERTOOTH AND MOTORS PLUS DEADMAN SWITCH****************
//*********** DEADMAN SWITCH MUST BE PRESSED IN, MOTORS WILL STOP IF RELEASED **********************
//MOTORS WILL INCREASE IN SPEED BY 10% EVERY 5 SECONDS UNTIL 50% OF FULL POWER IS REACHED
//THEY WILL THEN GO DOWN TO ZERO IN STEPS OF 10%.

//BOTH WHEELS SHOULD BE SPINNING IN SAME DIRECTION AT THE SAME SPEED AT ALL TIMES ELSE YOU WILL HAVE WIRED ONE MOTOR UP BACK TO FRONT

//SABERTOOTH MUST HAVE DIP SWITCHES SET TO THE SERIAL MODE:i.e. DIP switches 1, 3, 5 and 6 set to ON, the remainder set to OFF

//IMU NOT CONNECTED AT THIS POINT (CAN BE PHYSICALLY CONNECTED IF YOU LIKE BUT ARDUINO WILL NOT BE READING IT AT ALL)

//ONLY THING YOU NEED IS DEAD MAN SWITCH TO DIGITAL PIN 9 (+5V TO PIN 9 WHEN SWITCH PRESSED, PULL DOWN RESISTOR FROM PIN 9 TO GND KEEPS IT AT 0V OTHERWISE)


//J. Dingley March 1 2011 For Arduino 328 Duemalinove or similar with a 3.3V accessory power output
//i.e. the current standard Arduino board.


#include


//******************** IMPORTANT ***************************
//Set dip switches on the Sabertooth for simplified serial and 9600 Buadrate. Diagram of this on my Instructables page//
//i.e. DIP switches 1, 3, 5 and 6 set to ON, the remainder set to OFF
//******************** IMPORTANT ***************************


//Digital pin 13 is serial transmit pin to sabertooth
#define SABER_TX_PIN 13
//Not used but still initialised, Digital pin 12 is serial receive from Sabertooth
#define SABER_RX_PIN 12

//set baudrate to match sabertooth dip settings
#define SABER_BAUDRATE 9600

//simplifierd serial limits for each motor
#define SABER_MOTOR1_FULL_FORWARD 127
#define SABER_MOTOR1_FULL_REVERSE 1

#define SABER_MOTOR2_FULL_FORWARD 255
#define SABER_MOTOR2_FULL_REVERSE 128

//motor level to send when issuing full stop command
#define SABER_ALL_STOP 0


SoftwareSerial SaberSerial = SoftwareSerial (SABER_RX_PIN, SABER_TX_PIN );

void initSabertooth (void) {
//initialise software to communicate with sabertooth
pinMode ( SABER_TX_PIN, OUTPUT );


SaberSerial.begin( SABER_BAUDRATE );
//2 sec delay to let it settle
delay (2000);
SaberSerial.print(0, BYTE); //kill motors when first switched on
}


float level = 0;

int u;

//float k1;
//int k2;
//int k3;
int k4;


signed char Motor1percent;
signed char Motor2percent;


//DIGITAL INPUT
int deadmanbuttonPin = 9; // deadman button is digital input pin 9


void setup() // run once, when the sketch starts
{
initSabertooth( );
//analogINPUTS

//digital inputs
pinMode(deadmanbuttonPin, INPUT);




Serial.begin(9600); // HARD wired Serial feedback to PC for debugging in Wiring


}


void sample_inputs() {



k4 = digitalRead(deadmanbuttonPin); //this is needed - if you let go the motors both stop for your own safety



}

void set_motor() {
unsigned char cSpeedVal_Motor1 = 0;
unsigned char cSpeedVal_Motor2 = 0;


//set motors using the simplified serial Sabertooth protocol (same for smaller 2 x 5 Watt Sabertooth by the way)

Motor1percent = (signed char) level;
Motor2percent = (signed char) level;


Serial.print("level ");
Serial.println(level);


if (Motor1percent > 100) Motor1percent = 100;
if (Motor1percent < -100) Motor1percent = -100;
if (Motor2percent > 100) Motor2percent = 100;
if (Motor2percent < -100) Motor2percent = -100;

//if not pressing deadman button on hand controller - cut everything
if (k4 < 1) {
level = 0;

Motor1percent = 0;
Motor2percent = 0;
Serial.println("Pressing Dead Man Button");
delay(1000);
}

cSpeedVal_Motor1 = map (Motor1percent,
-100,
100,
SABER_MOTOR1_FULL_REVERSE,
SABER_MOTOR1_FULL_FORWARD);

cSpeedVal_Motor2 = map (Motor2percent,
-100,
100,
SABER_MOTOR2_FULL_REVERSE,
SABER_MOTOR2_FULL_FORWARD);

SaberSerial.print (cSpeedVal_Motor1, BYTE);
SaberSerial.print (cSpeedVal_Motor2, BYTE);

/*
//debugging
Serial.print("Motor1percent = ");
Serial.print(Motor1percent);
Serial.print (" level = ");
Serial.println (level);

Serial.print("Motor2percent = ");
Serial.println(Motor2percent);
Serial.print("cSpeedVal_Motor1 = ");
Serial.println(cSpeedVal_Motor1);
Serial.print("cSpeedVal_Motor2 = ");
Serial.println(cSpeedVal_Motor2);
*/
delay(5000); //5 second delay

}

void loop () {



for (u=0; u<5; u++) {

level= u * 10; //level = 0 then 10, then 20 until it gets to 50% of max motor power. each set motor routine has 5 sec delay at end of it
sample_inputs(); //check the dead man button still pressed in
set_motor();

}


for (u=0; u<5; u++) {

level= (5- u) * 10; //level = 50 then 40, then 30 then 20 until it gets to 0% of max motor power. each set motor routine has 5 sec delay at end of it
sample_inputs();//check the dead man button still pressed in
set_motor();

}



}
That line #include should have software serial after it.
organs (author)  steveastrouk5 years ago
My code now says:
#include

It does not verify with that line either. Maybe I have the line above incorrect?

Can you download the code from the link: https://www.instructables.com/id/SITWAY/step7/MOTOR-TEST/ and tell if it verifies for you? It still comes up with the BYTE not supported error for me.

I don't want to keep bothering you, so feel free to tell me if you need to go back to your own work. I do appreciate the help.
Thanks,
Charlie
AH, yes, the < signs are symbols recognised as HTML.....

Yes, I can compile it with no problems.
organs (author)  steveastrouk5 years ago
Thanks, Steve.
You clearly have the magic. I just cannot get the program to work. Thanks so much for taking so much time with me.

My replacement power supply should be in soon, for my other computer so will just try then. I copy and paste and still get the byte is no longer supported message. My #include has the softserial command as stated, so it must be something else....probably my computer.

Thanks again, for trying for me.
Charlie
Which Arduino version are you using

Steve
organs (author)  steveastrouk5 years ago
Hi Steve,
I have not replied sooner because I had to wait for my computer power supply. I installed a rebuilt power supply on my iMac G5 (OSX 1.5.8) and now the code verifies.

It would not verify on my wife's MacBook Pro (OSX 10.6.3) which is what I was using while my power supply was being rebuilt. The arduino samples in their sketches worked, but anything I downloaded would not work. I don't know why, but now it works. I can only think that it must have something to do with my wife's computer operating system. It works on my old one, but not on her new one.

My Arduino is the UNO 328 chip.

I appreciate all your help. I did not think the change of computers would make a difference, especially since my wife's is newer, and she says it is "wiser." It's great to know there are folks like you who are willing to help.

My electronics are all done and working...just looking for a wheelchair to scrounge for motors.
Thanks again,
Charlie
organs (author)  steveastrouk5 years ago
Actually, I mistyped my last reply.
The line is in the Arduino sketch with SoftwareSerial.h after the #include.
SoftwareSerial.h is enclosed in <>

Don't know if that helps.
It just won't cut and paste in this comment thread.
Charlie
organs (author)  steveastrouk5 years ago
Interesting,
I just sent a reply about including SoftSerial.h in <> after #include. It copied to the message back to you, but now that I see it in the message stream, the SoftSerial.h after #include does not show up.
Maybe it is something with my computer that the line cannot cut and paste? The line does not show up complete on the Arduino sketch.
A mystery,
Charlie