Browse Source

add FSM3.0 src code not impl yet, add header guards and format main

tags/v1.0.0
Simon Schmidt 3 years ago
parent
commit
5986beb10c
5 changed files with 24 additions and 24 deletions
  1. 8
    8
      data/index.html
  2. 4
    2
      lib/httpserver/httpserver.h
  3. 5
    2
      lib/treppe/treppe.h
  4. 1
    1
      scripts/gdboptions
  5. 6
    11
      src/main.cpp

+ 8
- 8
data/index.html View File



<div class="param_block"> <div class="param_block">
Time per stair: <output id="out_tim_sta" class="val_range">50</output> % Time per stair: <output id="out_tim_sta" class="val_range">50</output> %
<div class="slider"> <div class="slider">
<input type="range" class="regler" id="range_tim_sta" min="0" max="100" value="50"> <input type="range" class="regler" id="range_tim_sta" min="0" max="100" value="50">
</div> </div>
<div class="slider"> <div class="slider">
<input type="range" class="regler" id="range_tim_on" min="0" max="100" value="50"> <input type="range" class="regler" id="range_tim_on" min="0" max="100" value="50">
</div> </div>
</div> </div>






<div class="terminal">
<input type="button" id="clear_term" value="clear" onclick="clearTerminal();">
<input type="checkbox" id="scroll" name="scroll" value="scroll" checked>
<label for="scroll"> autoscroll </label>
<textarea id="term">waiting for log messages ...&#10;</textarea>
<div class="terminal">
<input type="button" id="clear_term" value="clear" onclick="clearTerminal();">
<input type="checkbox" id="scroll" name="scroll" value="scroll" checked>
<label for="scroll"> autoscroll </label>
<textarea id="term">waiting for log messages ...&#10;</textarea>
</div> </div>


</body> </body>


<script src="/input.js"></script>
<script src="/input.js"></script>


</html> </html>

+ 4
- 2
lib/httpserver/httpserver.h View File

#ifndef __HTTPSERVER_H
#define __HTTPSERVER_H
// Wrapper for ESP8266WebServer with Filesystem as HTTP source // Wrapper for ESP8266WebServer with Filesystem as HTTP source


#pragma once

#include <ESP8266WebServer.h> #include <ESP8266WebServer.h>
#include <stdarg.h> #include <stdarg.h>
#include "filesys.h" #include "filesys.h"
void logf(const char *format, ...); void logf(const char *format, ...);
void logt(const char *format, ...); void logt(const char *format, ...);
}; };

#endif // __HTTPSERVER_H

+ 5
- 2
lib/treppe/treppe.h View File

#pragma once
#ifndef __TREPPE_H
#define __TREPPE_H


#include "FSMTreppe2/FSMTreppe2.h" #include "FSMTreppe2/FSMTreppe2.h"
#include "PCA9685.h" #include "PCA9685.h"
void activate_idle_pwm(bool active); void activate_idle_pwm(bool active);
void set_active_pwm(uint16_t _active_pwm); void set_active_pwm(uint16_t _active_pwm);
void set_time_per_stair(uint16_t _time_per_stair); void set_time_per_stair(uint16_t _time_per_stair);
};
};

#endif // __TREPPE_H

+ 1
- 1
scripts/gdboptions View File

set serial baud 460800 set serial baud 460800


file .pio/build/debug/firmware.elf file .pio/build/debug/firmware.elf
target remote /dev/ttyUSB0
target remote \\.\COM23
thb loop thb loop

+ 6
- 11
src/main.cpp View File



// BOARD // BOARD
#define ESP12_LED 2 #define ESP12_LED 2
#define NODEMCU_LED 16
// #define NODEMCU_LED 16


// PWM // PWM
#include "treppe.h" #include "treppe.h"
#else #else
Serial.begin(76800); Serial.begin(76800);
#endif #endif

Serial.println(F("Booting ...."));

//pinMode(NODEMCU_LED, OUTPUT);
Serial.println("Booting ....");
pinMode(ESP12_LED, OUTPUT); pinMode(ESP12_LED, OUTPUT);


Wire.begin(); // Wire must be started first Wire.begin(); // Wire must be started first
Wire.setClock(1000000); // Supported baud rates are 100kHz, 400kHz, and 1000kHz Wire.setClock(1000000); // Supported baud rates are 100kHz, 400kHz, and 1000kHz
stairs.setup();
Serial.println("PCA9685 connected !");
//attachInterrupt(digitalPinToInterrupt(2), int_test, RISING);
//attachInterrupt(digitalPinToInterrupt(12), int_test, RISING);


WiFi.mode(WIFI_STA); WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password); WiFi.begin(ssid, password);


httpServer.start(); httpServer.start();
httpServer.start_apps(); httpServer.start_apps();

Serial.println("HTTP server started !"); Serial.println("HTTP server started !");


stairs.setup();
Serial.println("PCA9685 connected !");
//attachInterrupt(digitalPinToInterrupt(2), int_test, RISING);
//attachInterrupt(digitalPinToInterrupt(12), int_test, RISING);

os_timer_setfn(&timer1, timerCallback, &timer_flag); os_timer_setfn(&timer1, timerCallback, &timer_flag);
os_timer_arm(&timer1, 20, true); os_timer_arm(&timer1, 20, true);
} }

Loading…
Cancel
Save