You can focus Pixy 2.1 by turning the lens clockwise or counterclockwise. Do this while looking at the PixyMon window while running the Video program.
Note, if you have a Pixy 2.0, there is no way to adjust the focus, however, it is focused at the factory for the best depth-of-field.
Pixy 2.1's lens will focus on objects that are very close, even less than an 1/4 inch from the lens. However, most users prefer to operate Pixy 2.1 with its lens focus set to infinity, which (for Pixy's lens) means that any object that is 1 inch or farther from the lens will be in focus. (note: we set the focus to infinity before shipping each Pixy, although it may shift slightly in transit).