你喝过鸡尾酒么?是自己调制的么?——鸡尾酒交互伞arduino
你喝过鸡尾酒么?是自己调制的么?我没有喝过,但是做了一个鸡尾酒主题交互伞?喜欢么?想自己试一试不?可以私信我要源代码哦。对了,在此声明,此分享不是商业作品,非成套售卖品,感兴趣的可以私信我或者留邮箱等联系方式分享更多细节和资料,然后自己动手做一个。视频放不上来。。。。。。。。。。。先给几张图片吧
https://image.geek-workshop.com/forum/201904/10/112003g3vclcen3a88leve.jpg
https://image.geek-workshop.com/forum/201904/10/112003zrxrvr5tgorgkhq1.jpg
https://image.geek-workshop.com/forum/201904/10/112210xkow5wwd0rjw9rw9.jpg
https://image.geek-workshop.com/forum/201904/10/112210soiz5oomiuik7cyg.jpg
#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 {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;
int tabvaleurmax;
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 [ 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.begin();
servoligne.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=150;
tabvaleurmax=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();}
}
不知道您这出来是啥效果?是可以收伞撑伞么?能做个视频么?~
页:
[1]