【项目】基于arduino的验光头盔-Arduino中文社区 - Powered by Discuz!

Arduino中文社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

12
返回列表 发新帖
楼主: 巨窝

[项目] 【项目】基于arduino的验光头盔

[复制链接]
发表于 2017-10-29 12:17 | 显示全部楼层
液体透镜,看到就感觉到做的时候背后经历了多少曲折。。。
发表于 2017-10-29 12:17 | 显示全部楼层
这个实在是太牛了,支持~
发表于 2017-11-4 14:37 | 显示全部楼层
大工程,实在厉害
发表于 2017-11-17 20:44 | 显示全部楼层
强无敌,真是sixsixsix
 楼主| 发表于 2017-11-20 15:34 | 显示全部楼层
头盔程序。控制l298n的,用在MSP上,可以给arduino移植,改针脚就可以

#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);
}

 楼主| 发表于 2017-11-20 15:48 | 显示全部楼层
收到短袖一件。。
长沙已经冬天冻成狗就不穿出来了。
IMG_20171114_145052.jpg
发表于 2017-12-26 11:38 | 显示全部楼层
看上去就高大上啊
发表于 2018-3-24 21:49 | 显示全部楼层
巨窝 发表于 2017-3-31 19:39
经过一系列冗长乏味的修改,做了一个贴合头部的模型。然而小了。继续修改。

强强强的牛逼人物的厉害作品。
发表于 2018-4-8 23:57 | 显示全部楼层
学习了 看着好厉害。
发表于 2018-4-10 19:33 | 显示全部楼层
这个真的很牛
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|Archiver|手机版|Arduino中文社区

GMT+8, 2024-9-20 22:57 , Processed in 0.074945 second(s), 15 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表