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
projets:jozephine [2020/02/20 22:05] – [Upcoming] mhprojets:jozephine [2020/06/01 16:35] (current) – external edit 127.0.0.1
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.
  
-==== Upcoming ====+=== Official GitLab Source ===
  
-  *fritzing diagram +[[https://gitlab.com/mh8/creepy-doll|Git Lab link]] 
-  *arduino code+==== Arduino snippets ====
  
 +=== Simple blink ===
 +
 +Wire two leds to pin 0 of atTiny85. Wire two 220 Ohms resistors between each LED and GND.
 +
 +Each LED should draw a max of 20 mA from the pin which keeps it just under the 40 mA limit.
 +
 +If you want to wire more LEDs, look into other techniques or use other pins.
 +
 +++++ Simple arduino code |
 +
 +<code c>
 +int led = 0; // LED pin
 +int brightness = 0;
 +int fadeAmount = 5; // points to fade LED by
 +
 +void setup()
 +{
 +  pinMode(led, OUTPUT); // init led
 +}
 +
 +void loop()
 +{
 +  fadeEyes(); // blink the eye thing
 +}
 +
 +void fadeEyes()
 +{
 +  analogWrite(led, brightness);
 +  if (brightness == 255)
 +  {
 +    delay(1500); // stay a bit on full bright led
 +  }
 +
 +  brightness = brightness + fadeAmount;
 +
 +  //reverse direction at start & end of fade
 +  if (brightness == 0 || brightness == 255)
 +  {
 +    fadeAmount = -fadeAmount;
 +  }
 +
 +  // wait 30 miliseconds to see changes
 +
 +  delay(30);
 +}
 +</code>
 +++++
 +
 +{{projets:jozephine_simple_leds.png?500}}
  
 ==== Legacy ==== ==== Legacy ====
Line 80: Line 129:
  
 ++++ ++++
 +
 +[[https://www.instructables.com/id/The-Creepy-Doll/|Instructables project]]
  • projets/jozephine.1582232744.txt.gz
  • Last modified: 2020/06/01 16:35
  • (external edit)