projets:jozephine

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revisionBoth sides next revision
projets:jozephine [2020/02/20 23:05] – [Arduino Code] mhprojets:jozephine [2020/02/21 21:13] – [Jozéphine] mh
Line 9: Line 9:
 She was built in my beginnings and needs an update. She burns through 3.3V batteries like crazy. She was built in my beginnings and needs an update. She burns through 3.3V batteries like crazy.
  
 +=== Official GitLab Source ===
  
 +[[https://gitlab.com/mh8/creepy-doll|Git Lab link]]
 ==== Arduino Code ==== ==== Arduino Code ====
  
Line 34: Line 36:
 void loop() void loop()
 { {
- 
   fadeEyes(); // blink the eye thing   fadeEyes(); // blink the eye thing
- 
 } }
  
 void fadeEyes() void fadeEyes()
 { {
-  for (int i = 0i < 312; i++//unexplainable cycle value+  analogWrite(led, brightness); 
 +  if (brightness == 255)
   {   {
-    analogWrite(led, brightness); +    delay(1500); // stay a bit on full bright led 
-    if (brightness == 255) +  }
-    { +
-      delay(750); // stay 3 seconds on full bright led +
-    }+
  
-    brightness = brightness + fadeAmount;+  brightness = brightness + fadeAmount;
  
-    //reverse direction at start & end of fade +  //reverse direction at start & end of fade 
-    if (brightness == 0 || brightness == 255) +  if (brightness == 0 || brightness == 255) 
-    +  
-      fadeAmount = -fadeAmount; +    fadeAmount = -fadeAmount; 
-    }+  }
  
-    // wait 30 miliseconds to see changes+  // wait 30 miliseconds to see changes
  
-    delay(30); +  delay(30);
- +
-  } +
- +
-  digitalWrite(led, LOW);+
 } }
 </code> </code>
Line 135: Line 129:
  
 ++++ ++++
 +
 +[[https://www.instructables.com/id/The-Creepy-Doll/|Instructables project]]
  • projets/jozephine.txt
  • Last modified: 2020/06/01 16:35
  • by 127.0.0.1