v2.9
This commit is contained in:
@ -16,3 +16,4 @@ lib_deps =
|
||||
adafruit/Adafruit MLX90614 Library@^2.1.3
|
||||
sparkfun/SparkFun u-blox Arduino Library@^1.8.11
|
||||
monitor_speed = 38400
|
||||
|
||||
|
@ -10,7 +10,7 @@ SFE_UBLOX_GPS myGPS;
|
||||
//== CHANGE THIS ============
|
||||
double new_emissivity =0.95;
|
||||
//===========================
|
||||
|
||||
#include <Wire.h>
|
||||
Adafruit_MLX90614 mlx = Adafruit_MLX90614();
|
||||
u_char ret[17];
|
||||
#define MYPORT_TX 14
|
||||
@ -57,6 +57,13 @@ void getWehter()
|
||||
}
|
||||
void getYuliang()
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
while (myPort.read()!=-1);
|
||||
myPort.write(yuliang,8);
|
||||
delay(90);
|
||||
@ -100,12 +107,51 @@ void claeryuliang(){
|
||||
Serial.print("OK");
|
||||
}
|
||||
TwoWire wireme;
|
||||
void onRequest() {
|
||||
//Wire.print(i++)
|
||||
Serial.println("onRequest");;
|
||||
Wire.print(" Packets.");
|
||||
|
||||
}
|
||||
|
||||
void onReceive(int len) {
|
||||
Serial.printf("onReceive[%d]: ", len);
|
||||
while (Wire.available()) {
|
||||
Serial.write(Wire.read());
|
||||
}
|
||||
Serial.println();
|
||||
}
|
||||
|
||||
|
||||
void onReceive111(size_t len) {
|
||||
Serial.printf("onReceive[%d]: ");
|
||||
while (Wire.available()) {
|
||||
Serial.write(Wire.read());
|
||||
}
|
||||
Serial.println();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void setup() {
|
||||
// put your setup code here, to run once:
|
||||
//Wire.begin(4,5);
|
||||
Wire.begin(4,5);
|
||||
|
||||
Serial.begin(38400);
|
||||
Serial.begin(115200);
|
||||
Serial.println("init ok");
|
||||
|
||||
//Wire.pins(D1,D2);
|
||||
Wire.setClock(100000);
|
||||
Wire.begin(4,5,0x42);
|
||||
Wire.onReceive(onReceive111);
|
||||
Wire.onRequest(onRequest);
|
||||
return;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
myPort.begin(9600, SWSERIAL_8N1, MYPORT_RX, MYPORT_TX, false);
|
||||
pinMode(16,OUTPUT);
|
||||
digitalWrite(16,LOW);
|
||||
@ -176,6 +222,9 @@ String gettodvalue(int a)
|
||||
|
||||
}
|
||||
void loop() {
|
||||
Serial.println("loop");
|
||||
delay(200);
|
||||
return;
|
||||
if(Serial.available())
|
||||
{
|
||||
String str=Serial.readStringUntil('#');
|
||||
|
Reference in New Issue
Block a user