Thanks for that,
say i wanted to parse a file to create classes that are defined in the file
GP5=ToggleSwitch,"TABLE SWITCH", 5, 0, 1
GP4=LED,"MAIN LIGHT",4,1,1
where ToggleSwitch and LED are objects i want to create.
again maybe I am tryharding.
Search found 4 matches
- Thu Sep 16, 2021 9:10 am
- Forum: Raspberry Pi microcontroller boards
- Topic: dynamically set up pin classes
- Replies: 4
- Views: 3022
- Wed Sep 15, 2021 1:54 pm
- Forum: General Discussion and Questions
- Topic: Any clever ways to set up pins
- Replies: 4
- Views: 2562
Re: Any clever ways to set up pins
Ah so you would define all in a separate .py file. I was hoping to try a human readable something like the following: GP5=ToggleSwitch,"TABLE SWITCH", 5, Pin.OUT, Pin.PULL_UP create variable called GP5 that is an instance of ToggleSwitch with the following values as its constructor. maybes im just c...
- Wed Sep 15, 2021 8:56 am
- Forum: General Discussion and Questions
- Topic: Any clever ways to set up pins
- Replies: 4
- Views: 2562
Any clever ways to set up pins
Hi all,
Does anyone know of a clever way to set up pins from a config file ?
Id like to create a generic firmware that is able to load a config file to set up pins with pyb classes.
THanks in advance
Does anyone know of a clever way to set up pins from a config file ?
Id like to create a generic firmware that is able to load a config file to set up pins with pyb classes.
THanks in advance
- Tue Sep 14, 2021 3:27 pm
- Forum: Raspberry Pi microcontroller boards
- Topic: dynamically set up pin classes
- Replies: 4
- Views: 3022
dynamically set up pin classes
Hi Gang, I would like my PICOs pins to be somewhat dynamically initialised when the PICO loads using some sort of file. To now my idea is to have a config.txt file with something like the following. in the example below the CSV variables represent a class and a setup: GP5=ToggleSwitch,"TABLE SWITCH"...