Based on the command byte format from the datasheet, reference:
FIGURE 5-2: Command Byte Format.
Your code:
digitalPotWrite(1, level);
should be:
digitalPotWrite(0x11, level);
Based on the command byte format from the datasheet, reference:
FIGURE 5-2: Command Byte Format.
Your code:
digitalPotWrite(1, level);
should be:
digitalPotWrite(0x11, level);