From 282a12bcce97778b2de8b3e7f4b92fc795fe2412 Mon Sep 17 00:00:00 2001 From: Tilman Date: Sat, 1 Feb 2020 15:14:29 +0000 Subject: [PATCH] Add new file pro_micro.ino --- pro_micro/pro_micro.ino | 52 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 pro_micro/pro_micro.ino diff --git a/pro_micro/pro_micro.ino b/pro_micro/pro_micro.ino new file mode 100644 index 0000000..ecb55b2 --- /dev/null +++ b/pro_micro/pro_micro.ino @@ -0,0 +1,52 @@ +/* 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 +} \ No newline at end of file