led헬멧

led헬멧 © Apache-2.0

led helmet

  • 25 views
  • 0 comments
  • 0 respects

Components and supplies

Necessary tools and machines

3drag
3D Printer (generic)

Apps and online services

About this project

Change the color of the LED helmet depending on the bike speed.

Code

LED헬멧Arduino
속도에 따라 파란불, 노란불, 빨간불이 켜지고 빨간불일때는 부저가 울려 위험성을 알려줌.
 #define BUZZER 7

const int beepFrequency = 50;

const int beepDuration = 1000;

void setup() {
 
  pinMode(13, OUTPUT);
  pinMode(12, OUTPUT);
  pinMode(11, OUTPUT);
  pinMode(A0, INPUT);
  Serial.begin(9600);

}

void loop() {
  if(analogRead(A0) < 300) {
    digitalWrite(13, LOW);
    digitalWrite(12, LOW);
    digitalWrite(11, HIGH);
  }
  else if(analogRead(A0) < 700) {
   digitalWrite(13, LOW);
   digitalWrite(12, HIGH);
   digitalWrite(11, LOW);
  }
  else {
   digitalWrite(13, HIGH);
   digitalWrite(12, LOW);
   digitalWrite(11, LOW);
   tone(BUZZER, beepFrequency, beepDuration);
  }
  delay(1000);

}

Custom parts and enclosures

tinker_KeYebgyFeS.obj
tinker_KeYebgyFeS.obj

Comments

Add projectSign up / Login