diff options
author | Federico Fissore <f.fissore@arduino.cc> | 2015-07-06 15:18:33 +0200 |
---|---|---|
committer | Federico Fissore <f.fissore@arduino.cc> | 2015-07-06 15:19:05 +0200 |
commit | b5a130afb51c971fd7ceca8834b6055f1eada253 (patch) | |
tree | d1e964f67822e9b3f10382573a9579c85b9c3e3f /libraries/Wire/examples/digital_potentiometer/digital_potentiometer.ino | |
parent | c13cf02651e178ea7941a82bee364d82c6b19b9c (diff) |
Examples: mass code format. See example_formatter.conf
Diffstat (limited to 'libraries/Wire/examples/digital_potentiometer/digital_potentiometer.ino')
-rw-r--r-- | libraries/Wire/examples/digital_potentiometer/digital_potentiometer.ino | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/libraries/Wire/examples/digital_potentiometer/digital_potentiometer.ino b/libraries/Wire/examples/digital_potentiometer/digital_potentiometer.ino index 4d1580a..5fb91fb 100644 --- a/libraries/Wire/examples/digital_potentiometer/digital_potentiometer.ino +++ b/libraries/Wire/examples/digital_potentiometer/digital_potentiometer.ino @@ -14,15 +14,13 @@ #include <Wire.h> -void setup() -{ +void setup() { Wire.begin(); // join i2c bus (address optional for master) } byte val = 0; -void loop() -{ +void loop() { Wire.beginTransmission(44); // transmit to device #44 (0x2c) // device address is specified in datasheet Wire.write(byte(0x00)); // sends instruction byte @@ -30,8 +28,7 @@ void loop() Wire.endTransmission(); // stop transmitting val++; // increment value - if (val == 64) // if reached 64th position (max) - { + if (val == 64) { // if reached 64th position (max) val = 0; // start over from lowest value } delay(500); |