Im trying to get a resistance (50kΩ digital potentiometer) switching in 255 steps from about 50Ω to about 0Ω and then back to 50Ω and so on..... (....5,4,3,2,1,0 ,1,2,3,4,5...50,49,48....)
Actually the resistance is switching in 255 steps from 50Ω to 0Ω, then its starting at 50Ω again. (50,49....5,4,3,2,1,0 ,50,49,48....).
You really should have read How to use this forum before posting. (Especially item #7.)
ie Your code and any error messages should always be placed between [code]code tags[/code]. Posting it inline as you have done makes it much harder to read or copy and paste for diagnosis, and often also corrupts the code with italics or smilies.
It's still not too late to edit your post and do this. You'll make potential helpers much happier.
Was there a question? According to your description, it's doing exactly what you want.
I just got it. (And Paul just answered it.)
And do you mean 50Ω to 0Ω or 50KΩ to 0Ω?
You say it's a 50KΩ digital pot, then only mention 50Ω in the rest of the post.
Im trying to get a resistance (50kΩ digital potentiometer) switching in 255 steps from about 50Ω to about 0Ω and then back to 50Ω and so on..... (....5,4,3,2,1,0 ,1,2,3,4,5...50,49,48....)
Actually the resistance is switching in 255 steps from 50Ω to 0Ω, then its starting at 50Ω again. (50,49....5,4,3,2,1,0 ,50,49,48....).
The code you wrote increments resistance by one each time through loop(), resetting it to 0 when it gets to 255.
If you want different behavior, you need to write different code.
Here's a hint. Instead of always adding +1, you might want to add -1 under some circumstances.
and either nothing changed or I didnt even get a resistance from the digital potentiometer.
Bummer.
You need to post one of the things you tried, and explain what it actually does and what you expected. Then, we can explain why it does not do what you expect, and maybe suggest how to fix it.