Hello from Russia

Post Reply
alex9x
Posts: 3
Joined: Tue Oct 04, 2016 10:23 pm

Hello from Russia

Post by alex9x » Sun Oct 22, 2017 11:39 am

Hello from Russia!
I start my first projects with micro controllers in 1997 with Microchips.
Last automation projects was build with MikroE products, but now I trying to use arduino platform.
By now I`m working with F103 family and faced with hardwire problems. Need help with it.

In a two words - it works fine if make Hardwire declaration in main .ino file before setup(), but failed if move to library and make Hardwire declaration in function with passed to function port. Need to use I2C1 and I2C2 depends on function parameter, for example:

Code: Select all

void Scan_I2C(int port) {
  HardWire HWire(port, I2C_FAST_MODE);
  HWire.begin();
........
  HWire.end();
}
Any help are welcome!

1.jpg
1.jpg (151.44 KiB) Viewed 90 times

Post Reply