Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 1:a04fadd675dc, committed 2017-09-27
- Comitter:
- uru
- Date:
- Wed Sep 27 10:10:41 2017 +0000
- Parent:
- 0:31ce4ad8c8f6
- Commit message:
- oobobobobobobob
Changed in this revision
| solenoid.cpp | Show annotated file Show diff for this revision Revisions of this file |
| solenoid.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/solenoid.cpp Fri Sep 08 06:58:17 2017 +0000
+++ b/solenoid.cpp Wed Sep 27 10:10:41 2017 +0000
@@ -1,13 +1,9 @@
#include "solenoid.h"
void solenoid::output()
{
- i2c.write(adr<<1,&PORT,1);
+ i2c->write(adr<<1,&PORT,1);
}
-solenoid::solenoid(PinName sda,PinName scl,char adr_):i2c(sda,scl)
-{
- adr=adr_;
-}
-solenoid::solenoid(I2C& I2c,char adr_):i2c(I2c)
+solenoid::solenoid(I2C *I2c,char adr_):i2c(I2c)
{
adr=adr_;
}
--- a/solenoid.h Fri Sep 08 06:58:17 2017 +0000
+++ b/solenoid.h Wed Sep 27 10:10:41 2017 +0000
@@ -3,13 +3,12 @@
#include "mbed.h"
class solenoid{
private:
- I2C i2c;
+ I2C *i2c;
char adr;
char PORT;
void output();
public:
- solenoid(PinName sda,PinName scl,char adr_);
- solenoid(I2C& I2c,char adr_);
+ solenoid(I2C *I2c,char adr_);
solenoid& operator=(char po);
void Port(char port,char po);
};