#include<SoftwareSerial.h>#define input112#define input2 13 #define input3 14#define input4 19 int a ;int b;//int c;//int en=39;int p;int A;int B;int R;int sensorValue;SoftwareSerialmySerial(P2_1, P2_2); // RX, TX void setup() { mySerial.begin(9600);Serial.begin(9600); pinMode(input1,OUTPUT);pinMode(input2,OUTPUT);pinMode(input3,OUTPUT);pinMode(input4,OUTPUT);} void loop() { if (Serial.available() > 0) { p = Serial.parseInt(); while (Serial.read() == 'X') { if(p<5000) { int i=1;} else {if (p<11000) {B=p-10000; mySerial.println(A); } else { A=p-20000} } } } int pos = analogRead(A0);mySerial.print("A"); mySerial.println(A);a=A-pos; mySerial.print("a"); mySerial.println(a); if(a>15){ analogWrite(input1, 255); analogWrite(input2, 0);}else {if(a<-15){ analogWrite(input1, 0); analogWrite(input2, 255); } else { analogWrite(input1, 0); analogWrite(input2,0); } } int pos2 = analogRead(A3); b=B-pos2; if(b>12){ analogWrite(input3, 255); analogWrite(input4, 0); } else { if (b<-12) { analogWrite(input3, 0); analogWrite(input4, 255); } else { analogWrite(input3, 0); analogWrite(input4,0); } } sensorValue = analogRead(A5); sensorValue=map(sensorValue,30,250,45,75); sensorValue=-sensorValue*sensorValue*0.001746+0.3784*sensorValue+51.35; sensorValue=sensorValue+10000; Serial.print( sensorValue); Serial.print("F"); delay(100);}
收到短袖一件。。
长沙已经冬天冻成狗就不穿出来了。
看上去就高大上啊:lol 巨窝 发表于 2017-3-31 19:39
经过一系列冗长乏味的修改,做了一个贴合头部的模型。然而小了。继续修改。
强强强的牛逼人物的厉害作品。 学习了 看着好厉害。 这个真的很牛
页:
1
[2]