所有分类
主题 主题
平台 平台
我的工作台
userHead
注册时间 [[userInfo.create_time]]
创造力 [[userInfo.creativity]]
[[userInfo.remark]]
[[d.project_title]]
articleThumb
[[d.material_name]]
timelineThumb
进入工作台
折叠
所有分类 我的工作台
展开
国庆花车展示——飞天
云天 云天 2019-10-05 23:35:49
1
2
简单
projectImage
projectImage

视频演示

    “壮丽70年 奋斗新时代”,在这处处洋溢着欢乐喜庆、昂扬奋进的精气神的美好日子里,特制作一组花车迎国庆。

    本国庆彩车由三辆车彩车组成,首车为麦昆小车,点阵显示数字七十,庆祝新中国成立七十周年,车上载有国旗,车底彩灯闪烁。第二辆彩车,是主车,车上载有C919大飞机,彩灯螺旋上升,象征大飞机一飞冲天,一鸣惊人。车前播放《我和我的祖国》。采用四光电传感器进行巡线。第三辆彩车,采用四轮驱动,两光电巡,放在中间固定展示。车前挂红旗,车后有用子弹壳做成和平鸽,中间载有点阵屏,展示党旗、国旗、军旗,庆祝标语。

材料清单 材料清单
1x
麦昆小车
5x
Arduino控制板
1x
32x16 RGB LED Matrix - 6mm pitch 点阵屏
3x
炫彩 WS2812 RGB LED可剪裁黑色灯带 120灯
5x
直流减速电机
2x
DFRobot DF9GMS 180° 微型舵机
1x
数字继电器模块

首车——麦昆3.0

projectImage

程序代码

代码 代码
	                    					#include <Microbit_Matrix.h>
#include <DFRobot_NeoPixel.h>
#include <Maqueen_Motor.h>
#include <Microbit_Sound.h>

double mind_n_my_variable;
double mind_n_num;

const uint8_t bitmap_Dq3S[5] = {B00000,B11011,B01011,B01011,B01011};
DFRobot_NeoPixel  rgb_display_15;
const uint8_t bitmap_8WWq[5] = {B01100,B00100,B00100,B00100,B01110};
Maqueen_Motor motor;
const uint8_t bitmap_NLmm[5] = {B01110,B00010,B01110,B01000,B01110};
const uint8_t bitmap_pDnn[5] = {B01110,B00010,B01110,B00010,B01110};

void setup() {
	MMatrix.show(bitmap_Dq3S);
	mind_n_my_variable = 0;
	rgb_display_15.begin(15, 4, 255);
	rgb_display_15.setRangeColor(0, 0, 0xff0000);
}

void loop() {
	rgb_display_15.rotate(1);
	if ((digitalRead(14) && digitalRead(13))) {
		mind_n_num = mind_n_num + 1;
		if ((mind_n_num == 1)) {
			MMatrix.show(bitmap_8WWq);
			motor.motorRun(motor.LEFT,motor.CW,0);
			motor.motorRun(motor.RIGHT,motor.CW,0);
			MSound.play(0, DADADADUM, OnceInBackground);
			delay(6000);
			motor.motorRun(motor.LEFT,motor.CW,50);
			motor.motorRun(motor.RIGHT,motor.CW,50);
			delay(2000);
		}
		if ((mind_n_num == 2)) {
			MMatrix.show(bitmap_NLmm);
			motor.motorRun(motor.LEFT,motor.CW,0);
			motor.motorRun(motor.RIGHT,motor.CW,0);
			MSound.play(0, ENTERTAINER, OnceInBackground);
			delay(6000);
			motor.motorRun(motor.LEFT,motor.CW,50);
			motor.motorRun(motor.RIGHT,motor.CW,50);
			delay(2000);
		}
		if ((mind_n_num == 3)) {
			mind_n_num = 0;
			MMatrix.show(bitmap_pDnn);
			motor.motorRun(motor.LEFT,motor.CW,0);
			motor.motorRun(motor.RIGHT,motor.CW,0);
			MSound.play(0, PRELUDE, OnceInBackground);
			delay(6000);
			motor.motorRun(motor.LEFT,motor.CW,50);
			motor.motorRun(motor.RIGHT,motor.CW,50);
			delay(500);
		}
	}
	else {
		if (digitalRead(13)) {
			motor.motorRun(motor.LEFT,motor.CW,200);
			motor.motorRun(motor.RIGHT,motor.CW,0);
			digitalWrite(12,HIGH);
			digitalWrite(8,LOW);
		}
		else {
			if (digitalRead(14)) {
				motor.motorRun(motor.LEFT,motor.CW,0);
				motor.motorRun(motor.RIGHT,motor.CW,200);
				digitalWrite(8,HIGH);
				digitalWrite(12,LOW);
			}
			else {
				motor.motorRun(motor.LEFT,motor.CW,100);
				motor.motorRun(motor.RIGHT,motor.CW,100);
				digitalWrite(8,LOW);
				digitalWrite(12,LOW);
			}
		}
	}
}

	                    				
附件 附件

主车——一飞冲天

projectImage

    车上载有C919大飞机,彩灯螺旋上升,象征大飞机一飞冲天,一鸣惊人。车前播放《我和我的祖国》。采用四光电传感器进行巡线。

projectImage

剩余装修材料

projectImage
projectImage
projectImage
projectImage
projectImage

野地自采麦杆

projectImage
projectImage

飞天成品

projectImage

内部布线有待进一步整理

代码 代码
	                    					#include <DFRobot_SerialMp3.h>
#include <DFRobot_NeoPixel.h>

double mind_n_my_variable;
double mind_n_num;

DFRobot_SerialMp3 serialMp3;
DFRobot_NeoPixel  rgb_display_12;

void setup() {
	serialMp3.begin(&Serial, 0, 1);
	rgb_display_12.begin(12, 120, 255);
	rgb_display_12.showRainbow(0, 120, 1, 360);
	serialMp3.play();
	serialMp3.volume(100);
	analogWrite(10, 120);
	analogWrite(11, 120);
	mind_n_my_variable = 0;
}

void loop() {
	rgb_display_12.rotate(10);
	if ((digitalRead(2) && (digitalRead(5) && (digitalRead(4) && digitalRead(3))))) {
		digitalWrite(6, LOW);
		digitalWrite(7, LOW);
		digitalWrite(8, LOW);
		digitalWrite(9, LOW);
		if ((mind_n_num == 1)) {
			mind_n_my_variable = mind_n_my_variable + 1;
			serialMp3.playList(1);
			delay(9000);
		}
		if ((mind_n_num == 2)) {
			mind_n_my_variable = mind_n_my_variable + 1;
			serialMp3.playList(2);
			delay(11000);
		}
		if ((mind_n_num == 3)) {
			mind_n_my_variable = 0;
			serialMp3.playList(3);
			delay(24000);
		}
		digitalWrite(6, LOW);
		digitalWrite(7, HIGH);
		digitalWrite(8, HIGH);
		digitalWrite(9, LOW);
		delay(1000);
	}
	else {
		if (digitalRead(2)) {
			digitalWrite(6, LOW);
			digitalWrite(7, LOW);
			digitalWrite(8, HIGH);
			digitalWrite(9, LOW);
		}
		else {
			if (digitalRead(5)) {
				digitalWrite(6, LOW);
				digitalWrite(7, HIGH);
				digitalWrite(8, LOW);
				digitalWrite(9, LOW);
			}
			else {
				if (digitalRead(3)) {
					digitalWrite(6, LOW);
					digitalWrite(7, LOW);
					digitalWrite(8, HIGH);
					digitalWrite(9, LOW);
				}
				else {
					if (digitalRead(4)) {
						digitalWrite(6, LOW);
						digitalWrite(7, HIGH);
						digitalWrite(8, LOW);
						digitalWrite(9, LOW);
					}
					else {
						digitalWrite(6, LOW);
						digitalWrite(7, HIGH);
						digitalWrite(8, HIGH);
						digitalWrite(9, LOW);
					}
				}
			}
		}
	}
}

	                    				
附件 附件

尾车——和平之车

    采用四轮驱动,两光电巡,放在中间固定展示。车前挂红旗,车后有用子弹壳做成和平鸽,中间载有点阵屏,展示党旗、国旗、军旗,庆祝标语。

projectImage
projectImage
projectImage

空弹壳制作和平鸽

projectImage

加装点阵屏

    展示:党旗、国旗、军旗

升旗装置

    采用红外开关,触发升旗

projectImage
projectImage
代码 代码
	                    					#include <IOBOX_Motor.h>

double mind_n_df_bs;

IOBOX_Motor motor;

void setup() {
	mind_n_df_bs = 0;
}

void loop() {
	if (((!(digitalRead(P8))) && (mind_n_df_bs == 0))) {
		delay(10000);
		mind_n_df_bs = 1;
		motor.motorRun(motor.M1, motor.CW, 150);
		delay(8000);
		motor.motorStop(motor.M1);
	}
	if (((digitalRead(P16)) && (mind_n_df_bs == 1))) {
		mind_n_df_bs = 0;
		motor.motorRun(motor.M1, motor.CCW, 200);
		delay(8000);
		motor.motorStop(motor.M1);
	}
}

	                    				
附件 附件

彩灯礼花

    利用红外开关,触发彩灯点亮。

projectImage
projectImage
代码 代码
	                    					#include <Microbit_Matrix.h>
#include <DFRobot_NeoPixel.h>

double mind_n_df_bs;

DFRobot_NeoPixel  rgb_display_2;
DFRobot_NeoPixel  rgb_display_12;

void setup() {
	MMatrix.clear();
	mind_n_df_bs = 0;
	rgb_display_2.begin(2, 120, 255);
	rgb_display_2.clear();
	rgb_display_12.begin(12, 120, 255);
	rgb_display_12.clear();
	dfrobotRandomSeed();
}

void loop() {
	if ((!(digitalRead(8)))) {
		rgb_display_2.setRangeColor(0, 4, 0x0000ff);
		rgb_display_12.setRangeColor(0, 4, 0xff0000);
		for (int count = 0; count < 116; count++) {
			rgb_display_2.rotate(1);
			rgb_display_12.rotate(1);
			delay(100);
		}
		for (int count = 0; count < 10; count++) {
			rgb_display_2.showRainbow(92, 120, (random(1, 330+1)), 360);
			rgb_display_12.showRainbow(92, 120, (random(1, 330+1)), 360);
			delay(2000);
			rgb_display_2.clear();
			rgb_display_12.clear();
			delay(500);
		}
	}
}

	                    				
附件 附件

开场机器人

projectImage
Makelog作者原创文章,未经授权禁止转载。
1
2
评论
[[c.user_name]] [[c.create_time]]
[[c.parent_comment.count]]
[[c.comment_content]]