本帖最后由 MOP 于 2017-9-20 17:44 编辑
因比賽關係採用部分開源,重要函式進行講解
Arduino C code
void detect()
{
// read the analog in value:
pos_bottom =0; // variable to store the servo position
pos_top =0 ; // variable to store the servo position
right = true;
double maxium=0;
myservo_top.write(45);
delay(20);
for(int i = 0; i <= 180; i += 15)
{
myservo_bottom.write(i);
delay(20);
get_value();
if(maxium 本帖最后由 MOP 于 2017-9-20 17:44 编辑
因比賽關係採用部分開源,重要函式進行講解
Arduino C code
void detect()
{
// read the analog in value:
pos_bottom =0; // variable to store the servo position
pos_top =0 ; // variable to store the servo position
right = true;
double maxium=0;
myservo_top.write(45);
delay(20);
for(int i = 0; i <= 180; i += 15)
{
myservo_bottom.write(i);
delay(20);
get_value();
if(maxium