Last active
February 5, 2021 01:41
-
-
Save bakueikozo/5b5ca10a7511ce3c8403088c7550c9a0 to your computer and use it in GitHub Desktop.
This file contains 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
/** | |
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd. | |
* | |
* SPDX-License-Identifier: BSD-3-Clause | |
*/ | |
#include "pico/stdlib.h" | |
int main() { | |
int pinFirst=0; | |
int pinLast=15; | |
for(int n=0;n<=pinLast;n++){ | |
gpio_init(n); | |
gpio_set_dir(n, GPIO_OUT); | |
} | |
while (true) { | |
gpio_put(0, 1); | |
gpio_put(0, 0); | |
gpio_put(1, 1); | |
gpio_put(1, 0); | |
gpio_put(2, 1); | |
gpio_put(2, 0); | |
gpio_put(3, 1); | |
gpio_put(3, 0); | |
gpio_put(4, 1); | |
gpio_put(4, 0); | |
gpio_put(5, 1); | |
gpio_put(5, 0); | |
gpio_put(6, 1); | |
gpio_put(6, 0); | |
gpio_put(7, 1); | |
gpio_put(7, 0); | |
gpio_put(8, 1); | |
gpio_put(8, 0); | |
gpio_put(9, 1); | |
gpio_put(9, 0); | |
gpio_put(10, 1); | |
gpio_put(10, 0); | |
gpio_put(11, 1); | |
gpio_put(11, 0); | |
gpio_put(12, 1); | |
gpio_put(12, 0); | |
gpio_put(13, 1); | |
gpio_put(13, 0); | |
gpio_put(14, 1); | |
gpio_put(14, 0); | |
gpio_put(15, 1); | |
gpio_put(15, 0); | |
} | |
} | |
This file contains 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
int main() { | |
int pinFirst=0; | |
int pinLast=15; | |
for(int n=0;n<=pinLast;n++){ | |
gpio_init(n); | |
gpio_set_dir(n, GPIO_OUT); | |
} | |
while (true) { | |
for(int n=pinFirst;n<=pinLast;n++){ | |
gpio_put(n, 1); | |
} | |
for(int n=pinFirst;n<=pinLast;n++){ | |
gpio_put(n, 0); | |
} | |
} | |
} |
This file contains 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
/** | |
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd. | |
* | |
* SPDX-License-Identifier: BSD-3-Clause | |
*/ | |
#include "pico/stdlib.h" | |
int main() { | |
int pinFirst=0; | |
int pinLast=15; | |
for(int n=0;n<=pinLast;n++){ | |
gpio_init(n); | |
gpio_set_dir(n, GPIO_OUT); | |
} | |
while (true) { | |
gpio_put(0, 1); | |
gpio_put(1, 1); | |
gpio_put(2, 1); | |
gpio_put(3, 1); | |
gpio_put(4, 1); | |
gpio_put(5, 1); | |
gpio_put(6, 1); | |
gpio_put(7, 1); | |
gpio_put(8, 1); | |
gpio_put(9, 1); | |
gpio_put(10, 1); | |
gpio_put(11, 1); | |
gpio_put(12, 1); | |
gpio_put(13, 1); | |
gpio_put(14, 1); | |
gpio_put(15, 1); | |
gpio_put(0, 0); | |
gpio_put(1, 0); | |
gpio_put(2, 0); | |
gpio_put(3, 0); | |
gpio_put(4, 0); | |
gpio_put(5, 0); | |
gpio_put(6, 0); | |
gpio_put(7, 0); | |
gpio_put(8, 0); | |
gpio_put(9, 0); | |
gpio_put(10, 0); | |
gpio_put(11, 0); | |
gpio_put(12, 0); | |
gpio_put(13, 0); | |
gpio_put(14, 0); | |
gpio_put(15, 0); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment