Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| projekte:epson-stylus-sx100 [2016-06-04 17:54] – cracki | projekte:epson-stylus-sx100 [2017-01-17 01:01] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 7: | Line 7: | ||
| Uebrig sind: | Uebrig sind: | ||
| - | * Contact Image Sensor mit LEDs | + | * [[projekte: |
| * Schrittmotor (96 Schritte, 18 Ohm, ~0.2-0.3 Ampere) | * Schrittmotor (96 Schritte, 18 Ohm, ~0.2-0.3 Ampere) | ||
| * zwei DC Motoren, vmtl brushed | * zwei DC Motoren, vmtl brushed | ||
| Line 16: | Line 16: | ||
| Beschriftungen: | Beschriftungen: | ||
| + | |||
| + | Numerierung: | ||
| + | * Rohm: Pin 1 aussen. | ||
| + | * PCB: Pin 1 innen <- die nehmen wir | ||
| + | |||
| + | ==== Beleuchtung ==== | ||
| Die LEDs brauchen so 2-3 Volt, Strom ~20 mA bringt schon Licht. | Die LEDs brauchen so 2-3 Volt, Strom ~20 mA bringt schon Licht. | ||
| Line 21: | Line 27: | ||
| die TO Pins am PCB sind: V+, Blau, Rot, Gruen. | die TO Pins am PCB sind: V+, Blau, Rot, Gruen. | ||
| - | Numerierung: | + | Bei 5V Versorgung sollte mit folgenden Widerständen nach Erde gezogen werden fuer weisses Papier: Rot:50, Grün:50, Blau:220. |
| - | * Rohm: Pin 1 aussen. | + | |
| - | * PCB: Pin 1 innen <- die nehmen wir | + | |
| < | < | ||
| Line 33: | Line 37: | ||
| | 4 | | | | x | | LED GND Blau | | | 4 | | | | x | | LED GND Blau | | ||
| | 5 | | R | G | B | x | LED + | | | 5 | | R | G | B | x | LED + | | ||
| + | |||
| + | ==== Datensignale ==== | ||
| Spannung 1 mA: | Spannung 1 mA: | ||
| Line 43: | Line 49: | ||
| | 11 | <typo bg:# | | 11 | <typo bg:# | ||
| | 12 | <typo bg:# | | 12 | <typo bg:# | ||
| + | |||
| + | ==== Insgesamt ==== | ||
| sieht verdammt nach [[http:// | sieht verdammt nach [[http:// | ||
| Line 83: | Line 91: | ||
| * warte, 0-20 Millisekunden haben geklappt | * warte, 0-20 Millisekunden haben geklappt | ||
| + | ==== Arduino ==== | ||
| + | |||
| + | < | ||
| + | #define START 2 | ||
| + | #define CLOCK 3 | ||
| + | #define DPIMODE 4 | ||
| + | |||
| + | bool dpimode = 1; | ||
| + | uint16_t pixels = dpimode ? 5184 : 2592; | ||
| + | |||
| + | uint32_t linetime = 20000; // us | ||
| + | uint32_t sched = 0; | ||
| + | |||
| + | void setup() { | ||
| + | pinMode(START, | ||
| + | pinMode(CLOCK, | ||
| + | pinMode(DPIMODE, | ||
| + | |||
| + | digitalWrite(DPIMODE, | ||
| + | |||
| + | sched = micros(); | ||
| + | } | ||
| + | |||
| + | void loop() { | ||
| + | digitalWrite(START, | ||
| + | digitalWrite(CLOCK, | ||
| + | digitalWrite(CLOCK, | ||
| + | digitalWrite(START, | ||
| + | |||
| + | for (uint16_t counter = 0; counter < 82 + pixels; counter += 1) | ||
| + | { | ||
| + | PORTD |= _BV(PORTD3); | ||
| + | // | ||
| + | PORTD &= ~_BV(PORTD3); | ||
| + | // | ||
| + | } | ||
| + | |||
| + | sched += linetime; | ||
| + | int32_t dt = sched - micros(); | ||
| + | while (dt > 0x4000) | ||
| + | { | ||
| + | delayMicroseconds(0x4000); | ||
| + | dt -= 0x4000; | ||
| + | } | ||
| + | if (dt > 0) | ||
| + | delayMicroseconds(dt); | ||
| + | } | ||
| + | </ | ||
| ==== coloring code ==== | ==== coloring code ==== | ||
| < | < | ||