Residual flashing effect on iPad after running screen flashing code in Codea

I’m posting this as Code Sharing rather than Bugs as I seem to have discovered an iPad fault rather than a Codea bug.

I installed Codea today and thought I would try testing the effect of swapping the screen color repeatedly from black to white. I wrote the code below, it ran fine, a few minutes later I ran again and left it running for a minute or so. When I stopped the code running there seemed to be the same flashing effect on the screen. At first I thought it was my eyes, but even after doing a proper shutdown (not reset), and power up, the flashing continued. I went back into Codea and ran the Roller Coaster example which stopped the flashing.

So, does anyone know how the iPad can behave like this? I have an iPad 1 btw.

WARNING: The code below made my iPad behave funny, so use it at your own risk.

function setup()
    displayMode(FULLSCREEN)
    scolor = 0
end

function draw()
    -- This sets the background color to black or white
    -- depending on the scolor value.
    if scolor == 0 then
        background(0, 0, 0, 255)
        scolor = 1
    else
        background(255, 255, 255, 255)
        scolor = 0
    end
end
1 Like

It could have something to do with the LCD switching technology.

Some LCD screens will exhibit strange behaviour when asked to render interleaved 1-pixel wide black-and-white lines. Flickering the crystals between ‘on’ and ‘off’ at a maximum rate for extended periods could do something to the hardware.

Codea can’t take any actions outside of the app itself — so this sort of thing definitely sounds like you are pushing the hardware.

Certainly makes sense. I will call it a day on this sort of testing.