Check out my first novel, midnight's simulacra!

InaMORAta: Difference between revisions

From dankwiki
Line 20: Line 20:
We'll need a digital input pin with interrupt support. On the Arduino Uno, this restricts us to pin 2 or 3. We use pin 2, plus the necessary resistor.
We'll need a digital input pin with interrupt support. On the Arduino Uno, this restricts us to pin 2 or 3. We use pin 2, plus the necessary resistor.


==Control (PWM)==
==Control==
===Fan PWM===
We set up a 25K PWM signal on pin 8. We can't use the standard Arduino PWM system, which operates at lower frequencies (490Hz and 980Hz). We operate directly on timer registers, using timer 4:
We set up a 25K PWM signal on pin 8. We can't use the standard Arduino PWM system, which operates at lower frequencies (490Hz and 980Hz). We operate directly on timer registers, using timer 4:
<pre>
<pre>
Line 35: Line 36:
   OCR4C = duty;
   OCR4C = duty;
</pre>
</pre>
===LEDs===
We use three PWM-capable digital pins: 9, 10, and 11 for blue, green, and red respectively. <tt>analogWrite()</tt> is sufficient to set the brightness. These pins are used to control logic level MOSFETs, which are also hooked up to ground and the 12V input.


==Temps==
==Temps==