I am having trouble using my BlinkStick Pro with Processing 3.0.2 I get a null pointer exception on the line that creates the BlinkStick object in the ProIndexedColors.pde example file. I have also tried it with Processing 2 with the same effect. The BlinkStick installed drivers when I first plugged it in.
Is there something I am missing and need to install?
I get the same error as before. I made the mistake of running this before plugging the BlinkStick in, and I got a different error. Rather than getting messages in the Processing console, the Processing status bar warned me of a Null Pointer Exception and did not finish execution.
Both of these errors occurred on the led.setColor(255,0,0);
This is the error I got when the BlinkStick was plugged in:
java.lang.NullPointerException
at blinkstick.BlinkStick.setColor(Unknown Source)
at blinkstick.BlinkStick.setColor(Unknown Source)
at sketch_160221a.setup(sketch_160221a.java:22)
at processing.core.PApplet.handleDraw(PApplet.java:2377)
at processing.awt.PSurfaceAWT$12.callDraw(PSurfaceAWT.java:1527)
at processing.core.PSurfaceNone$AnimationThread.run(PSurfaceNone.java:316)
java.lang.NullPointerException
at blinkstick.BlinkStick.setColor(Unknown Source)
at blinkstick.BlinkStick.setColor(Unknown Source)
at sketch_160221a.setup(sketch_160221a.java:24)
at processing.core.PApplet.handleDraw(PApplet.java:2377)
at processing.awt.PSurfaceAWT$12.callDraw(PSurfaceAWT.java:1527)
at processing.core.PSurfaceNone$AnimationThread.run(PSurfaceNone.java:316)
java.lang.NullPointerException
at blinkstick.BlinkStick.setColor(Unknown Source)
at blinkstick.BlinkStick.setColor(Unknown Source)
at sketch_160221a.setup(sketch_160221a.java:26)
at processing.core.PApplet.handleDraw(PApplet.java:2377)
at processing.awt.PSurfaceAWT$12.callDraw(PSurfaceAWT.java:1527)
at processing.core.PSurfaceNone$AnimationThread.run(PSurfaceNone.java:316)
java.lang.NullPointerException
at blinkstick.BlinkStick.setColor(Unknown Source)
at blinkstick.BlinkStick.setColor(Unknown Source)
at sketch_160221a.setup(sketch_160221a.java:28)
at processing.core.PApplet.handleDraw(PApplet.java:2377)
at processing.awt.PSurfaceAWT$12.callDraw(PSurfaceAWT.java:1527)
at processing.core.PSurfaceNone$AnimationThread.run(PSurfaceNone.java:316)
it looks like that another instance is also using your device. Please keep sure that no BlinkStick Client is running in the background or any other programm using BlinkStick. If you cannot be sure, switch off the “AutoStart” function in the BlinkStick client and restart your PC. Then try again your processing program.
However, when I tried running the ProIndexedColor example again, I got the following error:
java.io.IOException: A device attached to the system is not functioning.
at com.codeminders.hidapi.HIDDevice.sendFeatureReport(Native Method)
at blinkstick.BlinkStick.setMode(Unknown Source)
at blinkstick.BlinkStick.setMode(Unknown Source)
at ProIndexedColors.setup(ProIndexedColors.java:37)
at processing.core.PApplet.handleDraw(PApplet.java:2377)
at processing.awt.PSurfaceAWT$12.callDraw(PSurfaceAWT.java:1527)
at processing.core.PSurfaceNone$AnimationThread.run(PSurfaceNone.java:316)
I think the problems are in the library directly. After all those tries the device must already be in mode 2 so you can uncomment the setmode line.
Keep the delays in front of every setcolor and commenting the setmode should be a solution for now.
For the sake of making my program “bullet-proof,” I actually added an if statement in setup() to check if the mode is already set to 2 (or whatever that particular program needs it to be) and sets it if need be (see below). This way I can switch between multiple uses for the BlinkStick without having to worry about the mode.
void setup() {
blinky = BlinkStick.findFirst();
if (blinky == null) {
println ("Device not found...");
} else {
if (blinky.getMode() != 2) {
blinky.setMode(2);
delay(100);
}
}
}
Plug in the AC adapter.
Point to the right hand corner of the screen to bring up the ‘Charms Bar’.
Click ‘Settings’.
Click the shutdown button, hold down and click ‘Restart’ from the options provided.
The system restarts, login and click ‘Troubleshoot’.
Click the ‘Dell Backup and Recovery’ icon.
The system restarts and comes back up, click ‘Next’ on ‘Dell Backup and Recovery’ screen.
The system would be checked to see if the smart repair option can fix the issue, click ‘Next’ once this is done.
You will be prompted to select the backup to be used, click the factory image option or select .from one of the backups. Click ‘Next’.
You will be prompted to back up your files, select ‘No, Erase my files’.
The system goes ahead and completes the restore of the operating system. Click ‘Restart’ when prompted.
Follow the on-screen instructions to setup the system with windows.
If this would not solve your errors then check Dell Inspiron 1545 Manual for more advanced fixes.