Pith - arduino_splash_guard
arduino_splash_guard/arduino_splash_guard.ino [1.0 kb]
Modified: 18:16:36 58 026 (16 May 026)
105 Days Ago
// sink splash riser
// vgmlr
#include "VarSpeedServo.h"
VarSpeedServo lservo;
VarSpeedServo rservo;
const int left = 5;
const int right = 6;
const int sensor = A0;
const int lup = 8;
const int ldown = 82;
const int rup = 7;
const int rdown = 77;
const int sup = 10;
int water;
int more;
void setup() {
  lservo.attach(left);
  lservo.write(ldown,150,true);
  lservo.detach();
  rservo.attach(right);
  rservo.write(rdown,150,true);
  rservo.detach();
}
void loop() {
  more = 1;
  water = analogRead(sensor);
  if (water >= sup) {
      lservo.attach(left);
      rservo.attach(right);
      delay(1);
      lservo.write(lup,20,false);
      rservo.write(rup,200,true);
      while (more > 0) {
        more = 0;
        for (int x = 0; x < 100; x++) {
          water = analogRead(sensor);
          more = more + water;
        }
        more = more / 100;
      }
      lservo.write(ldown,100,false);
      rservo.write(rdown,100,true);
      delay(10);
      lservo.detach();
      rservo.detach();
  }
}
Updates
Stave - Android 158.026
Kerf - Android 157.026
Kiln - Android 157.026
Wedge - Android 156.026
Whittle - Linux 155.026

Menu
Calendar
Project Tin (024/029)
Miter
RSS Feed
User Avatar
@vgmlr
=SUM(parts)
0.00172
260,417 (+831)