Show Posts
Pages: [1]
1  Products / Arduino Due / DigitalAnalogConverter DAC0 stoppt working correctly on: October 11, 2013, 04:13:25 pm
Hello, I testet the DAC0 and DAC1 on my DUE on the oscilloscope. Suddanly DAC0 stopped to work correctly. I changed Cables and tried both channels on the oscilloscope. For sure I also changed the variables in the code vor DAC0 and 1. =>
DAC0 still gives out a strange distorted weak Sinus.  There are no other electronics between the arduino and the Oszi. Here is the  the code i used. IN THE BEGINNING IT WORKED FINE...both signals were the same . I didnt do any changings =>Suddanly .

the code: but there is no problem with the code :-( look at the oszi picture OPEN IT!!! :-(

any ideas what happened?
Code:
int led = 31;

//1kHz
int sineX[] = {2048,2305,2557,2802,3034,3251,3449,3625,3777,3901,3995,4059,4092,4092,4060,3996,3902,3778,3628,3452,3254,3037,2805,2560,2308,2051,1795,1542,1297,1065,847,649,473,321,197,102,37,4,4,35,99,193,316,466,642,839,1056,1288,1533,1785,2041};
int sineY[] = {2048,2305,2557,2802,3034,3251,3449,3625,3777,3901,3995,4059,4092,4092,4060,3996,3902,3778,3628,3452,3254,3037,2805,2560,2308,2051,1795,1542,1297,1065,847,649,473,321,197,102,37,4,4,35,99,193,316,466,642,839,1056,1288,1533,1785,2041};
// the setup routine runs once when you press reset:
void setup() {                
  // initialize the digital pin as an output.
  pinMode(led, OUTPUT);  
  pinMode(DAC0, OUTPUT);
  pinMode(DAC1, OUTPUT);  
}

// the loop routine runs over and over again forever:
void loop() {
  for(int i = 0; i<50;i++){
      if(sineX[i]>4095||sineY[i]>4095) {
         sineX[i]=4095;
         sineY[i]=4095;
         digitalWrite(led, LOW);
        
     }
    analogWriteResolution(12);
    analogWrite(DAC0, sineX[i]);
    analogWrite(DAC1, sineY[i]);
    delayMicroseconds(14);
    
  }
}
2  Forum 2005-2010 (read only) / Syntax & Programs / Re: Midi controlled PAL signal on: December 06, 2009, 09:26:52 am
Code:
//Arduino Tv framebuffer+ MIDI IN

#include <MIDI.h>
// Video out voltage levels
#define _SYNC 0x00
#define _BLACK 0x01
#define _GRAY 0x02
#define _WHITE 0x03
// dimensions of the screen
#define WIDTH 38
#define HEIGHT 14
//number of lines to display
#define DISPLAY_LINES 240
// update speed for the main loop of the game
#define UPDATE_INTERVAL 1
// maximum velocity of the ball
#define MAX_VEL 10
// time to wait while paused
#define DONE_WAITING 30
// input pins for the player pots
#define PLAYER_LEFT_PIN 2
// currently the same pin
#define PLAYER_RIGHT_PIN 3
//video pins
#define DATA_PIN 9
#define SYNC_PIN 8

int ledPin = 13;
int midi = 0;

// the video frameBuffer
byte frameBuffer[WIDTH][HEIGHT];
// loop indices
byte index, index2;
// pal video line loop
byte line;
// current drawing line in framebuffer
byte newLine;
// loop counter to for the main loop delay
int waitingCount = 0;
// if we should be waiting for something to happen
boolean waiting=true;
// value of the counter controlling the freq of updates
byte updateCounter=0;

// positions and velocity of the ball
byte ballXPos = 14;
byte ballYPos = 7;

int readMidi(){
  int midi_type = 0;

  if (MIDI.read()) {
    switch(MIDI.getType()) {            // Get the type of the message we caught
    case PC:
      midi_type = MIDI.getData1();
      return midi;
      //BlinkLed(MIDI.getData1());      // Blink the LED a number of times
      // correponding to the program number
      // (0 to 127, it can last a while..)
      break;
      // See the online reference for other types
    default:
      break;
    }
  }
}
void drawVisualisation(){
  int midi = 0;
  midi = readMidi();

  if(midi = 0){
    //digitalWrite(ledPin, HIGH);
    setPixel(10, 2);
  }
  else if(midi < 10 & midi > 0 )
  {
    //digitalWrite(ledPin, HIGH);
    //clearScreen();
    setPixel(10, 3);
  }
  else if(midi < 20 & midi > 10)
  {
    //digitalWrite(ledPin, HIGH);
    //clearScreen();
    setPixel(10, 4);
  }  
  else if(midi < 30 & midi > 20)
  {
    //digitalWrite(ledPin, HIGH);
    //clearScreen();
    setPixel(10, 5);
  }  
  else if(midi < 40 & midi < 30)
  {
    digitalWrite(ledPin, HIGH);
    grayPixel(5,10);
    setPixel(10, 20);
    grayPixel(7,10);
    setPixel(10, 20);
    grayPixel(9,10);
    setPixel(11, 33);
    grayPixel(5,10);
    setPixel(13, 20);
    grayPixel(5,10);
    setPixel(15, 20);
    grayPixel(5,10);
    setPixel(14, 26);
    grayPixel(5,10);
    setPixel(19, 17);
    grayPixel(5,10);
    setPixel(10, 24);
    grayPixel(5,10);
    setPixel(11, 20);
     grayPixel(5,10);
    setPixel(15, 23);
    grayPixel(7,10);
    setPixel(23, 20);
    grayPixel(9,10);
    setPixel(05, 13);
    grayPixel(5,10);
    setPixel(16, 20);
    grayPixel(5,10);
    setPixel(15, 20);
    grayPixel(5,10);
    setPixel(14, 26);
    grayPixel(5,10);
    setPixel(19, 17);
    grayPixel(5,10);
    setPixel(10, 24);
    grayPixel(5,10);
    setPixel(10, 20);
    
    
    //clearScreen();
  }
  else if(midi > 100)
  {
    //digitalWrite(ledPin, HIGH);
    //clearScreen();
    setPixel(10, 20);
    grayPixel(30,30);
  }      
}




// draw a pixel to the buffer
void setPixel(byte x,byte y)
{
  frameBuffer[x][y]= _WHITE;
}

void grayPixel(byte x, byte y)
{
  frameBuffer[x][y]= _GRAY;
}

// draw a black pixel to the buffer
void clearPixel(byte x,byte y)
{
  frameBuffer[x][y]= _BLACK;
}

// draw a paddle
void drawPaddle(byte x,byte y,byte col)
{
  frameBuffer[x][y]= col;
  frameBuffer[x][y+1]= col;
}

void drawBall(byte col)
{
  frameBuffer[ballXPos][ballYPos]=col;
}

//draw the title message
void drawArduinoPong()
{
  //arduino
  /* int counter;
   for(counter=1; counter<32;counter++){
   setPixel(counter, 10);
   //clearPixel(counter-1, 10);
   }
  
   for(counter=1; counter<32;counter++){
   setPixel(2, counter);
   //clearPixel(counter-1, 10);
   }
   for(counter=1; counter<32;counter++){
   grayPixel(4, counter);
   //clearPixel(counter-1, 10);
   }
   for(counter=1; counter<32;counter++){
   setPixel(8, counter);
   //clearPixel(counter-1, 10);
   }
   for(counter=1; counter<32;counter++){
   grayPixel(12, counter);
   //clearPixel(counter-1, 10);
   } */
}

// clear the screen
void clearScreen()
{
  for (index = 0; index < WIDTH; index++)
    for (index2=0;index2<=HEIGHT;++index2)
    {
      frameBuffer[index][index2] = _BLACK;
    }
}



// the setup routine
void setup()
{
  MIDI.begin();                  // Launch MIDI with default options
  cli();
  pinMode (SYNC_PIN, OUTPUT);
  pinMode (DATA_PIN, OUTPUT);
  digitalWrite (SYNC_PIN, HIGH);
  digitalWrite (DATA_PIN, HIGH);
  loop();
  clearScreen();
  //drawArduinoPong();
}

void loop()
{
  // iterate over the lines on the tv
  drawVisualisation();
  for ( line =0;line< DISPLAY_LINES;++line)
  {

    // HSync
    // front porch (1.5 us)
    PORTB = _BLACK;
    delayMicroseconds(1.5);
    //sync (4.7 us)
    PORTB = _SYNC;
    delayMicroseconds(4.7);
    // breezeway (.6us) + burst (2.5us) + colour back borch (1.6 us)
    PORTB = _BLACK;
    delayMicroseconds(0.6+2.5+1.6);


    //calculate which line to draw to
    newLine = line >>4;
    delayMicroseconds(1);

    //display the array for this line
    // a loop would have been smaller, but it messes the timing up
    PORTB = frameBuffer[0][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[1][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[2][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[3][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[4][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[5][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[6][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[7][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[8][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[9][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[10][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[11][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[12][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[13][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[14][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[15][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[16][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[17][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[18][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[19][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[20][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[21][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[22][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[23][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[24][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[25][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[26][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[27][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[28][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[29][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[30][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[31][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[32][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[33][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[34][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[35][newLine];
    delayMicroseconds(1);

    // klugdge to correct timings
    PORTB = frameBuffer[36][newLine];
    PORTB=PORTB;
    PORTB=PORTB;
    PORTB=PORTB;
    delayMicroseconds(3);
  }


  //vsync
  PORTB = _SYNC;

  // if delaying for some reason
  if(waiting)
  {
    // increment the waiting counter
    waitingCount++;
    //digitalWrite(ledPin, HIGH);
    // delay(200);
    // digitalWrite(ledPin, HIGH);
    readMidi();
    drawVisualisation();



    // wait for the remainder of the sync period
    delayMicroseconds(610);
  }
  // not waiting
  else
  {
    // increment the update delay counter
    updateCounter++;
    if( updateCounter >= UPDATE_INTERVAL)
    {

      // remainder of sync period
      delayMicroseconds(10);
      updateCounter=0;
    }
    else
      // remainder of sync period
      delayMicroseconds(250);
  }
  drawVisualisation();
}

drawVisualisation(); here at the end is the part I start to draw the Pixels on the PAL tv screen
3  Forum 2005-2010 (read only) / Syntax & Programs / Midi controlled PAL signal on: December 06, 2009, 09:25:48 am
Hello, I am trying to control the pal signal by a midi drum computer. So I build a shield for the arduino with a MIDI IN & OUT Port  + the pal signal generator (from Arduino Pong). I tested the hardware and testet the mini in, midi out, pal output, seperately and it works. I get midi signals and I can send them out. I can also play Arduino Pong :-). then I tried to combine this programms. I implemented the  midi query in the arduino pong code. But it doesnt really work. I cant change the pal output in the rythm of the midi signals. So there is the first important question. Which kind of BIN or HEX signals. A number range, do I get in the variables. then I can say IF midi note1 comes in then picture 1, if midi note 2 comes in then picture 2. in the beatrytm. but where is the right position for this codepart?
at my programm I come in the fllowing condition.
 
else if(midi < 40 & midi < 30)
 {
    digitalWrite(ledPin, HIGH);
    grayPixel(5,10);
    setPixel(10, 20);
    grayPixel(7,10);
.........

The led starts and I can see the pixels on the screen. But how to change this in the midi rythm?. and which variables are for example note G & velocity midi note from the drumcomputer.

Here Is the code MIDI in and PAL signal generator from arduino poing. but it doesnt work. Please help me to find the mistake.
My goal is to visualize a change in the pal signal picture if a different midi note comes in. I am not sure it the MIDI IN query is right? and also I dont know how to include that the midi query goes on and on because the midi notes are changing.

I tested both codes SEPERATELY: Midi in/Out  and the Arduino Pong and it works perfectly.  

PLZ Help me I really can't sleep :-?
4  Forum 2005-2010 (read only) / Exhibition / Re: Arduino Pong on: December 03, 2009, 09:55:05 pm
Hello, I am working on an interface that converts midi signals into visuals. I based this on the arduino pong code. Now I am on the end of my ideas. the 2 parts: Midi Input Signal and Arduino pong works seperately perfekt but its so hard for me to connect them. I hope there is someone out who can help me
I did the midi input shown here: it works

Code:
#include <MIDI.h>
/*
  Basic I/O MIDI tutorial
  by Franky
  28/07/2009
*/

#define LED 13               // LED pin on Arduino board

void setup() {
  pinMode(LED, OUTPUT);
  MIDI.begin(4);                  // Launch MIDI with default options
                        // input channel is set to 4
}

void loop() {
  if (MIDI.read()) {
    digitalWrite(LED,HIGH);     // Blink the LED
    MIDI.sendNoteOn(42,127,1);  // Send a Note (pitch 42, velo 127 on channel 1)
    delay(1000);            // Wait for a second
    MIDI.sendNoteOff(42,0,1);   // Stop the note
    digitalWrite(LED,LOW);          
  }
}

here is now my code that I build :-(
The midi request doesn 't work. My goal is to show different pictures with different midi nots from my drumcomputer.
If Midi Note 1 and Velocity 1 arrives show Picture 1
If Midi Note 1 and Velocity 1 arrives show Picture 12
its important that the programm asks the whole time if there is a new Midi note.
....
here is the code mixed with the arduino pong code. Now I can just see 2 does because the programm steps in the following else if part

 else if(midi < 40 & midi < 30)
  {
    digitalWrite(ledPin, HIGH);
    grayPixel(5,10);
    setPixel(10, 20);
    //clearScreen();
  }

this is the code

Code:
//Arduino Tv framebuffer
//Alastair Parker
//2007
#include <MIDI.h>
// Video out voltage levels
#define _SYNC 0x00
#define _BLACK 0x01
#define _GRAY 0x02
#define _WHITE 0x03
// dimensions of the screen
#define WIDTH 38
#define HEIGHT 14
//number of lines to display
#define DISPLAY_LINES 240
// update speed for the main loop of the game
#define UPDATE_INTERVAL 1
// maximum velocity of the ball
#define MAX_VEL 10
// time to wait while paused
#define DONE_WAITING 30
// input pins for the player pots
#define PLAYER_LEFT_PIN 2
// currently the same pin
#define PLAYER_RIGHT_PIN 3
//video pins
#define DATA_PIN 9
#define SYNC_PIN 8

int ledPin = 13;
int midi = 0;

// the video frameBuffer
byte frameBuffer[WIDTH][HEIGHT];
// loop indices
byte index, index2;
// pal video line loop
byte line;
// current drawing line in framebuffer
byte newLine;
// loop counter to for the main loop delay
int waitingCount = 0;
// if we should be waiting for something to happen
boolean waiting=true;
// value of the counter controlling the freq of updates
byte updateCounter=0;

// positions and velocity of the ball
byte ballXPos = 14;
byte ballYPos = 7;

int readMidi(){
  int midi_type = 0;

  if (MIDI.read()) {
    switch(MIDI.getType()) {            // Get the type of the message we caught
    case PC:
      midi_type = MIDI.getData1();
      return midi;
      //BlinkLed(MIDI.getData1());      // Blink the LED a number of times
      // correponding to the program number
      // (0 to 127, it can last a while..)
      break;
      // See the online reference for other types
    default:
      break;
    }
  }
}
void drawVisualisation(){
  int midi = 0;
  midi = readMidi();

  if(midi = 0){
    //digitalWrite(ledPin, HIGH);
    setPixel(10, 2);
  }
  else if(midi < 10 & midi > 0 )
  {
    //digitalWrite(ledPin, HIGH);
    //clearScreen();
    setPixel(10, 3);
  }
  else if(midi < 20 & midi > 10)
  {
    //digitalWrite(ledPin, HIGH);
    //clearScreen();
    setPixel(10, 4);
  }  
  else if(midi < 30 & midi > 20)
  {
    //digitalWrite(ledPin, HIGH);
    //clearScreen();
    setPixel(10, 5);
  }  
  else if(midi < 40 & midi < 30)
  {
    digitalWrite(ledPin, HIGH);
    grayPixel(5,10);
    setPixel(10, 20);
    //clearScreen();
  }
  else if(midi > 100)
  {
    //digitalWrite(ledPin, HIGH);
    //clearScreen();
    setPixel(10, 20);
    grayPixel(30,30);
  }      
}




// draw a pixel to the buffer
void setPixel(byte x,byte y)
{
  frameBuffer[x][y]= _WHITE;
}

void grayPixel(byte x, byte y)
{
  frameBuffer[x][y]= _GRAY;
}

// draw a black pixel to the buffer
void clearPixel(byte x,byte y)
{
  frameBuffer[x][y]= _BLACK;
}

// draw a paddle
void drawPaddle(byte x,byte y,byte col)
{
  frameBuffer[x][y]= col;
  frameBuffer[x][y+1]= col;
}

void drawBall(byte col)
{
  frameBuffer[ballXPos][ballYPos]=col;
}

//draw the title message
void drawArduinoPong()
{
  //arduino
  /* int counter;
   for(counter=1; counter<32;counter++){
   setPixel(counter, 10);
   //clearPixel(counter-1, 10);
   }
  
   for(counter=1; counter<32;counter++){
   setPixel(2, counter);
   //clearPixel(counter-1, 10);
   }
   for(counter=1; counter<32;counter++){
   grayPixel(4, counter);
   //clearPixel(counter-1, 10);
   }
   for(counter=1; counter<32;counter++){
   setPixel(8, counter);
   //clearPixel(counter-1, 10);
   }
   for(counter=1; counter<32;counter++){
   grayPixel(12, counter);
   //clearPixel(counter-1, 10);
   } */
}

// clear the screen
void clearScreen()
{
  for (index = 0; index < WIDTH; index++)
    for (index2=0;index2<=HEIGHT;++index2)
    {
      frameBuffer[index][index2] = _BLACK;
    }
}



// the setup routine
void setup()
{
  MIDI.begin();                  // Launch MIDI with default options
  cli();
  pinMode (SYNC_PIN, OUTPUT);
  pinMode (DATA_PIN, OUTPUT);
  digitalWrite (SYNC_PIN, HIGH);
  digitalWrite (DATA_PIN, HIGH);
  loop();
  clearScreen();
  //drawArduinoPong();
}

void loop()
{
  // iterate over the lines on the tv
  drawVisualisation();
  for ( line =0;line< DISPLAY_LINES;++line)
  {

    // HSync
    // front porch (1.5 us)
    PORTB = _BLACK;
    delayMicroseconds(1.5);
    //sync (4.7 us)
    PORTB = _SYNC;
    delayMicroseconds(4.7);
    // breezeway (.6us) + burst (2.5us) + colour back borch (1.6 us)
    PORTB = _BLACK;
    delayMicroseconds(0.6+2.5+1.6);


    //calculate which line to draw to
    newLine = line >>4;
    delayMicroseconds(1);

    //display the array for this line
    // a loop would have been smaller, but it messes the timing up
    PORTB = frameBuffer[0][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[1][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[2][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[3][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[4][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[5][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[6][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[7][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[8][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[9][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[10][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[11][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[12][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[13][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[14][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[15][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[16][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[17][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[18][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[19][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[20][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[21][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[22][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[23][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[24][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[25][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[26][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[27][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[28][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[29][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[30][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[31][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[32][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[33][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[34][newLine];
    delayMicroseconds(1);
    PORTB = frameBuffer[35][newLine];
    delayMicroseconds(1);

    // klugdge to correct timings
    PORTB = frameBuffer[36][newLine];
    PORTB=PORTB;
    PORTB=PORTB;
    PORTB=PORTB;
    delayMicroseconds(3);
  }


  //vsync
  PORTB = _SYNC;

  // if delaying for some reason
  if(waiting)
  {
    // increment the waiting counter
    waitingCount++;
    //digitalWrite(ledPin, HIGH);
    // delay(200);
    // digitalWrite(ledPin, HIGH);
    readMidi();
    drawVisualisation();



    // wait for the remainder of the sync period
    delayMicroseconds(610);
  }
  // not waiting
  else
  {
    // increment the update delay counter
    updateCounter++;
    if( updateCounter >= UPDATE_INTERVAL)
    {

      // remainder of sync period
      delayMicroseconds(10);
      updateCounter=0;
    }
    else
      // remainder of sync period
      delayMicroseconds(250);
  }

  drawVisualisation();

}

ok i think i am very near. THX lg munki
Pages: [1]