| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -20,18 +20,18 @@ void draw() { | |||
| 20 | 20 | void setHeadingMode() { | |
| 21 | 21 | i2c.beginTransmission(0x21); | |
| 22 | 22 | // command byte for writing to EEPROM | |
| 23 | - i2c.write((byte) 0x77); | ||
| 23 | + i2c.write(0x77); | ||
| 24 | 24 | // address of the output data control byte | |
| 25 | - i2c.write((byte) 0x4e); | ||
| 25 | + i2c.write(0x4e); | ||
| 26 | 26 | // give us the plain heading | |
| 27 | - i2c.write((byte) 0x00); | ||
| 27 | + i2c.write(0x00); | ||
| 28 | 28 | i2c.endTransmission(); | |
| 29 | 29 | } | |
| 30 | 30 | ||
| 31 | 31 | float getHeading() { | |
| 32 | 32 | i2c.beginTransmission(0x21); | |
| 33 | 33 | // command byte for reading the data | |
| 34 | - i2c.write((byte) 0x41); | ||
| 34 | + i2c.write(0x41); | ||
| 35 | 35 | byte[] in = i2c.read(2); | |
| 36 | 36 | i2c.endTransmission(); | |
| 37 | 37 | // put bytes together to tenth of degrees | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -21,7 +21,7 @@ void setAnalog(float fac) { | |||
| 21 | 21 | // convert to 12 bit value | |
| 22 | 22 | int val = int(4095 * fac); | |
| 23 | 23 | i2c.beginTransmission(0x60); | |
| 24 | - i2c.write((byte) (val >> 8)); | ||
| 25 | - i2c.write((byte) (val & 255)); | ||
| 24 | + i2c.write(val >> 8); | ||
| 25 | + i2c.write(val & 255); | ||
| 26 | 26 | i2c.endTransmission(); | |
| 27 | 27 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -20,8 +20,8 @@ class MCP4725 extends I2C { | |||
| 20 | 20 | // convert to 12 bit value | |
| 21 | 21 | int val = int(4095 * fac); | |
| 22 | 22 | beginTransmission(address); | |
| 23 | - write((byte) (val >> 8)); | ||
| 24 | - write((byte) (val & 255)); | ||
| 23 | + write(val >> 8); | ||
| 24 | + write(val & 255); | ||
| 25 | 25 | endTransmission(); | |
| 26 | 26 | } | |
| 27 | 27 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments