I'd like to set a specific script to load when launching my Adafruit Macropad. I wrote a script with no active buttons (in case I accidentally hit one) and a blank title (to stop burning the title of the current default into the screen). I've tried changing the script's name and the last save date with no effect. Any suggestions?
Thanks very much!
How can I set the default script on my Adafruit Macropad?
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- mdump
- Posts: 7
- Joined: Thu Feb 10, 2022 11:56 am
- dastels
- Posts: 15665
- Joined: Tue Oct 20, 2015 3:22 pm
Re: How can I set the default script on my Adafruit Macropad?
What do you mean by script? A C++ program or CircuitPython program? Talking about filenames and modification dates makes me thing it's CircuitPython.
What do you mean by "default"? You can have one program on the MacroPad at a time.
Dave
What do you mean by "default"? You can have one program on the MacroPad at a time.
Dave
- mdump
- Posts: 7
- Joined: Thu Feb 10, 2022 11:56 am
Re: How can I set the default script on my Adafruit Macropad?
Hi, thanks for helping me clarify my question.
I use several CircuitPython programs on the Macropad (I called them "scripts").
When I power up the Macropad, it defaults to one of these programs - always the same one.
I'd like to change the default program to start when I power the device on.
I don't know how to do this.
Thanks again!
I use several CircuitPython programs on the Macropad (I called them "scripts").
When I power up the Macropad, it defaults to one of these programs - always the same one.
I'd like to change the default program to start when I power the device on.
I don't know how to do this.
Thanks again!
- dastels
- Posts: 15665
- Joined: Tue Oct 20, 2015 3:22 pm
Re: How can I set the default script on my Adafruit Macropad?
Can you post your code. I still don't have a good picture of what it's doing.
Dave
Dave
- mdump
- Posts: 7
- Joined: Thu Feb 10, 2022 11:56 am
Re: How can I set the default script on my Adafruit Macropad?
There are several hotkey .py programs I run on the Macropad under CircuitPython 7. They run fine. The problem I'd like solved is that when I plug the USB into the macropad, the first opening program is Ultraedit.py.
Once the macropad is on, I use the rotary knob to select other hotkey programs, such as Pause.py. When the macropad is first turned on by plugging in the USB, I'd rather the first program that shows is Pause.py, not Ultraedit.py.
I've attached the entire directory contents on the macropad. The macros I use are in the macros directory.
Thanks!
[/i][/i]
Once the macropad is on, I use the rotary knob to select other hotkey programs, such as Pause.py. When the macropad is first turned on by plugging in the USB, I'd rather the first program that shows is Pause.py, not Ultraedit.py.
I've attached the entire directory contents on the macropad. The macros I use are in the macros directory.
Thanks!
[/i][/i]
- Attachments
-
- Allfiles.zip
- (131.87 KiB) Downloaded 6 times
- dastels
- Posts: 15665
- Joined: Tue Oct 20, 2015 3:22 pm
Re: How can I set the default script on my Adafruit Macropad?
OK, Ultraedit is the "default" because after apps is sorted it contains:
and apps[0] is started initially. Renaming the one you want to be "default" to start with an uppercase and everything else start with a lowercase should do the job.
Dave
Code: Select all
['Ultraedit', 'gsheets', 'media', 'mouse', 'navigate', 'pause', 'tones']
Dave
- blakebr
- Posts: 957
- Joined: Tue Apr 17, 2012 6:23 pm
Re: How can I set the default script on my Adafruit Macropad?
Hi,
This is how I select what file.py is run at next boot. If you want you can test for grounded pin(s) to determine what program starts.
Bruce
This is how I select what file.py is run at next boot. If you want you can test for grounded pin(s) to determine what program starts.
Bruce
Code: Select all
_ = 3
if _ == 1:
import Weather_code
elif _ == 2:
import Scan_WiFi_code
elif _ == 3:
import TFT_Colors_code
elif _ == 4:
import Kattni_Rembor
elif _ == 5:
import ansi_escape_code_simpletest
elif _ == 6:
import ansi_escape_code__cursor_position_dev
- mdump
- Posts: 7
- Joined: Thu Feb 10, 2022 11:56 am
Re: How can I set the default script on my Adafruit Macropad?
Thank you all! The simple "rename to DEFAULT" worked perfectly.
Thanks again -
Charlie
Thanks again -
Charlie
Please be positive and constructive with your questions and comments.