/* * Hello World * Created: 2024 * * Pindescription Arduino Nano * No. Funkt. PIN-Micro Used as Resultierende * Board Controller Input/Output Pindefinition * 0 RX PD0 RX In / 0 * 1 TX PD1 TX In / 0 *****Siehe Init.h***** * 2 INT0 PD2 US_Echo In / 0 * 3 INT1 PD3 Encoder In / 0 * 4 T0In PD4 Colour In / 0 * 5 Digit PD5 BLnWH In / 0 Data Direction Register Port D * 6 Digit PD6 Push_2 In / 0 Taster vorne * 7 Digit PD7 US_Trig Out/ 1 -> DDRD = 0b10000000 (nach Init.h übertragen!) * * 8 Digit PB0 Motor-A Out/ 1 * 9 OC1A PB1 PWM-A Out/ 1 *10 OC1B PB2 PWM-B Out/ 1 *11 Digit PB3 Motor-B Out/ 1 *12 Digit PB4 Servo Out/ 1 Data Direction Register Port B *13 LED PB5 LED Out/ 1 -> DDRB = 0b00111111 * Port B 6 und 7 sind nicht änderbar *A0 Ana PC0 Dist-2 In / 0 *A1 Ana PC1 Dist-3 In / 0 *A2 Ana PC2 Dist-4 In / 0(evtl.) *A3 Digit PC3 Push_1 In/ 1 Start-Taster (LOP-Taster) *A4 Digit PC4 SDA In / 0 Data Direction Register Port C *A5 Digit PC5 SCL In / 0 -> DDRC = 0b00000000 *A6 Ana ADC6 Dist-0 Port C 6 und 7 sind immer Analogkanäle *A7 Ana ADC7 Dist-1 */ #define LED 13 //LED of the Arduino board is mounted at Pin 13 void setup() { pinMode(LED, OUTPUT); Serial.begin(74880); /*Alternative Programmierung:*****************************************/ //Init(); //Initalize the MC /*Alternative Programmierung Ende*************************************/ } void loop() { /***Testschleife**************************/ while(0) { Serial.println(123); } /***Ende Testschleife********************/ while (1) { //At Pin 5 PORTB the LED of the Arduino board is mounted (Pin 13) digitalWrite(LED, HIGH); //Push PORTB pin 5 high (LED, pin 13 "Uno") // _delay_ms(500); // digitalWrite(LED, LOW); //Push PORTB pin 5 low (LED, pin 13 "Uno") // __delay_ms(500); /*Alternative Programmierung:*****************************************/ //PORTB |= (1 << PORTB5); //Push PORTB pin 5 high (LED, pin 13 "Uno") //PORTB &= ~(1 << PORTB5); //~ = "NOT" Operator, 1<<5 shifts the "1" five times to the left //A not A //0 1 //1 0 //PINB |= (1<