Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
projekte:epson-stylus-sx100 [2016-06-04 17:54] crackiprojekte:epson-stylus-sx100 [2016-06-04 18:21] – [Operation] cracki
Line 83: Line 83:
     * warte, 0-20 Millisekunden haben geklappt     * warte, 0-20 Millisekunden haben geklappt
  
 +==== Arduino ====
 +
 +<code>
 +#define START 2
 +#define CLOCK 3
 +#define DPIMODE 4
 +
 +bool dpimode = 1;
 +uint16_t pixels = dpimode ? 5268 : 2634;
 +
 +void setup() {
 +  pinMode(START, OUTPUT);
 +  pinMode(CLOCK, OUTPUT);
 +  pinMode(DPIMODE, OUTPUT);
 +
 +  digitalWrite(DPIMODE, dpimode);
 +}
 +
 +uint16_t linetime = 10000; // us
 +uint32_t sched = 0;
 +
 +void loop() {
 +  digitalWrite(START, HIGH);
 +  digitalWrite(CLOCK, HIGH);
 +  digitalWrite(CLOCK, LOW);
 +  digitalWrite(START, LOW);
 +
 +  for (uint16_t counter = 0; counter < pixels; counter += 1)
 +  {
 +    PORTD |= _BV(PORTD3);
 +    //delayMicroseconds(1);
 +    PORTD &= ~_BV(PORTD3);
 +    //delayMicroseconds(1);
 +  }
 +
 +  sched += linetime;
 +  int16_t dt = sched - micros();
 +  if (dt > 0)
 +    delayMicroseconds(dt);
 +}
 +</code>
 ==== coloring code ==== ==== coloring code ====
 <code> <code>
Navigation



You are not allowed to add pages