exit status 1 'Wire' does not name a type

Generic boards that are not Maple or Maple mini clones, and don't contain the additional USB reset hardware
Post Reply
dennyjim
Posts: 7
Joined: Tue Jan 09, 2018 1:18 pm

exit status 1 'Wire' does not name a type

Post by dennyjim » Tue Feb 06, 2018 1:56 pm

Can someone please help point me in the right direction

I get this error form the Wire library when i try to run YMFC-32_Flight_Controller_ver-1a



Code: Select all

YMFC-32_Flight_Controller_ver-1a:19: error: 'Wire' does not name a type

 Wire.h(2, I2C_FAST_MODE);          //Initiate I2C port 2 at 400kHz.

 ^

C:\Users\Jim\Documents\Arduino\YMFC-32_Flight_Controller_ver-1a\YMFC-32_Flight_Controller_ver-1a.ino: In function 'void setup()':

YMFC-32_Flight_Controller_ver-1a:119: error: 'HWire' was not declared in this scope

   HWire.begin();                                                //Start the I2C as master

   ^

C:\Users\Jim\Documents\Arduino\YMFC-32_Flight_Controller_ver-1a\gyro_setup.ino: In function 'void gyro_setup()':

gyro_setup:5: error: 'HWire' was not declared in this scope

   HWire.beginTransmission(gyro_address);                        //Start communication with the MPU-6050.

   ^

C:\Users\Jim\Documents\Arduino\YMFC-32_Flight_Controller_ver-1a\read_gyro_data.ino: In function 'void gyro_signalen()':

read_gyro_data:5: error: 'HWire' was not declared in this scope

   HWire.beginTransmission(gyro_address);                       //Start communication with the gyro.

   ^

Using library Wire in folder: C:\Users\Jim\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\Wire (legacy)
exit status 1
'Wire' does not name a type

stevestrong
Posts: 2043
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany
Contact:

Re: exit status 1 'Wire' does not name a type

Post by stevestrong » Tue Feb 06, 2018 2:00 pm

Please attach or point to some source code/sketch.

I think you have to use now TwoWire instead of HWire or Wire.

User avatar
mrburnette
Posts: 2190
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: exit status 1 'Wire' does not name a type

Post by mrburnette » Tue Feb 06, 2018 4:52 pm

The proper syntax is shown here:
viewtopic.php?f=51&t=3175#p40798

Post Reply