Skip to content

Instantly share code, notes, and snippets.

@bakueikozo
Last active February 5, 2021 01:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bakueikozo/5b5ca10a7511ce3c8403088c7550c9a0 to your computer and use it in GitHub Desktop.
Save bakueikozo/5b5ca10a7511ce3c8403088c7550c9a0 to your computer and use it in GitHub Desktop.
/**
* 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);
}
}
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);
}
}
}
/**
* 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