Browse Source

Some adaptions for the experiments.

software_develop
Maximilian Stiefel 7 years ago
parent
commit
87ed214d6b
  1. 10
      software/app/application.cpp
  2. 1
      software/app/dac101c085.cpp
  3. 2
      software/include/defines.h
  4. 1
      software/include/hardware.h

10
software/app/application.cpp

@ -44,6 +44,10 @@ void updateSensorHub() {
hub.Update();
}
void updateRectangle(){
mylight.RectangleUpdate();
}
void ready() {
WifiAccessPoint.config("Sensus", "", AUTH_OPEN, false, 3);
hub.Start();
@ -92,10 +96,10 @@ void init() {
WifiEvents.onStationDisconnect(STADisconnect);
WifiEvents.onStationGotIP(STAGotIP);
cWebInterface::GetInstance()->StartServer();
procTimer.initializeMs(HUB_PERIOD, updateSensorHub).start();
mylight.SetCurrent(500);
mylight.SetCurrent(1000);
mylight.RectangleUpdate();
//rectangleTimer.initializeUs(RECT_PERIOD, updateRectangle).start();
procTimer.initializeMs(HUB_PERIOD, updateSensorHub).start();
}
void STADisconnect(String ssid, uint8_t ssid_len, uint8_t bssid[6], uint8_t reason) {

1
software/app/dac101c085.cpp

@ -80,7 +80,6 @@ uint8_t cDAC101C085::WriteSettings(uint16_t settings)
Wire.write( (uint8_t) (settings >> 8) ); // Most significant byte
Wire.write( (uint8_t) (settings & 0xFF) ); // Least significant byte
error = Wire.endTransmission();
Serial.println(settings);
return I2CError(error); // Pass to error parser
}

2
software/include/defines.h

@ -13,6 +13,6 @@
#include "hardware.h"
#define DEBUG_LEVEL 1
#define DEBUG_LEVEL 0
#endif /* APP_HARDWARE_H_ */

1
software/include/hardware.h

@ -25,6 +25,7 @@ static const uint16_t RESOLUTION_DAC = 1024;
static const int HUB_PERIOD = 5;
static const int ADC_TIMEBASE = 250;
static const int ADC_PERIOD = 5;
static const int RECT_PERIOD = 2500; // in us
#define LED_PIN 2 // GPIO2

Loading…
Cancel
Save