Black Lives Matter - Action and Equality. ... Adafruit is open and shipping.
0

Clue Board White Leds
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Clue Board White Leds

by JKD on Sun Jun 28, 2020 2:12 pm

Hello

Wonder if anyone can clear up my confusion? This is about controlling the 2 white led on the display side of the board

Have just received my long awaited clue board which i am finding so much fun to learn about

In the readthedocs api reference it states to set clue.white_leds to True to turn on & clue.white_leds to False to turn off after importing clue module
Now this works fine

But in the pinout section of the introduction to clue webpages it states to use board.WHITE_LEDS after importing board module - this i cannot seem to make work - if i set board.WHITE_LEDS to True nothing happens!

What am i doing wrong in this case do you think?

Also for a bonus point why would you use one method over the other?

Regards

JKD

JKD
 
Posts: 14
Joined: Sat Jul 22, 2017 8:04 pm

Re: Clue Board White Leds

by dastels on Sun Jun 28, 2020 3:42 pm

board.WHITE_LEDS is the output pin that the LEDs are connected to. So you would need to make a DigitalInOut object from it, make it an output, and set its value to True/False to control the LEDs.

clue.white_leds wraps that all up in a easy to use property that you assign to. That's the value of the CLUE module... it lets you interact with the hardware at a conceptual level, and not at a nitty-gritty detail level. The power of abstraction put to work!

Dave

dastels
 
Posts: 2829
Joined: Tue Oct 20, 2015 3:22 pm

Re: Clue Board White Leds

by JKD on Sun Jun 28, 2020 4:34 pm

Hi Dave

Ahh i understand now!!!

Forgive my previous lack of understanding!

I am afraid much of my programming knowledge & practices are still firmly rooted in the late 1970's when i learnt to program using a combination of Mainframe at the local University via punch cards as well as the solitary Commodore Pet 2001 8K, which was all my school had at the time!

Hope You & those you care about are all safe ?

TTFN

Jason

JKD
 
Posts: 14
Joined: Sat Jul 22, 2017 8:04 pm

Re: Clue Board White Leds

by dastels on Sun Jun 28, 2020 4:53 pm

No worries. There's lots to learn! Generally members of the board module will give you pins, while the wrapper modules such as clue.py or circuitplayground.py will provide higher level access to the board's hardware.

I got started on a PET 2001 as well. That was some time, and a long career, ago.

I/we are doing well. I trust you and yours are as well.

Dave

dastels
 
Posts: 2829
Joined: Tue Oct 20, 2015 3:22 pm

Please be positive and constructive with your questions and comments.