![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
aa
Diff: main.cpp
- Revision:
- 2:3459b9282009
- Parent:
- 1:fe3f80c4beeb
- Child:
- 3:be82925eced0
diff -r fe3f80c4beeb -r 3459b9282009 main.cpp --- a/main.cpp Wed Sep 18 00:22:34 2019 +0000 +++ b/main.cpp Fri Sep 20 02:43:33 2019 +0000 @@ -53,6 +53,8 @@ DigitalOut LED(LED3); +//pcとマイコンの通信設定[湯アートがマイコン] + //Serial uart(USBTX,USBRX); Serial uart(UARTTX,UARTRX); @@ -102,9 +104,10 @@ int main(void) { InitiaLize(); - oled.init(); - oled.setDispFlag(true,false,false); + //oled.init(); + //oled.setDispFlag(true,false,false); while(1) { + /* if(send[2]>250) { oled.locate(0,0); oled.printf("%d",send[2]-256); @@ -119,6 +122,7 @@ oled.locate(5,0); oled.printf("%2d",send[3]); } + */ LineDataRead(line,SENSORDATA_SIZE); SendDataMake(line,send); SendDataUpdate(send,SENDDATA_SIZE); @@ -128,7 +132,7 @@ void Transmit() { __disable_irq(); - //uart.printf("%d\n\r",RS485uart.GetData()); + // uart.printf("%d\n\r",RS485uart.GetData()); uart.putc(RS485uart.GetData()); __enable_irq(); @@ -200,7 +204,7 @@ void LineDataRead(bool sensorData[], int dataSize) { int pin; - int readData = 0; + float readData = 0; for(int i = 0; i < dataSize; i++) { pin = pinDef[i]; PinSelect(pin); @@ -211,7 +215,9 @@ } else if(pin<=47) { readData = y3.read(); } - if(readData < 0.8f) { + //uart.printf("%f\n\r",readData); + if(readData < 0.7f) { + sensorData[i] = 0; } else { sensorData[i] = 1;