I’m looking for a light source for the RT1062 and thought that the 12 neopixel ring I had laying around might be a good option. I saw there was a neopixel MicroPython library and it was on the RT1062, but the test code that I wrote did not light up the ring. I saw some older posts about the neopixels not working (well?) with the OpenMV cameras, but I thought maybe the newer one might support them. Here is my test code:
import sensor
import time
import neopixel
from machine import Pin
pin = Pin('P7', Pin.OUT)
n = neopixel.NeoPixel(pin,12)
sensor.reset() # Reset and initialize the sensor.
sensor.set_pixformat(sensor.GRAYSCALE) # Set pixel format to RGB565 (or GRAYSCALE)
sensor.set_framesize(sensor.XGA) # Set frame size to QVGA (320x240)
sensor.skip_frames(time=2000) # Wait for settings take effect.
clock = time.clock() # Create a clock object to track the FPS.
while True:
n = neopixel.NeoPixel(pin,12)
for i in range(12):
n[i] = (255, 255, 255)
n.write()
clock.tick() # Update the FPS clock.
img = sensor.snapshot() # Take a picture and return the image.
print(clock.fps()) # Note: OpenMV Cam runs about half as fast when connected
# to the IDE. The FPS should increase once disconnected.
If nexopixels won’t work, do you have any suggestion for a light source that won’t have too much shadowing?