Digital poti (X9C103)


hi,
iam testin brand new digital potentiometer. somehow stuck in problems.
i want increase , decrease resistance permanent. 0 ohm - 10 kohm , back.
therefor wrote sketch
code: [select]
int inc = 1;
int ud = 2;
int cs = 3;


void loop() //setpot (uint requestedspeed)
  {
   // char val[2];
    //calcpulses(val,config.motorspeed, requestedspeed);
    digitalwrite(inc,high);
    digitalwrite(cs,low);
    digitalwrite(ud,high);
    for(int i=1;i<0;i++)
    {
      digitalwrite(inc, high);   // sets pin on
      delaymicroseconds(5000);        // pauses 50 microseconds     
      digitalwrite(inc, low);    // sets pin off
      delaymicroseconds(5000);        // pauses 50 microseconds         
    }
    digitalwrite(inc,high);
    digitalwrite(cs,high);
    delay(20);
   
     // char val[2];
    //calcpulses(val,config.motorspeed, requestedspeed);
    digitalwrite(inc,high);
    digitalwrite(cs,low);
    digitalwrite(ud,low);
    for(int i=100 ;i>99;i=-1)
    {
      digitalwrite(inc, high);   // sets pin on
      delaymicroseconds(5000);        // pauses 50 microseconds     
      digitalwrite(inc, low);    // sets pin off
      delaymicroseconds(5000);        // pauses 50 microseconds         
    }
    digitalwrite(inc,high);
    digitalwrite(cs,high);
    delay(20);
  }


and datasheet

http://html.alldatasheet.com/html-pdf/120328/intersil/x9c102/3106/8/x9c102.html


hope find mistake ?!

best regards

code: [select]
for(int i=1;i<0;i++)
what values of loop produce ?
or one
code: [select]
for(int i=100 ;i>99;i=-1)


Arduino Forum > Using Arduino > Programming Questions > Digital poti (X9C103)


arduino

Comments

Popular posts from this blog

invalid use of void expresion in FlexiTimer2 library

error: a function-definition is not allowed here before '{' token

LED Strip Code