Light Sensor not working [Solved]

edited December 2022 in Hardware Support

Few weeks ago it still worked but now it gave these errors (see picture attached). Got it working when I updated the Pico firmware using MicroBlocks update command :)


  • Turgut
    edited December 2022

    I am assuming there is no problem now ?

    Also, a quick pointer for coding:

    Your two when PicoBricks light sensor scripts are already detecting the conditions of interest to you. You could simply graph them in their respective scripts and eliminate the when started script. That one is in a tight forever loop, churning your cycles without any need.

    It does not matter for this small project, but if you had other activities going on, you could provide some relief to your project by adding small wait cycles in the two when scripts; thus improving the responsiveness of the code. With an event resolution of 20usecs, MicroBlocks will examine these conditions 50K times a second; a bit of overkill! Since environmental light conditions do not vary that suddenly, your project might be happy with a lesser sampling, eg: wait 500ms.

    Enjoy exploring MicroBlocks.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!