ka
This commit is contained in:
26
INF/i2c/i2c.ino
Normal file
26
INF/i2c/i2c.ino
Normal file
@@ -0,0 +1,26 @@
|
||||
#include "Wire.h"
|
||||
// absch -> Abschreiben
|
||||
|
||||
void setup() {
|
||||
Wire.begin();
|
||||
Serial.begin(115200);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
// Daten senden
|
||||
// 0b um in 0 und 1 zu schreiben ansonsten Hex
|
||||
// 0111 <- absch. 0000 <- Jumper ablesen
|
||||
Wire.beginTransmission(0b0111000);
|
||||
//Wire.write(0b00001111); // da LED LOW Active 0->AN, 1->AUS; mann muss 8 Bits machen
|
||||
//Wire.endTransmission();
|
||||
delay(500);
|
||||
|
||||
// Daten empfangen
|
||||
byte Daten1; // 1 Byte deklarieren
|
||||
Wire.requestFrom(0b0100110, 1);
|
||||
if (Wire.available() >= 1){
|
||||
Daten1 = Wire.read(); // Daten lesen
|
||||
Wire.write(Daten1);
|
||||
}
|
||||
Wire.endTransmission();
|
||||
}
|
||||
9
INF/pwm_lernen/pwm_lernen.ino
Normal file
9
INF/pwm_lernen/pwm_lernen.ino
Normal file
@@ -0,0 +1,9 @@
|
||||
void setup() {
|
||||
// put your setup code here, to run once:
|
||||
ledcAttach(12, 50, 10);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
// put your main code here, to run repeatedly:
|
||||
ledcWrite(12, )
|
||||
}
|
||||
9
progp/25-2-6/buuble-sort.py
Normal file
9
progp/25-2-6/buuble-sort.py
Normal file
@@ -0,0 +1,9 @@
|
||||
arr_test = [4,5,9,1,3]
|
||||
|
||||
for i in range(len(arr_test)):
|
||||
if arr_test[i] > arr_test[i + 1]:
|
||||
temp = arr_test[i]
|
||||
arr_test[i] = arr_test[i + 1]
|
||||
arr_test[i + 1] = temp
|
||||
|
||||
print(arr_test)
|
||||
Reference in New Issue
Block a user