Skip to main content
Arduino

Return to Question

Commonmark migration
Source Link

I keep receiving the following error in myATTiny85-Slave code below:

sketch_mar12a.ino: In function 'void setup()':

sketch_mar12a:19: error: 'class USI_TWI_S' has no member named 'onRequest'

I have downloaded TinyWireS and TinyWireS.h clearly has a public function onRequest. I opened the .ZIP file (downloaded from https://github.com/rambo/TinyWire) and drag-dropped TinyWireS folder into the Arduino libraries folder. This is how I install ALL libraries.

I am using Arduino 1.0.6

What am I doing wrong?

ATTiny85-Slave Code:

#include "TinyWireS.h" // wrapper class for I2C slave routines
#define I2C_SLAVE_ADDR 0x26 // i2c slave address (38)
byte t=10;
void setup()
{ 
 TinyWireS.begin(I2C_SLAVE_ADDR); // init I2C Slave mode
 TinyWireS.onRequest(requestEvent);
}
void loop()
{
}
void requestEvent()
{ 
 TinyWireS.send(t);
}

Arduino Uno-Master Code:

 #include <Wire.h>
 #define I2C_SLAVE_ADDR 0x26 // i2c slave address (38)
 void setup() 
 {
 Wire.begin();
 Serial.begin(9600);
 }
 void loop() 
 {
 byte num;
 // read 1 byte, from address 0x26
 Wire.requestFrom(I2C_SLAVE_ADDR, 1);
 while(Wire.available()) {
 num = Wire.read();
 }
 
 Serial.print("num = ");
 Serial.println(num,DEC);
 }

I keep receiving the following error in myATTiny85-Slave code below:

sketch_mar12a.ino: In function 'void setup()':

sketch_mar12a:19: error: 'class USI_TWI_S' has no member named 'onRequest'

I have downloaded TinyWireS and TinyWireS.h clearly has a public function onRequest. I opened the .ZIP file (downloaded from https://github.com/rambo/TinyWire) and drag-dropped TinyWireS folder into the Arduino libraries folder. This is how I install ALL libraries.

I am using Arduino 1.0.6

What am I doing wrong?

ATTiny85-Slave Code:

#include "TinyWireS.h" // wrapper class for I2C slave routines
#define I2C_SLAVE_ADDR 0x26 // i2c slave address (38)
byte t=10;
void setup()
{ 
 TinyWireS.begin(I2C_SLAVE_ADDR); // init I2C Slave mode
 TinyWireS.onRequest(requestEvent);
}
void loop()
{
}
void requestEvent()
{ 
 TinyWireS.send(t);
}

Arduino Uno-Master Code:

 #include <Wire.h>
 #define I2C_SLAVE_ADDR 0x26 // i2c slave address (38)
 void setup() 
 {
 Wire.begin();
 Serial.begin(9600);
 }
 void loop() 
 {
 byte num;
 // read 1 byte, from address 0x26
 Wire.requestFrom(I2C_SLAVE_ADDR, 1);
 while(Wire.available()) {
 num = Wire.read();
 }
 
 Serial.print("num = ");
 Serial.println(num,DEC);
 }

I keep receiving the following error in myATTiny85-Slave code below:

sketch_mar12a.ino: In function 'void setup()':

sketch_mar12a:19: error: 'class USI_TWI_S' has no member named 'onRequest'

I have downloaded TinyWireS and TinyWireS.h clearly has a public function onRequest. I opened the .ZIP file (downloaded from https://github.com/rambo/TinyWire) and drag-dropped TinyWireS folder into the Arduino libraries folder. This is how I install ALL libraries.

I am using Arduino 1.0.6

What am I doing wrong?

ATTiny85-Slave Code:

#include "TinyWireS.h" // wrapper class for I2C slave routines
#define I2C_SLAVE_ADDR 0x26 // i2c slave address (38)
byte t=10;
void setup()
{ 
 TinyWireS.begin(I2C_SLAVE_ADDR); // init I2C Slave mode
 TinyWireS.onRequest(requestEvent);
}
void loop()
{
}
void requestEvent()
{ 
 TinyWireS.send(t);
}

Arduino Uno-Master Code:

 #include <Wire.h>
 #define I2C_SLAVE_ADDR 0x26 // i2c slave address (38)
 void setup() 
 {
 Wire.begin();
 Serial.begin(9600);
 }
 void loop() 
 {
 byte num;
 // read 1 byte, from address 0x26
 Wire.requestFrom(I2C_SLAVE_ADDR, 1);
 while(Wire.available()) {
 num = Wire.read();
 }
 
 Serial.print("num = ");
 Serial.println(num,DEC);
 }
Tweeted twitter.com/StackArduino/status/700532402993684480
deleted 8 characters in body
Source Link
lucidgold
  • 233
  • 1
  • 3
  • 9

I keep receiving the following error in the ATTiny85myATTiny85-Slave Codecode below:

sketch_mar12a.ino: In function 'void setup()':

sketch_mar12a:19: error: 'class USI_TWI_S' has no member named 'onRequest'

I have downloaded TinyWireS from here TinyWireS and TinyWireS.h clearly has a public function onRequest. I opened the .ZIP file (downloaded from https://github.com/rambo/TinyWire) and drag-dropped TinyWireS folder into the Arduino libraries folder. This is how I install ALL libraries.

I am using Arduino 1.0.6

What am I doing wrong?

ATTiny85-Slave Code:

#include "TinyWireS.h" // wrapper class for I2C slave routines
#define I2C_SLAVE_ADDR 0x26 // i2c slave address (38)
byte t=10;
void setup()
{ 
 TinyWireS.begin(I2C_SLAVE_ADDR); // init I2C Slave mode
 TinyWireS.onRequest(requestEvent);
}
void loop()
{
}
void requestEvent()
{ 
 TinyWireS.send(t);
}

Arduino Uno-Master Code:

 #include <Wire.h>
 #define I2C_SLAVE_ADDR 0x26 // i2c slave address (38)
 void setup() 
 {
 Wire.begin();
 Serial.begin(9600);
 }
 void loop() 
 {
 byte num;
 // read 1 byte, from address 0x26
 Wire.requestFrom(I2C_SLAVE_ADDR, 1);
 while(Wire.available()) {
 num = Wire.read();
 }
 
 Serial.print("num = ");
 Serial.println(num,DEC);
 }

I keep receiving the following error in the ATTiny85-Slave Code:

sketch_mar12a.ino: In function 'void setup()':

sketch_mar12a:19: error: 'class USI_TWI_S' has no member named 'onRequest'

I have downloaded TinyWireS from here and TinyWireS.h clearly has a public function onRequest. I opened the .ZIP file (downloaded from https://github.com/rambo/TinyWire) and drag-dropped TinyWireS folder into the Arduino libraries folder. This is how I install ALL libraries.

I am using Arduino 1.0.6

What am I doing wrong?

ATTiny85-Slave Code:

#include "TinyWireS.h" // wrapper class for I2C slave routines
#define I2C_SLAVE_ADDR 0x26 // i2c slave address (38)
byte t=10;
void setup()
{ 
 TinyWireS.begin(I2C_SLAVE_ADDR); // init I2C Slave mode
 TinyWireS.onRequest(requestEvent);
}
void loop()
{
}
void requestEvent()
{ 
 TinyWireS.send(t);
}

Arduino Uno-Master Code:

 #include <Wire.h>
 #define I2C_SLAVE_ADDR 0x26 // i2c slave address (38)
 void setup() 
 {
 Wire.begin();
 Serial.begin(9600);
 }
 void loop() 
 {
 byte num;
 // read 1 byte, from address 0x26
 Wire.requestFrom(I2C_SLAVE_ADDR, 1);
 while(Wire.available()) {
 num = Wire.read();
 }
 
 Serial.print("num = ");
 Serial.println(num,DEC);
 }

I keep receiving the following error in myATTiny85-Slave code below:

sketch_mar12a.ino: In function 'void setup()':

sketch_mar12a:19: error: 'class USI_TWI_S' has no member named 'onRequest'

I have downloaded TinyWireS and TinyWireS.h clearly has a public function onRequest. I opened the .ZIP file (downloaded from https://github.com/rambo/TinyWire) and drag-dropped TinyWireS folder into the Arduino libraries folder. This is how I install ALL libraries.

I am using Arduino 1.0.6

What am I doing wrong?

ATTiny85-Slave Code:

#include "TinyWireS.h" // wrapper class for I2C slave routines
#define I2C_SLAVE_ADDR 0x26 // i2c slave address (38)
byte t=10;
void setup()
{ 
 TinyWireS.begin(I2C_SLAVE_ADDR); // init I2C Slave mode
 TinyWireS.onRequest(requestEvent);
}
void loop()
{
}
void requestEvent()
{ 
 TinyWireS.send(t);
}

Arduino Uno-Master Code:

 #include <Wire.h>
 #define I2C_SLAVE_ADDR 0x26 // i2c slave address (38)
 void setup() 
 {
 Wire.begin();
 Serial.begin(9600);
 }
 void loop() 
 {
 byte num;
 // read 1 byte, from address 0x26
 Wire.requestFrom(I2C_SLAVE_ADDR, 1);
 while(Wire.available()) {
 num = Wire.read();
 }
 
 Serial.print("num = ");
 Serial.println(num,DEC);
 }
added 216 characters in body
Source Link
lucidgold
  • 233
  • 1
  • 3
  • 9

I keep receiving the following error in the ATTiny85-Slave Code:

sketch_mar12a.ino: In function 'void setup()':

sketch_mar12a:19: error: 'class USI_TWI_S' has no member named 'onRequest'

I have downloaded TinyWireS from here and TinyWireS.h clearly has a public function onRequest. I opened the .ZIP file (downloaded from https://github.com/rambo/TinyWire ) and drag-dropped TinyWireS folder into the Arduino libraries folder. This is how I install ALL libraries.

I am using Arduino 1.0.6

What am I doing wrong?

ATTiny85-Slave Code:

#include "TinyWireS.h" // wrapper class for I2C slave routines
#define I2C_SLAVE_ADDR 0x26 // i2c slave address (38)
byte t=10;
void setup()
{ 
 TinyWireS.begin(I2C_SLAVE_ADDR); // init I2C Slave mode
 TinyWireS.onRequest(requestEvent);
}
void loop()
{
}
void requestEvent()
{ 
 TinyWireS.send(t);
}

Arduino Uno-Master Code:

 #include <Wire.h>
 #define I2C_SLAVE_ADDR 0x26 // i2c slave address (38)
 void setup() 
 {
 Wire.begin();
 Serial.begin(9600);
 }
 void loop() 
 {
 byte num;
 // read 1 byte, from address 0x26
 Wire.requestFrom(I2C_SLAVE_ADDR, 1);
 while(Wire.available()) {
 num = Wire.read();
 }
 
 Serial.print("num = ");
 Serial.println(num,DEC);
 }

I keep receiving the following error in the ATTiny85-Slave Code:

sketch_mar12a.ino: In function 'void setup()':

sketch_mar12a:19: error: 'class USI_TWI_S' has no member named 'onRequest'

I have downloaded TinyWireS from here and TinyWireS.h clearly has a public function onRequest. What am I doing wrong?

ATTiny85-Slave Code:

#include "TinyWireS.h" // wrapper class for I2C slave routines
#define I2C_SLAVE_ADDR 0x26 // i2c slave address (38)
byte t=10;
void setup()
{ 
 TinyWireS.begin(I2C_SLAVE_ADDR); // init I2C Slave mode
 TinyWireS.onRequest(requestEvent);
}
void loop()
{
}
void requestEvent()
{ 
 TinyWireS.send(t);
}

Arduino Uno-Master Code:

 #include <Wire.h>
 #define I2C_SLAVE_ADDR 0x26 // i2c slave address (38)
 void setup() 
 {
 Wire.begin();
 Serial.begin(9600);
 }
 void loop() 
 {
 byte num;
 // read 1 byte, from address 0x26
 Wire.requestFrom(I2C_SLAVE_ADDR, 1);
 while(Wire.available()) {
 num = Wire.read();
 }
 
 Serial.print("num = ");
 Serial.println(num,DEC);
 }

I keep receiving the following error in the ATTiny85-Slave Code:

sketch_mar12a.ino: In function 'void setup()':

sketch_mar12a:19: error: 'class USI_TWI_S' has no member named 'onRequest'

I have downloaded TinyWireS from here and TinyWireS.h clearly has a public function onRequest. I opened the .ZIP file (downloaded from https://github.com/rambo/TinyWire ) and drag-dropped TinyWireS folder into the Arduino libraries folder. This is how I install ALL libraries.

I am using Arduino 1.0.6

What am I doing wrong?

ATTiny85-Slave Code:

#include "TinyWireS.h" // wrapper class for I2C slave routines
#define I2C_SLAVE_ADDR 0x26 // i2c slave address (38)
byte t=10;
void setup()
{ 
 TinyWireS.begin(I2C_SLAVE_ADDR); // init I2C Slave mode
 TinyWireS.onRequest(requestEvent);
}
void loop()
{
}
void requestEvent()
{ 
 TinyWireS.send(t);
}

Arduino Uno-Master Code:

 #include <Wire.h>
 #define I2C_SLAVE_ADDR 0x26 // i2c slave address (38)
 void setup() 
 {
 Wire.begin();
 Serial.begin(9600);
 }
 void loop() 
 {
 byte num;
 // read 1 byte, from address 0x26
 Wire.requestFrom(I2C_SLAVE_ADDR, 1);
 while(Wire.available()) {
 num = Wire.read();
 }
 
 Serial.print("num = ");
 Serial.println(num,DEC);
 }
added 27 characters in body; edited title
Source Link
lucidgold
  • 233
  • 1
  • 3
  • 9
Loading
Source Link
lucidgold
  • 233
  • 1
  • 3
  • 9
Loading
lang-cpp

AltStyle によって変換されたページ (->オリジナル) /