hmi
This commit is contained in:
@ -11,6 +11,8 @@
|
|||||||
|
|
||||||
#include "hmi.h"
|
#include "hmi.h"
|
||||||
#include "pwm.h"
|
#include "pwm.h"
|
||||||
|
#include "mySpi.h"
|
||||||
|
#include "display.h"
|
||||||
|
|
||||||
|
|
||||||
class SwitchPort2 {
|
class SwitchPort2 {
|
||||||
@ -65,6 +67,8 @@ SwitchPort2 switch2 = SwitchPort2(BIT1);
|
|||||||
SwitchPort2 switch3 = SwitchPort2(BIT2);
|
SwitchPort2 switch3 = SwitchPort2(BIT2);
|
||||||
|
|
||||||
void hmiInit() {
|
void hmiInit() {
|
||||||
|
spiInit();
|
||||||
|
dispInit();
|
||||||
}
|
}
|
||||||
|
|
||||||
void hmiExec() {
|
void hmiExec() {
|
||||||
@ -77,4 +81,7 @@ void hmiExec() {
|
|||||||
if (switch3.get()) {
|
if (switch3.get()) {
|
||||||
setUDes(getUDes() + 1.0);
|
setUDes(getUDes() + 1.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dispSetFloat(0, getUDes());
|
||||||
|
dispSetFloat(1, getUCur());
|
||||||
}
|
}
|
||||||
|
20
src/main.cpp
20
src/main.cpp
@ -11,8 +11,6 @@
|
|||||||
|
|
||||||
#include "pwm.h"
|
#include "pwm.h"
|
||||||
#include "hmi.h"
|
#include "hmi.h"
|
||||||
#include "mySpi.h"
|
|
||||||
#include "display.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -30,26 +28,14 @@ void init() {
|
|||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
init();
|
init();
|
||||||
//pwmInit();
|
pwmInit();
|
||||||
//hmiInit();
|
hmiInit();
|
||||||
spiInit();
|
|
||||||
dispInit();
|
|
||||||
|
|
||||||
dispSetFloat(0, -12.99);
|
|
||||||
dispSetFloat(1, 990.99);
|
|
||||||
|
|
||||||
__enable_interrupt();
|
__enable_interrupt();
|
||||||
|
|
||||||
uint32_t c = 0;
|
|
||||||
uint16_t d = 0;
|
|
||||||
while (1) {
|
while (1) {
|
||||||
// hmiExec();
|
hmiExec();
|
||||||
c++;
|
|
||||||
if (c > 1000000) {
|
|
||||||
c = 0;
|
|
||||||
d++;
|
|
||||||
// dispSetDigit(0, 1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user