Components and supplies
Li-Ion Battery 1000mAh
Arduino Wireless SD Shield
Speaker, Piezo
Alligator clip & rope
Rocker Switch, SPST
Programmable Soft LED Board
synchronizing line
HC-05 Bluetooth Module
Bike Holder
Flash Memory Card, SD Card
Jumper wires (generic)
Voltage Regulator Module
Arduino UNO
Tools and machines
Laser cutter (generic)
Solder Wire, Lead Free
Soldering Station, 110 V
PCB Holder, Soldering Iron
Hot glue gun (generic)
Multitool, Screwdriver
Apps and platforms
AutoCAD
Arduino IDE
Project description
Code
Code for Display
c_cpp
Code for Display on LED Board ( Control )
1#include <Adafruit_NeoPixel.h> 2#include <Wire.h> 3#include <SoftwareSerial.h> 4 5#define PIN1 6 6 7const int MUSIC1 = 3;// 8const int MUSIC2 = 4;// 9const int MUSIC3 = 5;// 10 11//const int MODECHANGE = 5;// 12 13// Parameter 1 = number of pixels in strip 14// Parameter 2 = pin number (most are valid) 15// Parameter 3 = pixel type flags, add together as needed: 16// NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs) 17// NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers) 18// NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products) 19// NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2) 20Adafruit_NeoPixel strip1 = Adafruit_NeoPixel(512, PIN1, NEO_GRB + NEO_KHZ800); 21SoftwareSerial BT(8,9); //8 rx,9 tx 22//SoftwareSerial BT2(10,11); //8 rx,9 tx 23#define COLOR strip1.Color(5, 5, 0) 24 25 26char cmd,lastcmd; 27 28void Music_Control(uint8_t state); 29void second_part(); 30void first_part(); 31void Third_part(); 32void Fourth_part(); 33void forword(); 34void First_down(); 35void Second_down(); 36void First_up(); 37void Second_up(); 38void Front(){ 39 strip1.setBrightness(0);strip1.show(); 40 strip1.setBrightness(255);strip1.show(); 41 forword(); 42 } 43void Left(){ 44 strip1.setBrightness(0);strip1.show(); 45 strip1.setBrightness(255);strip1.show(); 46 first_part(); 47 Second_up(); 48 } 49void Right(){ 50 strip1.setBrightness(0);strip1.show(); 51 strip1.setBrightness(255);strip1.show(); 52 First_up(); 53 second_part(); 54 } 55 56void setup() { 57 58 BT.begin(38400); 59 Wire.begin(); 60 61 strip1.begin(); 62 strip1.show(); // Initialize all pixels to 'off' 63 64 pinMode(MUSIC1,OUTPUT); 65 pinMode(MUSIC2,OUTPUT); 66 pinMode(MUSIC3,OUTPUT); 67 digitalWrite(MUSIC1,HIGH); 68 digitalWrite(MUSIC2,HIGH); 69 digitalWrite(MUSIC3,HIGH); 70// pinMode(MODECHANGE,OUTPUT); 71} 72 73void loop() { 74 if(BT.available()>0) 75 { 76 cmd=BT.read(); 77 if(cmd!=lastcmd){ 78 if(cmd=='0') {cmdTx(cmd);Front();Music_Control(0);} 79 if(cmd=='1') {cmdTx(cmd);Left();Music_Control(1);} 80 if(cmd=='2') {cmdTx(cmd);Right();Music_Control(2);} 81 lastcmd=cmd; 82 } 83 } 84delay(10); 85} 86 87void cmdTx(char cmd){ 88 Wire.beginTransmission(1); 89 Wire.write(cmd); 90 Wire.endTransmission(); 91 } 92
Code for Display
c_cpp
Code for Display on LED Board ( Control )
1#include <Adafruit_NeoPixel.h> 2#include <Wire.h> 3#include <SoftwareSerial.h> 4 5#define PIN1 6 6 7const int MUSIC1 = 3;// 8const int MUSIC2 = 4;// 9const int MUSIC3 = 5;// 10 11//const int MODECHANGE = 5;// 12 13// Parameter 1 = number of pixels in strip 14// Parameter 2 = pin number (most are valid) 15// Parameter 3 = pixel type flags, add together as needed: 16// NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs) 17// NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers) 18// NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products) 19// NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2) 20Adafruit_NeoPixel strip1 = Adafruit_NeoPixel(512, PIN1, NEO_GRB + NEO_KHZ800); 21SoftwareSerial BT(8,9); //8 rx,9 tx 22//SoftwareSerial BT2(10,11); //8 rx,9 tx 23#define COLOR strip1.Color(5, 5, 0) 24 25 26char cmd,lastcmd; 27 28void Music_Control(uint8_t state); 29void second_part(); 30void first_part(); 31void Third_part(); 32void Fourth_part(); 33void forword(); 34void First_down(); 35void Second_down(); 36void First_up(); 37void Second_up(); 38void Front(){ 39 strip1.setBrightness(0);strip1.show(); 40 strip1.setBrightness(255);strip1.show(); 41 forword(); 42 } 43void Left(){ 44 strip1.setBrightness(0);strip1.show(); 45 strip1.setBrightness(255);strip1.show(); 46 first_part(); 47 Second_up(); 48 } 49void Right(){ 50 strip1.setBrightness(0);strip1.show(); 51 strip1.setBrightness(255);strip1.show(); 52 First_up(); 53 second_part(); 54 } 55 56void setup() { 57 58 BT.begin(38400); 59 Wire.begin(); 60 61 strip1.begin(); 62 strip1.show(); // Initialize all pixels to 'off' 63 64 pinMode(MUSIC1,OUTPUT); 65 pinMode(MUSIC2,OUTPUT); 66 pinMode(MUSIC3,OUTPUT); 67 digitalWrite(MUSIC1,HIGH); 68 digitalWrite(MUSIC2,HIGH); 69 digitalWrite(MUSIC3,HIGH); 70// pinMode(MODECHANGE,OUTPUT); 71} 72 73void loop() { 74 if(BT.available()>0) 75 { 76 cmd=BT.read(); 77 if(cmd!=lastcmd){ 78 if(cmd=='0') {cmdTx(cmd);Front();Music_Control(0);} 79 if(cmd=='1') {cmdTx(cmd);Left();Music_Control(1);} 80 if(cmd=='2') {cmdTx(cmd);Right();Music_Control(2);} 81 lastcmd=cmd; 82 } 83 } 84delay(10); 85} 86 87void cmdTx(char cmd){ 88 Wire.beginTransmission(1); 89 Wire.write(cmd); 90 Wire.endTransmission(); 91 } 92
Code for Display #2
c_cpp
Code for Display ("Graphic Decoding")
1void Music_Control(uint8_t state) 2{ 3 if(state == 0) 4 { 5 digitalWrite(MUSIC1,LOW); 6 delay(1000); 7 digitalWrite(MUSIC1,HIGH); 8 digitalWrite(MUSIC2,HIGH); 9 digitalWrite(MUSIC3,HIGH); 10 } 11 else if(state == 1) 12 { 13 digitalWrite(MUSIC2,LOW); 14 delay(1000); 15 digitalWrite(MUSIC1,HIGH); 16 digitalWrite(MUSIC2,HIGH); 17 digitalWrite(MUSIC3,HIGH); 18 } 19 else if(state == 2) 20 { 21 digitalWrite(MUSIC3,LOW); 22 delay(1000); 23 digitalWrite(MUSIC1,HIGH); 24 digitalWrite(MUSIC2,HIGH); 25 digitalWrite(MUSIC3,HIGH); 26 } 27} 28 29void first_part(){ 30 strip1.setPixelColor(0, COLOR); 31// strip1.show(); 32 for(int i=30;i<=34;i++){ 33 strip1.setPixelColor(i, COLOR); 34// strip1.show(); 35 } 36 for(int i=60;i<=68;i++){ 37 strip1.setPixelColor(i, COLOR); 38// strip1.show(); 39 } 40 for(int i=90;i<=102 ;i++){ 41 strip1.setPixelColor(i, COLOR); 42// strip1.show(); 43 } 44 for(int i=120;i<=136;i++){ 45 strip1.setPixelColor(i, COLOR); 46// strip1.show(); 47 } 48 for(int i=150;i<=170;i++){ 49 strip1.setPixelColor(i, COLOR); 50// strip1.show(); 51 } 52 for(int i=180;i<=204;i++){ 53 strip1.setPixelColor(i, COLOR); 54// strip1.show(); 55 } 56 for(int i=210;i<=238;i++){ 57 strip1.setPixelColor(i, COLOR); 58// strip1.show(); 59 } 60 for(int i=240;i<=255;i++){ 61 strip1.setPixelColor(i, COLOR); 62// strip1.show(); 63 } 64 strip1.show(); 65 } 66void second_part(){ 67 68 for(int i=256;i<=271;i++){ 69 strip1.setPixelColor(i, COLOR); 70// strip1.show(); 71 } 72 for(int i=273;i<=301;i++){ 73 strip1.setPixelColor(i, COLOR); 74// strip1.show(); 75 } 76 for(int i=307;i<=331;i++){ 77 strip1.setPixelColor(i, COLOR); 78// strip1.show(); 79 } 80 for(int i=341;i<=361;i++){ 81 strip1.setPixelColor(i, COLOR); 82// strip1.show(); 83 } 84 for(int i=375;i<=391;i++){ 85 strip1.setPixelColor(i, COLOR); 86// strip1.show(); 87 } 88 for(int i=409;i<=421;i++){ 89 strip1.setPixelColor(i, COLOR); 90// strip1.show(); 91 } 92 for(int i=443;i<=451;i++){ 93 strip1.setPixelColor(i, COLOR); 94// strip1.show(); 95 } 96 for(int i=477;i<=481;i++){ 97 strip1.setPixelColor(i, COLOR); 98// strip1.show(); 99 } 100 101 strip1.setPixelColor(511, COLOR); 102// strip1.show(); 103 strip1.show(); 104 } 105void Third_part(){ 106 for(int i=15;i<=17;i++){ 107 strip1.setPixelColor(i, COLOR); 108// strip1.show(); 109 } 110 for(int i=45;i<=51;i++){ 111 strip1.setPixelColor(i, COLOR); 112// strip1.show(); 113 } 114 for(int i=75;i<=85 ;i++){ 115 strip1.setPixelColor(i, COLOR); 116// strip1.show(); 117 } 118 for(int i=105;i<=119;i++){ 119 strip1.setPixelColor(i, COLOR); 120// strip1.show(); 121 } 122 for(int i=135;i<=153;i++){ 123 strip1.setPixelColor(i, COLOR); 124// strip1.show(); 125 } 126 for(int i=165;i<=187;i++){ 127 strip1.setPixelColor(i, COLOR); 128// strip1.show(); 129 } 130 for(int i=195;i<=221;i++){ 131 strip1.setPixelColor(i, COLOR); 132// strip1.show(); 133 } 134 for(int i=225;i<=255;i++){ 135 strip1.setPixelColor(i, COLOR); 136// strip1.show(); 137 } 138 strip1.show(); 139 } 140 141 void Fourth_part(){ 142 for(int i=256;i<=286;i++){ 143 strip1.setPixelColor(i, COLOR); 144// strip1.show(); 145 } 146 for(int i=290;i<=316;i++){ 147 strip1.setPixelColor(i, COLOR); 148// strip1.show(); 149 } 150 for(int i=324;i<=346 ;i++){ 151 strip1.setPixelColor(i, COLOR); 152// strip1.show(); 153 } 154 for(int i=358;i<=376;i++){ 155 strip1.setPixelColor(i, COLOR); 156// strip1.show(); 157 } 158 for(int i=392;i<=406;i++){ 159 strip1.setPixelColor(i, COLOR); 160// strip1.show(); 161 } 162 for(int i=426;i<=436;i++){ 163 strip1.setPixelColor(i, COLOR); 164// strip1.show(); 165 } 166 for(int i=460;i<=466;i++){ 167 strip1.setPixelColor(i, COLOR); 168// strip1.show(); 169 } 170 for(int i=494;i<=496;i++){ 171 strip1.setPixelColor(i, COLOR); 172// strip1.show(); 173 } 174 strip1.show(); 175 } 176 177void forword() 178{ 179 for(int i=128;i<=383;i++){ 180 strip1.setPixelColor(i, COLOR); 181 } 182 strip1.show(); 183 } 184void First_down(){ 185 for(int i=8;i<=23;i++){ 186 strip1.setPixelColor(i, COLOR); 187// strip1.show(); 188 } 189 for(int i=40;i<=55;i++){ 190 strip1.setPixelColor(i, COLOR); 191// strip1.show(); 192 } 193 for(int i=72;i<=87;i++){ 194 strip1.setPixelColor(i, COLOR); 195// strip1.show(); 196 } 197 for(int i=104;i<=119;i++){ 198 strip1.setPixelColor(i, COLOR); 199// strip1.show(); 200 } 201 for(int i=136;i<=151;i++){ 202 strip1.setPixelColor(i, COLOR); 203// strip1.show(); 204 } 205 for(int i=168;i<=183;i++){ 206 strip1.setPixelColor(i, COLOR); 207// strip1.show(); 208 } 209 for(int i=200;i<=215;i++){ 210 strip1.setPixelColor(i, COLOR); 211// strip1.show(); 212 } 213 for(int i=232;i<=247;i++){ 214 strip1.setPixelColor(i, COLOR); 215// strip1.show(); 216 } 217 strip1.show(); 218 } 219void First_up(){ 220 for(int i=0;i<=7;i++){ 221 strip1.setPixelColor(i, COLOR); 222// strip1.show(); 223 } 224 for(int i=24;i<=39;i++){ 225 strip1.setPixelColor(i, COLOR); 226// strip1.show(); 227 } 228 for(int i=56;i<=71;i++){ 229 strip1.setPixelColor(i, COLOR); 230// strip1.show(); 231 } 232 for(int i=88;i<=103;i++){ 233 strip1.setPixelColor(i, COLOR); 234// strip1.show(); 235 } 236 for(int i=120;i<=135;i++){ 237 strip1.setPixelColor(i, COLOR); 238// strip1.show(); 239 } 240 for(int i=152;i<=167;i++){ 241 strip1.setPixelColor(i, COLOR); 242// strip1.show(); 243 } 244 for(int i=184;i<=199;i++){ 245 strip1.setPixelColor(i, COLOR); 246// strip1.show(); 247 } 248 for(int i=216;i<=231;i++){ 249 strip1.setPixelColor(i, COLOR); 250// strip1.show(); 251 } 252 for(int i=248;i<=255;i++){ 253 strip1.setPixelColor(i, COLOR); 254// strip1.show(); 255 } 256 strip1.show(); 257 } 258void Second_down(){ 259 for(int i=264;i<=279;i++){ 260 strip1.setPixelColor(i, COLOR); 261// strip1.show(); 262 } 263 for(int i=296;i<=311;i++){ 264 strip1.setPixelColor(i, COLOR); 265// strip1.show(); 266 } 267 for(int i=328;i<=343;i++){ 268 strip1.setPixelColor(i, COLOR); 269// strip1.show(); 270 } 271 for(int i=360;i<=375;i++){ 272 strip1.setPixelColor(i, COLOR); 273// strip1.show(); 274 } 275 for(int i=392;i<=407;i++){ 276 strip1.setPixelColor(i, COLOR); 277// strip1.show(); 278 } 279 for(int i=424;i<=439;i++){ 280 strip1.setPixelColor(i, COLOR); 281// strip1.show(); 282 } 283 for(int i=456;i<=471;i++){ 284 strip1.setPixelColor(i, COLOR); 285 strip1.show(); 286 } 287 for(int i=488;i<=503;i++){ 288 strip1.setPixelColor(i, COLOR); 289// strip1.show(); 290 } 291 strip1.show(); 292 } 293void Second_up(){ 294 for(int i=256;i<=263;i++){ 295 strip1.setPixelColor(i, COLOR); 296// strip1.show(); 297 } 298 for(int i=280;i<=295;i++){ 299 strip1.setPixelColor(i, COLOR); 300// strip1.show(); 301 } 302 for(int i=312;i<=327;i++){ 303 strip1.setPixelColor(i, COLOR); 304// strip1.show(); 305 } 306 for(int i=344;i<=359;i++){ 307 strip1.setPixelColor(i, COLOR); 308// strip1.show(); 309 } 310 for(int i=376;i<=391;i++){ 311 strip1.setPixelColor(i, COLOR); 312// strip1.show(); 313 } 314 for(int i=408;i<=423;i++){ 315 strip1.setPixelColor(i, COLOR); 316// strip1.show(); 317 } 318 for(int i=440;i<=455;i++){ 319 strip1.setPixelColor(i, COLOR); 320// strip1.show(); 321 } 322 for(int i=472;i<=487;i++){ 323 strip1.setPixelColor(i, COLOR); 324// strip1.show(); 325 } 326 for(int i=504;i<=511;i++){ 327 strip1.setPixelColor(i, COLOR); 328// strip1.show(); 329 } 330 strip1.show(); 331 } 332
Code for Display #2
c_cpp
Code for Display ("Graphic Decoding")
1void Music_Control(uint8_t state) 2{ 3 if(state == 0) 4 { 5 6 digitalWrite(MUSIC1,LOW); 7 delay(1000); 8 digitalWrite(MUSIC1,HIGH); 9 10 digitalWrite(MUSIC2,HIGH); 11 digitalWrite(MUSIC3,HIGH); 12 } 13 else 14 if(state == 1) 15 { 16 digitalWrite(MUSIC2,LOW); 17 delay(1000); 18 digitalWrite(MUSIC1,HIGH); 19 20 digitalWrite(MUSIC2,HIGH); 21 digitalWrite(MUSIC3,HIGH); 22 } 23 else 24 if(state == 2) 25 { 26 digitalWrite(MUSIC3,LOW); 27 delay(1000); 28 digitalWrite(MUSIC1,HIGH); 29 30 digitalWrite(MUSIC2,HIGH); 31 digitalWrite(MUSIC3,HIGH); 32 } 33} 34 35void 36 first_part(){ 37 strip1.setPixelColor(0, COLOR); 38// strip1.show(); 39 40 for(int i=30;i<=34;i++){ 41 strip1.setPixelColor(i, COLOR); 42// strip1.show(); 43 44 } 45 for(int i=60;i<=68;i++){ 46 strip1.setPixelColor(i, COLOR); 47// 48 strip1.show(); 49 } 50 for(int i=90;i<=102 ;i++){ 51 strip1.setPixelColor(i, 52 COLOR); 53// strip1.show(); 54 } 55 for(int i=120;i<=136;i++){ 56 57 strip1.setPixelColor(i, COLOR); 58// strip1.show(); 59 } 60 for(int 61 i=150;i<=170;i++){ 62 strip1.setPixelColor(i, COLOR); 63// strip1.show(); 64 65 } 66 for(int i=180;i<=204;i++){ 67 strip1.setPixelColor(i, COLOR); 68// 69 strip1.show(); 70 } 71 for(int i=210;i<=238;i++){ 72 strip1.setPixelColor(i, 73 COLOR); 74// strip1.show(); 75 } 76 for(int i=240;i<=255;i++){ 77 78 strip1.setPixelColor(i, COLOR); 79// strip1.show(); 80 } 81 strip1.show(); 82 83 } 84void second_part(){ 85 86 for(int i=256;i<=271;i++){ 87 88 strip1.setPixelColor(i, COLOR); 89// strip1.show(); 90 } 91 for(int 92 i=273;i<=301;i++){ 93 strip1.setPixelColor(i, COLOR); 94// strip1.show(); 95 96 } 97 for(int i=307;i<=331;i++){ 98 strip1.setPixelColor(i, COLOR); 99// 100 strip1.show(); 101 } 102 for(int i=341;i<=361;i++){ 103 strip1.setPixelColor(i, 104 COLOR); 105// strip1.show(); 106 } 107 for(int i=375;i<=391;i++){ 108 109 strip1.setPixelColor(i, COLOR); 110// strip1.show(); 111 } 112 for(int 113 i=409;i<=421;i++){ 114 strip1.setPixelColor(i, COLOR); 115// strip1.show(); 116 117 } 118 for(int i=443;i<=451;i++){ 119 strip1.setPixelColor(i, 120 COLOR); 121// strip1.show(); 122 } 123 for(int i=477;i<=481;i++){ 124 125 strip1.setPixelColor(i, COLOR); 126// strip1.show(); 127 } 128 129 130 strip1.setPixelColor(511, COLOR); 131// strip1.show(); 132 strip1.show(); 133 134 } 135void Third_part(){ 136 for(int i=15;i<=17;i++){ 137 strip1.setPixelColor(i, 138 COLOR); 139// strip1.show(); 140 } 141 for(int i=45;i<=51;i++){ 142 143 strip1.setPixelColor(i, COLOR); 144// strip1.show(); 145 } 146 for(int 147 i=75;i<=85 ;i++){ 148 strip1.setPixelColor(i, COLOR); 149// strip1.show(); 150 151 } 152 for(int i=105;i<=119;i++){ 153 strip1.setPixelColor(i, COLOR); 154// 155 strip1.show(); 156 } 157 for(int i=135;i<=153;i++){ 158 strip1.setPixelColor(i, 159 COLOR); 160// strip1.show(); 161 } 162 for(int i=165;i<=187;i++){ 163 164 strip1.setPixelColor(i, COLOR); 165// strip1.show(); 166 } 167 for(int 168 i=195;i<=221;i++){ 169 strip1.setPixelColor(i, COLOR); 170// strip1.show(); 171 172 } 173 for(int i=225;i<=255;i++){ 174 strip1.setPixelColor(i, COLOR); 175// 176 strip1.show(); 177 } 178 strip1.show(); 179 } 180 181 182 void Fourth_part(){ 183 for(int i=256;i<=286;i++){ 184 strip1.setPixelColor(i, 185 COLOR); 186// strip1.show(); 187 } 188 for(int i=290;i<=316;i++){ 189 190 strip1.setPixelColor(i, COLOR); 191// strip1.show(); 192 } 193 for(int 194 i=324;i<=346 ;i++){ 195 strip1.setPixelColor(i, COLOR); 196// strip1.show(); 197 198 } 199 for(int i=358;i<=376;i++){ 200 strip1.setPixelColor(i, COLOR); 201// 202 strip1.show(); 203 } 204 for(int i=392;i<=406;i++){ 205 strip1.setPixelColor(i, 206 COLOR); 207// strip1.show(); 208 } 209 for(int i=426;i<=436;i++){ 210 211 strip1.setPixelColor(i, COLOR); 212// strip1.show(); 213 } 214 for(int 215 i=460;i<=466;i++){ 216 strip1.setPixelColor(i, COLOR); 217// strip1.show(); 218 219 } 220 for(int i=494;i<=496;i++){ 221 strip1.setPixelColor(i, COLOR); 222// 223 strip1.show(); 224 } 225 strip1.show(); 226 } 227 228void 229 forword() 230{ 231 for(int i=128;i<=383;i++){ 232 strip1.setPixelColor(i, 233 COLOR); 234 } 235 strip1.show(); 236 } 237void First_down(){ 238 239 for(int i=8;i<=23;i++){ 240 strip1.setPixelColor(i, COLOR); 241// strip1.show(); 242 243 } 244 for(int i=40;i<=55;i++){ 245 strip1.setPixelColor(i, COLOR); 246// 247 strip1.show(); 248 } 249 for(int i=72;i<=87;i++){ 250 strip1.setPixelColor(i, 251 COLOR); 252// strip1.show(); 253 } 254 for(int i=104;i<=119;i++){ 255 256 strip1.setPixelColor(i, COLOR); 257// strip1.show(); 258 } 259 for(int 260 i=136;i<=151;i++){ 261 strip1.setPixelColor(i, COLOR); 262// strip1.show(); 263 264 } 265 for(int i=168;i<=183;i++){ 266 strip1.setPixelColor(i, COLOR); 267// 268 strip1.show(); 269 } 270 for(int i=200;i<=215;i++){ 271 strip1.setPixelColor(i, 272 COLOR); 273// strip1.show(); 274 } 275 for(int i=232;i<=247;i++){ 276 277 strip1.setPixelColor(i, COLOR); 278// strip1.show(); 279 } 280 strip1.show(); 281 282 } 283void First_up(){ 284 for(int i=0;i<=7;i++){ 285 286 strip1.setPixelColor(i, COLOR); 287// strip1.show(); 288 } 289 for(int 290 i=24;i<=39;i++){ 291 strip1.setPixelColor(i, COLOR); 292// strip1.show(); 293 294 } 295 for(int i=56;i<=71;i++){ 296 strip1.setPixelColor(i, COLOR); 297// 298 strip1.show(); 299 } 300 for(int i=88;i<=103;i++){ 301 strip1.setPixelColor(i, 302 COLOR); 303// strip1.show(); 304 } 305 for(int i=120;i<=135;i++){ 306 307 strip1.setPixelColor(i, COLOR); 308// strip1.show(); 309 } 310 for(int 311 i=152;i<=167;i++){ 312 strip1.setPixelColor(i, COLOR); 313// strip1.show(); 314 315 } 316 for(int i=184;i<=199;i++){ 317 strip1.setPixelColor(i, COLOR); 318// 319 strip1.show(); 320 } 321 for(int i=216;i<=231;i++){ 322 strip1.setPixelColor(i, 323 COLOR); 324// strip1.show(); 325 } 326 for(int i=248;i<=255;i++){ 327 328 strip1.setPixelColor(i, COLOR); 329// strip1.show(); 330 } 331 strip1.show(); 332 333 } 334void Second_down(){ 335 for(int i=264;i<=279;i++){ 336 337 strip1.setPixelColor(i, COLOR); 338// strip1.show(); 339 } 340 for(int 341 i=296;i<=311;i++){ 342 strip1.setPixelColor(i, COLOR); 343// strip1.show(); 344 345 } 346 for(int i=328;i<=343;i++){ 347 strip1.setPixelColor(i, COLOR); 348// 349 strip1.show(); 350 } 351 for(int i=360;i<=375;i++){ 352 strip1.setPixelColor(i, 353 COLOR); 354// strip1.show(); 355 } 356 for(int i=392;i<=407;i++){ 357 358 strip1.setPixelColor(i, COLOR); 359// strip1.show(); 360 } 361 for(int 362 i=424;i<=439;i++){ 363 strip1.setPixelColor(i, COLOR); 364// strip1.show(); 365 366 } 367 for(int i=456;i<=471;i++){ 368 strip1.setPixelColor(i, COLOR); 369 370 strip1.show(); 371 } 372 for(int i=488;i<=503;i++){ 373 strip1.setPixelColor(i, 374 COLOR); 375// strip1.show(); 376 } 377 strip1.show(); 378 379 } 380void Second_up(){ 381 for(int i=256;i<=263;i++){ 382 strip1.setPixelColor(i, 383 COLOR); 384// strip1.show(); 385 } 386 for(int i=280;i<=295;i++){ 387 388 strip1.setPixelColor(i, COLOR); 389// strip1.show(); 390 } 391 for(int 392 i=312;i<=327;i++){ 393 strip1.setPixelColor(i, COLOR); 394// strip1.show(); 395 396 } 397 for(int i=344;i<=359;i++){ 398 strip1.setPixelColor(i, COLOR); 399// 400 strip1.show(); 401 } 402 for(int i=376;i<=391;i++){ 403 strip1.setPixelColor(i, 404 COLOR); 405// strip1.show(); 406 } 407 for(int i=408;i<=423;i++){ 408 409 strip1.setPixelColor(i, COLOR); 410// strip1.show(); 411 } 412 for(int 413 i=440;i<=455;i++){ 414 strip1.setPixelColor(i, COLOR); 415// strip1.show(); 416 417 } 418 for(int i=472;i<=487;i++){ 419 strip1.setPixelColor(i, COLOR); 420// 421 strip1.show(); 422 } 423 for(int i=504;i<=511;i++){ 424 strip1.setPixelColor(i, 425 COLOR); 426// strip1.show(); 427 } 428 strip1.show(); 429 } 430
Code for Turning Detection
c_cpp
Code for Turning Detection
1#include <SoftwareSerial.h> 2 3// Pin10RXHC05TXD 4// Pin11TXHC05RXD 5// 6//const int M1 = 2; //define ENA Pin 7 8const int KEY1 = 2;// 9const int KEY2 = 3;// 10 11 12SoftwareSerial BT(12, 13); 13char Indicator = 0; 14char val; 15char KEY_state = 0; 16char prior = 0;// 01 17 18void Get_Command() 19{ 20 int buttonState1 = digitalRead(KEY1); 21 if(buttonState1 == HIGH) 22 { 23 buttonState1 = 1; 24 } 25 else 26 { 27 buttonState1 = 0; 28 } 29 int buttonState2 = digitalRead(KEY2); 30 if(buttonState2 == HIGH) 31 { 32 buttonState2 = 1; 33 } 34 else 35 { 36 buttonState2 = 0; 37 } 38 if((buttonState1 == 1)&&(buttonState2 == 1)) 39 { 40 Indicator = 0; 41 prior = 0; 42 } 43 if((buttonState1 == 0)&&(buttonState2 == 1)) 44 { 45 Indicator = 1; 46 prior = 1; 47 } 48 if((buttonState1 == 1)&&(buttonState2 == 0)) 49 { 50 Indicator = 2; 51 prior = 1; 52 } 53} 54 55void setup() { 56 Serial.begin(9600); 57 Serial.println("BT is ready!"); 58 // HC-0538400 59 BT.begin(38400); 60 61 pinMode(KEY1,INPUT_PULLUP ); 62 pinMode(KEY2,INPUT_PULLUP ); 63 64 65 pinMode(12,OUTPUT); 66 pinMode(13,OUTPUT); 67 68 digitalWrite(12,LOW); 69 digitalWrite(13,LOW); 70 71 72} 73void Get_Position() 74{ 75 // 76 int Sensor_Resistence = 0;//1023 77 int Sensor_Resistence_Raw = analogRead(A0);// 78 // 79 Sensor_Resistence = Sensor_Resistence_Raw;// 0-256 80 81 Serial.print("Sensor_Resistence_Raw"); 82 Serial.println(Sensor_Resistence_Raw,DEC); 83 if(prior == 0) 84 { 85 if((Sensor_Resistence >= 450)&&(Sensor_Resistence <= 550)) 86 { 87 Indicator = 0; 88 } 89 else if(Sensor_Resistence <450) 90 { 91 Indicator = 2; 92 } 93 else if(Sensor_Resistence >550) 94 { 95 Indicator = 1; 96 } 97 } 98} 99void loop() { 100 delay(200); 101 Get_Command();// 102 Get_Position();// 103 BT.print(Indicator,DEC);// 104 Serial.println(Indicator,DEC);// 105 106// if (Serial.available()) { 107// val = Serial.read(); 108// BT.print(val); 109// } 110// 111// if (BT.available()) { 112// val = BT.read(); 113// Serial.print(val); 114// } 115} 116
Downloadable files
Display System Schematics #2
Display System Schematics #2
Display System Schematics
Display System Schematics
Display System Schematics
Display System Schematics
Display System Schematics #2
Display System Schematics #2
Documentation
Holder of the 3 positioned switched
Held the 3 positioned switch
Holder of the 3 positioned switched
Display part Holder
Held the Led Display Screen
Display part Holder
Holder of Turning Detection Part (In the front)
The outside of the Turning Detection part
Holder of Turning Detection Part (In the front)
Holder of Turning Detection Part (In the front)
The outside of the Turning Detection part
Holder of Turning Detection Part (In the front)
Holder of the 3 positioned switched
Held the 3 positioned switch
Holder of the 3 positioned switched
Display part Holder
Held the Led Display Screen
Display part Holder
Comments
Only logged in users can leave comments
andyz1207
0 Followers
•0 Projects
Table of contents
Intro
7
0