Files
microcontroller/pro_micro/pro_micro.ino
T
2020-02-01 15:14:29 +00:00

52 lines
2.1 KiB
Arduino

/* Pro Micro Test Code
Code von https://codebender.cc/sketch:77845#Pro%20Micro%20Blink.ino
Zuerst musste unter Ubuntu der Modem Manager entfernt werden mit, s. https://community.arduboy.com/t/resolved-issues-uploading-with-ubuntu-18-10-and-arduino-1-8-9/7447/4
sudo systemctl disable ModemManager.service
In den Preferences die zusätzliche Quell-URL eintragen, s. https://learn.sparkfun.com/tutorials/pro-micro--fio-v3-hookup-guide/all#installing-mac--linux
https://raw.githubusercontent.com/sparkfun/Arduino_Boards/master/IDE_Board_Manager/package_sparkfun_index.json
Danach über den Board Manager die Sparkfun AVR installieren und als Board "Sparkfun Pro Micro" und Provil 5V 16MHz auswählen.
Upload über den neuen seriellen Port /dev/ACM3
Troubleshooting, wenn bricked:
- ModemManager abschalten
sudo systemctl disable ModemManager.service
- Pro Micro mit USB-Port verbinden
- 2x schnell hintereinander RST mit GND verbinden, danach 8s Zeit für den Upload https://learn.sparkfun.com/tutorials/pro-micro--fio-v3-hookup-guide/troubleshooting-and-faq#ts-revive
- Upload mit
sudo ./arduino --upload /root/Arduino/pro_micro/pro_micro.ino --port /dev/ttypACM3
Auch hilfreich:
ls /dev/ttyA*
lsusb
*/
int RXLED = 17; // The RX LED has a defined Arduino pin
// The TX LED was not so lucky, we'll need to use pre-defined
// macros (TXLED1, TXLED0) to control that.
// (We could use the same macros for the RX LED too -- RXLED1,
// and RXLED0.)
void setup() {
pinMode(RXLED, OUTPUT); // Set RX LED as an output
// TX LED is set as an output behind the scenes
Serial.begin(9600); //This pipes to the serial monitor
Serial1.begin(9600); //This is the UART, pipes to sensors attached to board
}
void loop() {
Serial.println("Hello world"); // Print "Hello World" to the Serial Monitor
Serial1.println("Hello!"); // Print "Hello!" over hardware UART
digitalWrite(RXLED, LOW); // set the LED on
TXLED0; //TX LED is not tied to a normally controlled pin
delay(3000); // wait for a second
digitalWrite(RXLED, HIGH); // set the LED off
TXLED1;
delay(3000); // wait for a second
}