-
Notifications
You must be signed in to change notification settings - Fork 85
Led factory test for Provisioning 2.0 sketch #577
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
Open
fabik111
wants to merge
8
commits into
arduino-libraries:master
Choose a base branch
from
fabik111:led-factory-test
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
43e80b3
add parse date function instead of sscanf
fabik111 e333759
add networkconfigurator include
fabik111 201101b
enable NetworkConfigurator for nina boards
fabik111 440f9ef
Provisioning sketch version 0.4.0
fabik111 c9af652
fix for rp2040 crashes when getting board UHWID
fabik111 a2609c7
Provisioning sketch version 0.4.1
fabik111 be65e87
add factory led test
fabik111 b94f2aa
Provisioning sketch version 0.5.0
fabik111 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| /* | ||
| Copyright (c) 2025 Arduino SA | ||
|
|
||
| This Source Code Form is subject to the terms of the Mozilla Public | ||
| License, v. 2.0. If a copy of the MPL was not distributed with this | ||
| file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
| */ | ||
|
|
||
| #pragma once | ||
| #include <Arduino.h> | ||
| #include <ANetworkConfigurator_Config.h> | ||
|
|
||
| #ifdef BOARD_USE_NINA | ||
| #include "WiFiNINA.h" | ||
| #include "utility/wifi_drv.h" | ||
| #endif | ||
|
|
||
| inline void LedFactoryTest() { | ||
| #if defined(BOARD_HAS_RGB) | ||
| #if defined(BOARD_USE_NINA) | ||
| // MKR WiFi 1010, RP2040 Connect | ||
| WiFiDrv::pinMode(GREEN_LED, OUTPUT); | ||
| WiFiDrv::digitalWrite(GREEN_LED, LED_OFF); | ||
| WiFiDrv::pinMode(BLUE_LED, OUTPUT); | ||
| WiFiDrv::digitalWrite(BLUE_LED, LED_OFF); | ||
| WiFiDrv::pinMode(RED_LED, OUTPUT); | ||
| WiFiDrv::digitalWrite(RED_LED, LED_OFF); | ||
| pinMode(LED_BUILTIN, OUTPUT); | ||
| digitalWrite(LED_BUILTIN, LED_OFF); | ||
|
|
||
| for(uint8_t i = 0; i<2; i++){ | ||
| digitalWrite(LED_BUILTIN, LED_ON); | ||
| WiFiDrv::digitalWrite(RED_LED, LED_ON); | ||
| delay(300); | ||
| digitalWrite(LED_BUILTIN, LED_OFF); | ||
| WiFiDrv::digitalWrite(RED_LED, LED_OFF); | ||
| WiFiDrv::digitalWrite(GREEN_LED, LED_ON); | ||
| delay(300); | ||
| digitalWrite(LED_BUILTIN, LED_ON); | ||
| WiFiDrv::digitalWrite(GREEN_LED, LED_OFF); | ||
| WiFiDrv::digitalWrite(BLUE_LED, LED_ON); | ||
| delay(300); | ||
| digitalWrite(LED_BUILTIN, LED_OFF); | ||
| WiFiDrv::digitalWrite(BLUE_LED, LED_OFF); | ||
| delay(200); | ||
| } | ||
| #else | ||
| // Portenta H7, Giga, Nicla Vision, Portenta C33 | ||
| pinMode(GREEN_LED, OUTPUT); | ||
| digitalWrite(GREEN_LED, LED_OFF); | ||
| pinMode(RED_LED, OUTPUT); | ||
| digitalWrite(RED_LED, LED_OFF); | ||
| pinMode(BLUE_LED, OUTPUT); | ||
| digitalWrite(BLUE_LED, LED_OFF); | ||
| for(uint8_t i = 0; i<2; i++){ | ||
| digitalWrite(RED_LED, LED_ON); | ||
| delay(300); | ||
| digitalWrite(RED_LED, LED_OFF); | ||
| digitalWrite(GREEN_LED, LED_ON); | ||
| delay(300); | ||
| digitalWrite(GREEN_LED, LED_OFF); | ||
| digitalWrite(BLUE_LED, LED_ON); | ||
| delay(300); | ||
| digitalWrite(BLUE_LED, LED_OFF); | ||
| delay(200); | ||
| } | ||
| #endif | ||
| #else // Nano 33 IoT | ||
| pinMode(LED_BUILTIN, OUTPUT); | ||
| digitalWrite(LED_BUILTIN, LED_OFF); | ||
| uint32_t start = millis(); | ||
| while(millis() - start < 2000) { | ||
| digitalWrite(LED_BUILTIN, LED_ON); | ||
| delay(300); | ||
| digitalWrite(LED_BUILTIN, LED_OFF); | ||
| delay(300); | ||
| } | ||
| #endif | ||
|
|
||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.