   pinMode(12,OUTPUT);
   pinMode(11,OUTPUT);
   Wire.begin(2);
+  Wire.onReceive(receiveEvent);
   Serial.begin(9600);
+  pinMode(13, OUTPUT);
 } 
  void Errorcalc()
  {

 }
void loop() 
{
  
  Serial.println(angle);  
  
                 Errorcalc();
                if (abs(Error) <.8){ // prevent integral 'windup'

#include <Wire.h>


double potcurval;    // variable to read the value from the analog pin 

double angle =0;

double curangle,kP=28.00,kI=42,kD=4,Last=0;
