File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
java/libraries/io/examples Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -7,13 +7,13 @@ class MCP3001 extends SPI {
77
88 MCP3001 (String dev) {
99 super (dev);
10- super . settings(500000 , SPI. MSBFIRST , SPI. MODE0 );
10+ settings(500000 , SPI. MSBFIRST , SPI. MODE0 );
1111 }
1212
1313 float getAnalog() {
1414 // dummy write, actual values don't matter
1515 byte [] out = { 0 , 0 };
16- byte [] in = super . transfer(out);
16+ byte [] in = transfer(out);
1717 // some input bit shifting according to the datasheet p. 16
1818 int val = ((in[0 ] & 0x1f ) << 5 ) | ((in[1 ] & 0xf8 ) >> 3 );
1919 // val is between 0 and 1023
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ class MCP3008 extends SPI {
88
99 MCP3008 (String dev) {
1010 super (dev);
11- super . settings(500000 , SPI. MSBFIRST , SPI. MODE0 );
11+ settings(500000 , SPI. MSBFIRST , SPI. MODE0 );
1212 }
1313
1414 float getAnalog(int channel) {
@@ -19,7 +19,7 @@ class MCP3008 extends SPI {
1919 byte [] out = { 0 , 0 , 0 };
2020 // encode the channel number in the first byte
2121 out[0 ] = (byte )(0x18 | channel);
22- byte [] in = super . transfer(out);
22+ byte [] in = transfer(out);
2323 int val = ((in[1 ] & 0x03 ) << 8 ) | (in[2 ] & 0xff );
2424 // val is between 0 and 1023
2525 return val/ 1023.0 ;
You can’t perform that action at this time.
0 commit comments