Add README and LED control to all arduino projects
This commit is contained in:
parent
01bae12644
commit
35a869bb49
3
src/board/arduino/mega2560/README.md
Normal file
3
src/board/arduino/mega2560/README.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# Arduino Mega 2560
|
||||||
|
|
||||||
|

|
@ -1,14 +1,19 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#include <arch/gpio.h>
|
||||||
#include <arch/uart.h>
|
#include <arch/uart.h>
|
||||||
|
|
||||||
void init(void) {
|
void init(void) {
|
||||||
uart_stdio_init(0, 9600);
|
uart_stdio_init(0, 9600);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct Gpio LED = GPIO(B, 7);
|
||||||
|
|
||||||
int main(void) {
|
int main(void) {
|
||||||
init();
|
init();
|
||||||
|
|
||||||
|
gpio_set_dir(&LED, true);
|
||||||
|
gpio_set(&LED, false);
|
||||||
printf("Hello from System76 EC for the Arduino Mega 2560!\n");
|
printf("Hello from System76 EC for the Arduino Mega 2560!\n");
|
||||||
for (;;) {
|
for (;;) {
|
||||||
int c = getchar();
|
int c = getchar();
|
||||||
|
3
src/board/arduino/micro/README.md
Normal file
3
src/board/arduino/micro/README.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# Arduino Micro
|
||||||
|
|
||||||
|

|
@ -1,14 +1,19 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#include <arch/gpio.h>
|
||||||
#include <arch/uart.h>
|
#include <arch/uart.h>
|
||||||
|
|
||||||
void init(void) {
|
void init(void) {
|
||||||
uart_stdio_init(0, 9600);
|
uart_stdio_init(0, 9600);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct Gpio LED = GPIO(C, 7);
|
||||||
|
|
||||||
int main(void) {
|
int main(void) {
|
||||||
init();
|
init();
|
||||||
|
|
||||||
|
gpio_set_dir(&LED, true);
|
||||||
|
gpio_set(&LED, false);
|
||||||
printf("Hello from System76 EC for the Arduino Micro!\n");
|
printf("Hello from System76 EC for the Arduino Micro!\n");
|
||||||
for (;;) {
|
for (;;) {
|
||||||
int c = getchar();
|
int c = getchar();
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
# Arduino Uno
|
# Arduino Uno
|
||||||
|
|
||||||

|

|
||||||
|
Loading…
x
Reference in New Issue
Block a user