'cli() wasn't declared in this scope' Problem

I’m trying to run this code below and I got the

C:\Program Files (x86)\Arduino\libraries\SoftwareSerial\SoftwareSerial.cpp:502:7: error: 'cli' was not declared in this scope

error

Board: Arduino Due
IDE: 1.6.7

unsigned char 
#include <SoftwareSerial.h>





SoftwareSerial BT(10, 11); //TX, RX respetively
String readvoice;

void setup() {
 BT.begin(9600);
 Serial.begin(9600);
  pinMode(3, OUTPUT);
  pinMode(4, OUTPUT);
  pinMode(5, OUTPUT);
  pinMode(6, OUTPUT);

}
//-----------------------------------------------------------------------// 
void loop() {
  while (BT.available()){  //Check if there is an available byte to read
  delay(10); //Delay added to make thing stable
  char c = BT.read(); //Conduct a serial read
  readvoice += c; //build the string- "forward", "reverse", "left" and "right"
  } 
  if (readvoice.length() > 0) {
    Serial.println(readvoice);

  if(readvoice == "forward")
  {
    digitalWrite(3, HIGH);
    digitalWrite (4, HIGH);
    digitalWrite(5,LOW);
    digitalWrite(6,LOW);
    delay(100);
  }

  else if(readvoice == "reverse")
  {
    digitalWrite(3, LOW);
    digitalWrite(4, LOW);
    digitalWrite(5, HIGH);
    digitalWrite(6,HIGH);
    delay(100);
  }

  else if (readvoice == "right")
  {
    digitalWrite (3,HIGH);
    digitalWrite (4,LOW);
    digitalWrite (5,LOW);
    digitalWrite (6,LOW);
    delay (100);
  
  }

 else if ( readvoice == "left")
 {
   digitalWrite (3, LOW);
   digitalWrite (4, HIGH);
   digitalWrite (5, LOW);
   digitalWrite (6, LOW);
   delay (100);
 }

 else if (readvoice == "stop")
 {
   digitalWrite (3, LOW);
   digitalWrite (4, LOW);
   digitalWrite (5, LOW);
   digitalWrite (6, LOW);
   delay (100);
 }
readvoice="";}} //Reset the variable

Any ideas? I did see that I should use the atomic.h library, but I didn’t really understand how to do that because I’m … a newbie.

  1. You are in the wrong forum you should have posed in the Due forum.

  2. Software serial does not work of the Due 0 there may be an equivalentt but it should have a different name.

cli()/sei() are instructions for the chip (an AVR) used in the Uno/Mega. The Due uses a totally different chip!

Mark

I had no idea there was a Due forum

Then how should I go about it?

Then how should I go about it?

That depends entirely on what "it" is that you want to go about.

Then how should I go about it?

Just wait your post will be moved for you by the mod's.

In the mean tine just use interrupts() and nointerrupts()

Mark

Thanks a lot…
No need to be rude about it :confused:

By PaulS' standards, that was a particularly polite message. He really is ready and willing to help you with whatever problem you have, so long as you describe what the problem is in a little more detail.

Or any of the other regulars can help too. I believe Paul is human and does need to sleep.

ROFL

Mark