设为首页收藏本站

arduino 单片机机器人爱好者之家

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 530|回复: 0

你喝过鸡尾酒么?是自己调制的么?——鸡尾酒交互伞arduino

[复制链接]

该用户从未签到

发表于 2019-4-10 11:46:41 | 显示全部楼层 |阅读模式
你喝过鸡尾酒么?是自己调制的么?我没有喝过,但是做了一个鸡尾酒主题交互伞?喜欢么?想自己试一试不?可以私信我要源代码哦。对了,在此声明,此分享不是商业作品,非成套售卖品,感兴趣的可以私信我或者留邮箱等联系方式分享更多细节和资料,然后自己动手做一个。
视频放不上来。。。。。。。。。。。先给几张图片吧




[AppleScript] 纯文本查看 复制代码
#include <SPI.h>
#include <SD.h>

#include "LcDef.h"

#include <Wire.h>
#include <Adafruit_PWMServoDriver.h>

#include <LiquidCrystal.h>
LiquidCrystal lcd(4, 6, 9, 11, 12, 13);

File myFile;
Adafruit_PWMServoDriver pwm1 = Adafruit_PWMServoDriver(0x40);
Adafruit_PWMServoDriver pwm2 = Adafruit_PWMServoDriver(0x41);
Adafruit_PWMServoDriver pwm3 = Adafruit_PWMServoDriver(0x42);
Adafruit_PWMServoDriver pwm4 = Adafruit_PWMServoDriver(0x43);
Adafruit_PWMServoDriver pwm5 = Adafruit_PWMServoDriver(0x44);
Adafruit_PWMServoDriver pwm6 = Adafruit_PWMServoDriver(0x45);
Adafruit_PWMServoDriver pwm7 = Adafruit_PWMServoDriver(0x46);
Adafruit_PWMServoDriver pwm8 = Adafruit_PWMServoDriver(0x47);
Adafruit_PWMServoDriver pwm9 = Adafruit_PWMServoDriver(0x48);
Adafruit_PWMServoDriver pwm10 = Adafruit_PWMServoDriver(0x49);

Adafruit_PWMServoDriver servoligne[10] {pwm10,pwm9,pwm8,pwm7,pwm6,pwm5,pwm4,pwm3,pwm2,pwm1}; 
int degremin=40;
int degremax=120;
int valeurmax=map(degremax,0,180,150,550);
int valeurmin=map(degremin,0,180,150,550);
int tabvaleurmin[10][16];
int tabvaleurmax[10][16];

int angleconsigne=degremin;

#define   bouton1on  (!digitalRead(24)) 
#define   bouton2on  (!digitalRead(26))
#define   bouton3on  (!digitalRead(28)) 
#define   bouton4on  (!digitalRead(30))
byte bouton1onprevious=0;
byte bouton2onprevious=0;
byte bouton3onprevious=0;
byte bouton4onprevious=0;
int valeurbouton1=0;
int valeurbouton2=0;
int valeurbouton3=0;
int valeurbouton4=0;
byte ausuivant=0;

int prochainecol=0;
int angle[10 ] [ 16];
void setup()

{

pinMode(24,INPUT_PULLUP);
pinMode(26,INPUT_PULLUP);
pinMode(28,INPUT_PULLUP);
pinMode(30,INPUT_PULLUP);



for (int x=0;x<=9;x++)
     {
servoligne[x].begin();
servoligne[x].setPWMFreq(60);
     }

 lcd.begin(16, 2); 

 Serial.begin(9600);
 delay(1000);

randomSeed(analogRead(0));

for(int y=0;y<=9; y++) {
   for( int x=0;x<=15;x++) {
tabvaleurmin[y][x]=150;
tabvaleurmax[y][x]=550;  
 }
 }

  Serial.print("Initializing SD card...");//  
lcdaffiche("Initializing SD card...","");                   
 if (!SD.begin(53)) {//                                         *                                      
    Serial.println("initialization failed!");// 
    lcdaffiche("carte SD pas OK","");    
    delay(4000);         
    //return;//                                                   *                                 
  }//  
  else{//*                                            
  Serial.println("initialization done.");//  
   lcdaffiche("carte SD OK",""); 
   delay(4000);                  




lecturecartesd("tabmin.txt",tabvaleurmin);
lecturecartesd("tabmax.txt",tabvaleurmax);

  }

}

void loop()
{  


reglage();
menu();
balle();
eclosion();
propagation();
mouvementsynchrone();
mouvementsinusoidal();
mouvementsinusimage();
lettre("HELLO[[[");





if(quelboutonpese()==4){menu();}


}


您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|联系我们|YFRobot ( 苏ICP备13017135  

GMT+8, 2019-9-18 15:51 , Processed in 0.086319 second(s), 27 queries .

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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