Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

PHOTON OFF causes CPX to hang
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

PHOTON OFF causes CPX to hang

by hifriday on Fri Feb 14, 2020 12:15 am

I am programming the CPX using Makecode and in the simulator it runs just as expected. However when I run the code on my CPX it hangs whenever it encounters the PHOTON OFF command. The board freezes and then must be reset. Does this command need to be used in a different way?

I have tried installing just the bare minimum of the code as below. The CPX moves the photon forward 20 times and then freezes with the last Photon lighted (whereas in the simulator the photon will turn off, pause 2 seconds, and restart moving the photon).

Code: Select all | TOGGLE FULL SIZE
forever(function () {
    light.setPhotonPenHue(10)
    light.setPhotonMode(PhotonMode.PenDown)
    for (let i = 0; i < 20; i++) {
        light.photonForward(1)
        pause(100)
    }
    light.setPhotonMode(PhotonMode.Off)
    pause(2000)
})

hifriday
 
Posts: 2
Joined: Fri Feb 14, 2020 12:03 am

Please be positive and constructive with your questions and comments.