Pith - arduino_splash_guard
arduino_splash_guard/arduino_splash_guard.ino [1.0 kb]
Modified: 18:16:36 58 026 (16 May 026)
14 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
Shim - Android 70.026.1
Wedge - Linux 68.026.1
Wedge - Android 68.026.1
Taper - Linux 64.026.1
Ayh Extension - Chrome 63.026.1
Dev
TVShow (227) 'CSA'
TVShow (228) 'APT'
TVProgram (83) 'BXT'
Miter Update(s)
Shim (Dictation)

Menu
Calendar
Project Tin (024/029)
Miter
RSS Feed
User Avatar
@vgmlr
=SUM(parts)