Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'TMBoards' object has no attribute 'switches' #1

Open
Adorfer opened this issue Mar 13, 2018 · 7 comments
Open

AttributeError: 'TMBoards' object has no attribute 'switches' #1

Adorfer opened this issue Mar 13, 2018 · 7 comments

Comments

@Adorfer
Copy link

Adorfer commented Mar 13, 2018

how are the sitches supposed to be read out?

   a= TM.switches[0]

(as from the readme.md) results to

  AttributeError: 'TMBoards' object has no attribute 'switches'
@Adorfer
Copy link
Author

Adorfer commented Mar 14, 2018

BTW: https://github.com/rjbatista/tm1638-library/blob/master/TM1638.cpp could be a hint, how the button-reading works.

@dazrave
Copy link

dazrave commented Dec 24, 2019

I assume the fact it says "to be continued" within the code, it's not a feature to read the buttons yet.

		"""Update the values
		:param
		TMindex: (int) index of the TMBoard used to update the switches. If None all the Boards are asked for new values
		"""
		# get the raw data from the TM
		for t in range(self.nbBoards) if TMindex is None else [TMindex]:
			d = self.getData(t)
			# TODO: to be continued

@Adorfer
Copy link
Author

Adorfer commented Jan 4, 2020

if someone could add this, it would be much appreciated.

@thilaire
Copy link
Owner

thilaire commented Jan 4, 2020

I don't have the TM1638 to test it anymore, but I will see what I can do quite quickly

@Adorfer
Copy link
Author

Adorfer commented Jan 4, 2020

if you want to have one donated via amazon, let me know, our give your paypal...

@dazrave
Copy link

dazrave commented Jan 6, 2020

if you want to have one donated via amazon, let me know, our give your paypal...

I second this. Happy to go 50/50 with @Adorfer and get one over to you somehow @thilaire, if you could spare the time that is.

@thilaire
Copy link
Owner

thilaire commented Jan 9, 2020

Thank you for your support/remarks, I appreciate.
I have added some code to support the switches, but for the moment I do not have the possibility to test it right now (maybe in few days, I hope). I am not sure if it works or not (it should, but there is surely one bug or something stupid missing).

The TMBoard object has now a switches property : TM.switches[n] gives you the value of the n-th switch, on line K0. TM.switches[K,n] gives you the n-th switch on line K (K between 0 and 2). n between 0 and 7 are for the 1st TMboard, 8 to 15 for the 2nd, etc. (when the board are chained, as I used to used them).

Maybe I won't work at first time, but I will fix it with your feedback.

Do not hesitate to tell me how you want to use it (TM.switches[] returns a boolean, but maybe you prefer a int. Also, maybe you want to get all the switches in oen call: I can add a support for something like TM.switches[0:8] to get a list of boolean, or maybe just one int... It's up to you. Also, should the K be between 0 and 2, or between 1 and 3 as in the documentation)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants