Etienne Landon před 8 roky
rodič
revize
cb534b1597
4 změnil soubory, kde provedl 20 přidání a 12 odebrání
  1. 18 10
      AD5242.h
  2. 1 1
      osc.h
  3. 1 1
      tens_esp.ino
  4. 0 0
      test

+ 18 - 10
AD5242.h

@@ -19,16 +19,24 @@ byte potAdress[4][2] = { {AD_adress1, AD_pot1},
 
 void setup_AD5242() {
   Wire.begin(); // join i2c bus (address optional for master)
-  Serial.println("starting digipots");
-  Serial.println(AD_adress1); 
-  Serial.println(AD_pot1);
-  Serial.println(potAdress[0][0]);
-  for (int i ; i<4 ; i++) {
-    for (int j ; j<2 ; j++){
-      Serial.print (potAdress[i][j], HEX);
-      Serial.print ("-");
+  Serial.println("starting potentiometers");
+//  Serial.println(AD_adress1); 
+//  Serial.println(AD_pot1);
+//  Serial.println(potAdress[0][0]);
+//  for (int i ; i<4 ; i++) {
+//    for (int j ; j<2 ; j++){
+//      Serial.print (potAdress[i][j], HEX);
+//      Serial.print ("-");
+//    }
+//  }
+//Set potentiometers to 0
+  for (int pot ; pot<4 ; pot++){
+      Wire.beginTransmission(potAdress[pot][0]);
+      Wire.write(potAdress[pot][1]);
+      Wire.write(potValue[pot]); 
+      Wire.endTransmission();
     }
-  }
+  
 }
 
 void handle_AD5242() {
@@ -43,7 +51,7 @@ void handle_AD5242() {
       Wire.write(potAdress[pot][1]);
       Wire.write(potValue[pot]); 
       Wire.endTransmission();
-      Serial.println("updated");
+      //Serial.println("updated");
       
     }
   }

+ 1 - 1
osc.h

@@ -63,7 +63,7 @@ void setup_OSC(){
 //  OSCmsg.send(UDP); // send the bytes to the SLIP stream
 //  UDP.endPacket(); // mark the end of the OSC Packet
 //  OSCmsg.empty(); // free space occupied by message
-  sendOSC("/connected", 1);
+  sendOSC("/connected", ESP_NAME);
 }
 
 void handle_OSC() {

+ 1 - 1
tens_esp.ino

@@ -25,8 +25,8 @@ void setup ( ) {
   Serial.println("Starting ESP8266");
   
   setupLeds();
-  setupWifi(); 
   setup_AD5242() ;
+  setupWifi(); 
   setup_OSC() ;
   //setupOTA();
   

+ 0 - 0
test