Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
projekte:epson-stylus-sx100 [2016-06-04 18:21] – [Operation] cracki | projekte:epson-stylus-sx100 [2016-06-04 18:43] – [Arduino] cracki | ||
---|---|---|---|
Line 91: | Line 91: | ||
bool dpimode = 1; | bool dpimode = 1; | ||
- | uint16_t pixels = dpimode ? 5268 : 2634; | + | uint16_t pixels = dpimode ? 5184 : 2592; |
+ | |||
+ | uint32_t linetime = 20000; // us | ||
+ | uint32_t sched = 0; | ||
void setup() { | void setup() { | ||
Line 99: | Line 102: | ||
digitalWrite(DPIMODE, | digitalWrite(DPIMODE, | ||
+ | |||
+ | sched = micros(); | ||
} | } | ||
- | |||
- | uint16_t linetime = 10000; // us | ||
- | uint32_t sched = 0; | ||
void loop() { | void loop() { | ||
Line 110: | Line 112: | ||
digitalWrite(START, | digitalWrite(START, | ||
- | for (uint16_t counter = 0; counter < pixels; counter += 1) | + | for (uint16_t counter = 0; counter < 82 + pixels; counter += 1) |
{ | { | ||
PORTD |= _BV(PORTD3); | PORTD |= _BV(PORTD3); | ||
Line 119: | Line 121: | ||
sched += linetime; | sched += linetime; | ||
- | | + | |
+ | while (dt > 0x4000) | ||
+ | { | ||
+ | delayMicroseconds(0x4000); | ||
+ | dt -= 0x4000; | ||
+ | } | ||
if (dt > 0) | if (dt > 0) | ||
delayMicroseconds(dt); | delayMicroseconds(dt); |