-
Datei
sketch_miele3.ino
// DÜNSTABZUGSHAUBE DA-73 MIELE // Arduino Uno Rev.3 // Programm: Peter und Marian Barton // Stand 07.12.2013 #include <EEPROM.h> // Konstanten Deklaration int IN2 = 14; // Tastenfeld: int IN3 = 15; int IN4 = 16; int IN5 = 17; int IN6 = 18; int OUT7 = 10; // Triacs Steuerung: int OUT8 = 11; int OUT9 = 12; int OUT22 = 8; int OUT14 = 13; // LED Ausgabe: int OUT15 = 19; int OUT16 = 2; int OUT17 = 3; int OUT18 = 4; int OUT19 = 5; int OUT20 = 6; int OUT21 = 7; int OUT23 = 9; // Licht Relais: long timer15 = 90000; long timer30 = 180000; unsigned long filterTime = 10800000; int ledFeld[2][5]; //LED Matrix
in „Microcontroller für Abzugshaube (Miele DA73)“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Servo_abstand_LCD.ino
#include <TFT.h> #include <SPI.h> #include <Servo.h> #define echo 4 #define trig 10 #define CS A3 #define DC A2 #define RES 7 #define MOSI 6 #define SCLK 2 Adafruit_ST7735 screen = Adafruit_ST7735(CS, DC, MOSI, SCLK, RES); Servo myservo; // create servo object to control a servo // a maximum of eight servo objects can be created int dis; char disC[5]; String disS; int pos = 0; // variable to store the servo position void abstand(){ digitalWrite(trig, LOW); delayMicroseconds(2); digitalWrite(trig, HIGH); delayMicroseconds(10); digitalWrite(trig, LOW); dis = pulseIn(echo, HIGH); disS = String(dis
in „Servo Arduino“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Servo_abstand_LCD.ino
#include <TFT.h> #include <SPI.h> #include <Servo.h> #define echo 4 #define trig 10 #define CS A3 #define DC A2 #define RES 7 #define MOSI 6 #define SCLK 2 Adafruit_ST7735 screen = Adafruit_ST7735(CS, DC, MOSI, SCLK, RES); Servo myservo; // create servo object to control a servo // a maximum of eight servo objects can be created int dis; char disC[5]; String disS; int pos = 0; // variable to store the servo position int freeRam () { extern int __heap_start, *__brkval; int v; return (int) &v - (__brkval == 0 ? (int) &__heap_start : (int) __brkval); } void abstand(){ digitalWrite(trig, LOW); delayMicroseconds
in „Zuckungen Servo Arduino“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
LED_Matrix_Fehler.ino
int a=1,b=0,c=0,d=0,e=0,f=0,g=0,h=0; int input=0; #define display_array_size 8 #define data_null 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 // null char #define data_ascii_A1 a,b,c,d,e,f,g,h /** **"A" #define A { // {0, 0, 0, 0, 0, 0, 1, 0}, //0x02 {0, 0, 0, 0, 1, 1, 0, 0}, //0x0C {0, 0, 0, 1, 1, 0, 0, 0}, //0x18 {0, 1, 1, 0, 1, 0, 0, 0}, //0x68 {0, 1, 1, 0, 1, 0, 0, 0}, //0x68 {0, 0, 0, 1, 1, 0, 0, 0}, //0x18 {0, 0, 0, 0, 1, 1, 0, 0}, //0x0C {0, 0, 0, 0, 0, 0, 1, 0} //0x02 } **/ byte data_ascii[][display_array_size] = { data_null, data_ascii_A1 }; const int row1 = 2; // the number of the
in „Definieren von variable im laufenden Programm“ · Softwareentwicklung ·
-
Datei
LED_Matrix_Original.ino
LED_Matrix_Original.ino
in „Definieren von variable im laufenden Programm“ · Softwareentwicklung ·
-
Datei
LED_Matrix_Fehler.ino
unsigned int input=0; unsigned int in; unsigned int a[8]; #define display_array_size 8 #define data_null 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 // null char byte data_ascii[][display_array_size] = { data_null, {a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7]} }; const int row1 = 2; // the number of the row pin 24 const int row2 = 3; // the number of the row pin 23 const int row3 = 4; // the number of the row pin 22 const int row4 = 5; // the number of the row pin 21 const int row5 = 17; // the number of the row pin 4 const int row6 = 16; // the number of the row pin 3 const int row7 = 15; // the
in „2 stellige Zahl Seriell übertragen“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
sensorless_bl_test.ino
/* 3 = HIGH A 5 = HIGH B 6 = HIGH C 9 = LOW A 10 = LOW B 11 = LOW C */ byte state = 1; int bmf_a = 0; int bmf_b = 0; int bmf_c = 0; int bmf_all = 0; void setup() { //Serial.begin(9600); pinMode(A0,INPUT); pinMode(A1,INPUT); pinMode(A2,INPUT); pinMode(A3,INPUT); pinMode(3, OUTPUT); pinMode(5, OUTPUT); pinMode(6, OUTPUT); pinMode(9, OUTPUT); pinMode(10, OUTPUT); pinMode(11, OUTPUT); // 4khz PWM TCCR0A = _BV(COM0A1) | _BV(COM0B1) | _BV(WGM00); TCCR0B = _BV(CS01); TCCR1A = _BV(COM1A1) | _BV(COM1B1) | _BV(WGM10); TCCR1B = _BV(CS11); TCCR2A = _BV(COM2A1) | _BV(COM2B1) | _BV(WGM20); TCCR2B = _BV(CS21
in „BLDC Kommutieren“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
TNARX_lcd_komm.ino
int cs = 3; int clock = 4; int data = 5; byte bild[112] ={0,0,0,0,0,0,0,0, //1. Stelle (ganz rechts) c,x,d,b,g,a,e,f x=nicht belegt/keine Auswirkung) 1,0,1,1,0,1,1,1, //2. Stelle: 0 (als Beispiel) 1,0,0,1,0,0,0,0, //3. Stelle: 1 0,0,1,1,1,1,1,0, //4. Stelle: 2 1,0,1,1,1,1,0,0, //5. Stelle: 3 1,0,0,1,1,0,0,1, //6. Stelle: 4 1,0,0,0,1, // Glocke,Schrägstich,MEM,CHAN,x 1,0,0, // 1(DP),0(DQ),0(DR) - 1/2 duty, obere Segmente D54-D112 folgen) //hier beginnt die obere Hälfte 1,0,1,0,1,1,0,1, //7. Stelle: 5 1,0,1,0,1,1,1,1, //8. Stelle: 6 1,0,0,1,0,1,0,0, //9. Stelle: 7 1,0,1,1,1,1,1,1, //10. Stelle: 8 1,0,1,1,1,1,0,1
in „Dokumentation gesucht (UC121902-TNARX-A)“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Drehgeber_per_interrupt.ino
/* Drehgeberauswertung per Interrupt auf einem AVR. Das gezeigte C-Beispielprogramm läuft auf einem ATmega328. Hier wurde testweise ein Arduino UNO R3 verwendet, da ohne große Löterei Stromversorgung und Datenausgabe über den USB-Anschluß erledigt werden. Zum Test wurde ein mechanischer Drehgeber verwendet, dessen gemeinsamer Anschluß an 0V (GND) liegt. An einem Schaltausgang, hier PHASE_A genannt, wird mit einen 10k Pullup- Widerstand nach +5V (VCC) der '1'-Pegel erzeugt und über ein RC-Glied (Tiefpass) 100k/1nF an den INT0- Eingang des ATmega328 (PORTD.2) gelegt. (beim Arduino: digitaler Eingang "2
in „Drehgeber per Interrupt auswerten, AVR“ · Projekte & Code ·
-
Datei
I2CVersuch.ino
#include "NDP.h" #include <Wire.h> #define ESP_SLAVE_ADDR 0x42 volatile uint8_t matchToSend = 0; void sendit(char* label) { // LED blau bei Match nicla::leds.begin(); nicla::leds.setColor(blue); delay(200); nicla::leds.setColor(off); nicla::leds.end(); if (strcmp(label, "NN0:Helmet") == 0) matchToSend = 0x01; else if (strcmp(label, "NN0:Iron Man") == 0) matchToSend = 0x02; else if (strcmp(label, "NN0:Shutdown") == 0) matchToSend = 0x03; else if (strcmp(label, "NN0:Startup") == 0) matchToSend = 0x04; else if (strcmp(label, "NN0:Repulsor") == 0) matchToSend = 0x05; else if (strcmp(label, "NN0:Stones
-
Datei
I2CESP.ino
#include <Wire.h> #define NICLA_MASTER_ADDR 0x42 #define LED_PIN 2 #define I2C_SDA 19 #define I2C_SCL 16 volatile uint8_t lastMatch = 0; void receiveEvent(int howMany) { while (Wire.available()) { lastMatch = Wire.read(); if (lastMatch != 0) { digitalWrite(LED_PIN, HIGH); delay(150); digitalWrite(LED_PIN, LOW); delay(150); } } } void setup() { pinMode(LED_PIN, OUTPUT); digitalWrite(LED_PIN, LOW); Wire.begin(NICLA_MASTER_ADDR, I2C_SDA, I2C_SCL); Wire.onReceive(receiveEvent); } void loop() { // passiv warten }
-
Datei
BluetoothNiclaKannSenden.ino
#include <ArduinoBLE.h> BLEService testService("12345678-1234-1234-1234-1234567890ab"); BLEByteCharacteristic testChar( "87654321-4321-4321-4321-ba0987654321", BLERead | BLENotify ); uint8_t counter = 1; unsigned long lastSend = 0; void setup() { Serial.begin(115200); BLE.begin(); BLE.setLocalName("NiclaBLETest"); BLE.setAdvertisedService(testService); testService.addCharacteristic(testChar); BLE.addService(testService); testChar.writeValue((byte)0x00); BLE.advertise(); Serial.println("BLE Test Advertised"); } void loop() { BLE.poll(); BLEDevice central = BLE.central(); if (!central || !central.connected
-
Datei
BluetoothESPKAnnEmpfangen.ino
#include <ArduinoBLE.h> BLEDevice nicla; BLECharacteristic testChar; void setup() { Serial.begin(115200); while (!Serial); if (!BLE.begin()) { Serial.println("BLE init failed"); while (1); } Serial.println("ESP BLE scanning..."); BLE.scan(); // 🔥 DAS HAT GEFEHLT } void loop() { BLE.poll(); if (!nicla) { BLEDevice dev = BLE.available(); if (dev) { Serial.print("Found device: "); Serial.println(dev.localName()); if (dev.localName() == "NiclaBLETest") { Serial.println("Connecting to Nicla..."); BLE.stopScan(); if (dev.connect()) { Serial.println("Connected"); dev.discoverAttributes(); testChar = dev.characteristic
-
Datei
FunktionierendeSpamBluetooth.ino
#include "NDP.h" #include <ArduinoBLE.h> // BLE Service & Characteristic UUIDs BLEService matchService("12345678-1234-1234-1234-1234567890AB"); BLEByteCharacteristic matchChar("87654321-4321-4321-4321-BA0987654321", BLERead | BLENotify); volatile uint8_t matchID = 0; volatile bool matchPending = false; volatile int lastLabelIndex = -1; // letztes gesendetes Label merken // Alle Labels in Array definieren const char* labels[] = { "Combat", "Helmet", "Iron Man", "Repulsor", "Shutdown", "Startup", "Stones", "noise", "unknown" }; // Callback bei Match void sendMatch(int labelIndex) { // Nur neues Label
-
Datei
mit_ohne_analogRead.ino
void setup() { pinMode(PC13, OUTPUT); //pinMode(PA5, INPUT); } void loop() { digitalWrite(PC13, LOW); Serial.println("Tick"); delay(500); digitalWrite(PC13, HIGH); Serial.println("Tack"); //Serial.println(analogRead(PA5)); }
in „Warum ist die USB/CDC Implementierung der Cube HAL so groẞ?“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
ntc_cout_demo.ino
/* -------------------------------------------------------- ntc_cout_demo.cpp demonstriert die Verwendung eines abgepeckten cout in Verbindung mit einem NTC-Widerstand 07.03.2026 R. Seelig -------------------------------------------------------- */ #include <Arduino.h> #include "cout_light.h" #include "v003_adc.h" // Objektinstanz fuer cout_light cout_light<HardwareSerial> cout_serial(Serial); ADC ntc1(PD4); // und Umleiten auf den Namen "cout" ... :-) nicht ganz die feine Art #define cout cout_serial // mittels LookUp-Table Generator aus // www.jjflash.de/ntc_table_v2.html erzeugte Tabelle // und
in „CH32V003 und Arduino“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
OLED_Test_30032026.ino
#include "U8glib.h" // Konstruktor anpassen! (Beispiel für SSD1306 I2C) U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NONE); void draw() { int sensorValue = analogRead(A0); // 1024.0 ist Korrektur für 0-5V Umrechnung float voltage = sensorValue * (5.0 / 1024.0); u8g.setFont(u8g_font_unifont); // Position für Legende setzen, drucken u8g.drawStr(2, 10, "Analogwert:"); // Position für Spannung U1 setzen, drucken u8g.setPrintPos(2, 30); u8g.print("U1: "); u8g.print(voltage); int sensorValue1 = analogRead(A1); // 1024.0 ist Korrektur für 0-5V Umrechnung float voltage1 = sensorValue1 * (5.0 / 1024.0); // Position
in „I2C Display einfache Frage“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
avr_adafruit_logodraw.ino
#include <Adafruit_GFX.h> #include <Adafruit_ST7735.h> #include <SPI.h> #define TFT_CS 10 // PB2 #define TFT_RST 6 // PD6 #define TFT_DC 7 // PD7 Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_RST); // RGB565 Farbpallete der "EGA"-Farben uint16_t egapalette [] = { 0x0000, 0x0015, 0x0540, 0x0555, 0xa800, 0xa815, 0xaaa0, 0xad55, 0x52aa, 0x52bf, 0x57ea, 0x57ff, 0xfaaa, 0xfabf, 0xffea, 0xffff }; /* ---------------------------------------------------------- rgbfromvalue Setzt einen 16-Bitfarbwert aus 3 einzelnen Farbwerten fuer (r)ot, (g)ruen und (b)lau zusammen. r,g,b : 8-Bit Farbwerte
in „Turtlegrafik: Interpreter, Creator & Designer“ · Projekte & Code ·
-
Datei
GPS_Time_Arduino.ino
// #include <Wire.h> #include <Adafruit_GFX.h> #include <Adafruit_SSD1306.h> #include <SoftwareSerial.h> #include <TinyGPSPlus.h> // OLED Display Einstellungen (128x64 Pixel über I2C) #define SCREEN_WIDTH 128 #define SCREEN_HEIGHT 64 #define OLED_RESET -1 Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET); // GPS Modul Pins (Rx=4, Tx=5 -> wir nutzen nur Rx an Pin 4 für GPS-TX) SoftwareSerial gpsSerial(4, 5); TinyGPSPlus gps; // Zeitzonen-Offset (z.B. +1 für MEZ / +2 für MESZ Sommerzeit) const int UTC_OFFSET = 2; void setup() { gpsSerial.begin(9600); // Standard-Baudrate der meisten
in „DCF-Uhr from Scratch“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
eventcb_ctrl6.ino
/* -------------------------------------------------------- eventb_ctrl6.ino Eventbasierendes System, hier ganz bewusst ohne Interrupts 11.05.2026 R. Seelig -------------------------------------------------------- */ #include <stdint.h> #include <ctype.h> #include <stdlib.h>
in „Schulnotenbewertung eines Arduino-Programms“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
BLE_Keyboard2.ino
/* Bluetooth BLE Keyboard Use an ESP32 as Bluetooth keyboard. The ESP is connected to the sender PC via USB and sends keystrokes by BLE. Minicom as Key sender: minicom -D /dev/ttyUSB0 Hardware: ESP32 WROOM Framework Arduino ESP32 Libraries needed: https://github.com/HijelHub/HijelHID_BLEKeyboard https://github.com/h2zero/NimBLE-Arduino Inspired from https://class.academany.org/futures/cybersecurity/2026/labs/isafjordur/students/hanndoddi/cyber-road/lapboard/ 2026-08-13 initial version, mchris */ #include <HijelHID_BLEKeyboard.h> HijelHID_BLEKeyboard keyboard; void setup() { Serial.begin(115200);
in „Remote Tastatur“ · Projekte & Code ·
-
Datei
spitftbitmap16bit.ino
#include <SPI.h> //#include "test.h" #include <Time.h> #include <TimeLib.h> #include <Adafruit_GFX.h> // Core graphics library #include <Adafruit_ST7735.h> // Hardware-specific library for ST7735 // TFT display and SD card will share the hardware SPI interface. // Hardware SPI pins are specific to the Arduino board type and // cannot be remapped to alternate pins. For Arduino Uno, // Duemilanove, etc., pin 11 = MOSI, pin 12 = MISO, pin 13 = SCK. #define TFT_CS 7 // Chip select line for TFT display #define TFT_RST 6 // Reset line for TFT (or see below...) #define TFT_DC 5 // Data/command line for
in „Arduino Custom Firmware für Fitness Armband mit NRF52“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
spitftbitmap16bit.ino
#include <SPI.h> //#include "test.h" #include <Time.h> #include <TimeLib.h> #include <Adafruit_GFX.h> // Core graphics library #include <Adafruit_ST7735.h> // Hardware-specific library for ST7735 #define TFT_CS 7 // Chip select line for TFT display #define TFT_RST 6 // Reset line for TFT (or see below...) #define TFT_DC 5 // Data/command line for TFT Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_RST); static const uint8_t _picarray2[78640UL + 1] = {0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00
in „Arduino Custom Firmware für Fitness Armband mit NRF52“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
stopuhr_wifi_test.ino
#include "SSD1306.h" #include <WiFi.h> #include <Wire.h> SSD1306 display(0x3c, 4, 15); unsigned MessungNr = 0; const char* ssid = "homewlan"; const char* password = "password"; // Set web server port number to 80 WiFiServer server(80); // Variable to store the HTTP request String header; // Auxiliar variables to store the current output state String output26State = "off"; String output27State = "off"; // Assign output variables to GPIO pins const int output26 = 26; const int output27 = 27; void udpSetup() { Serial.begin(115200); // Initialize the output variables as outputs pinMode(output26, OUTPUT
in „sketch stört webserver - wer kann helfen?“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Kellerlueftung_20190217_02.ino
#include <LiquidCrystal.h> LiquidCrystal lcd(12, 11, 5, 4, 3, 2); unsigned long previousaMillis = 0; unsigned long previousiMillis = 0; unsigned long previousfMillis = 0; const long intervala = 2000; // Sperrzeit in Millisekunden const long intervali = 2000; const long intervalf = 5000; int zukalt = 6; int feuchte = A2; //Feuchteanzeige int sensorwert; byte feuchtewert; int aussen = A1; // Außentemperatur int aussenwert; int innen = A0; // korrigierte Innentemperatur int freigabe = A3; int hanfun = 7; int exttimer = 10; // zur Synchronisation des timer Signals int timer =8; // Timer boolean e,
in „NTC als spannungsteiler linearisieren?“ · Analoge Elektronik und Schaltungstechnik ·
-
Datei
code_P1.ino
/* ========================================================================================================================================== Librarys =============================================================================================================================================*/ #include "Adafruit_SHT31.h" //temperatur and humidity sensor #include "Adafruit_SSD1306.h" //OLED /* ========================================================================================================================================== Global variable ====================================================
in „Arduino selfmade Internal Clock 8MHz I2C probleme“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
HX711_Tropfen.ino
#include "HX711.h" #include <Servo.h> #include <SPI.h> #include <Wire.h> #include <Adafruit_GFX.h> #include <Adafruit_SH1106.h> #include <Fonts/FreeSans12pt7b.h> #include <Fonts/FreeMonoBold24pt7b.h> #include <RotaryEncoder.h> Adafruit_SH1106 display(-1); // HX711 circuit wiring const int LOADCELL_DOUT_PIN = 2; const int LOADCELL_SCK_PIN = 3; #define SERVO_PIN 4 #define PIEZO_PIN 5 #define Start_PIN A1 RotaryEncoder encoder(A2, A3); #define FilterFaktor 0.5 // running average Filter Einstellung //float val_f; // 0,05 erhöht die Verspätung bei Änderung, macht aber das Wert stabiler int rauschen, Tropfen
in „Tropfenzähler für Arzneimittel mit Waage HX711 und Arduino“ · Projekte & Code ·
-
Datei
sip_klingel_ND.ino
/* ==================================================================== Copyright (c) 2018 Juerge Liegner All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
-
Datei
LCD_Display_Test.ino
#include <LiquidCrystal_I2C.h> LiquidCrystal_I2C lcd(0x27,20,4); void setup() { Serial.begin(9600); lcd.init(); lcd.init(); lcd.backlight(); } void loop() { int sensorValue = analogRead(A0); float voltage = sensorValue * (5.0 / 1023.0); Serial.println(voltage); lcd.setCursor(0,0); lcd.println(voltage); }
in „I2C Display zeigt komische Zeichen“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
dmx-demux4.ino
#include <DMXSerial.h> #include <Adafruit_NeoPixel.h> #include "TimerOne.h" #define PIN 12 #define NUMPIXELS 4 Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_RGB + NEO_KHZ800); const int Pin[] = {6,9,10,11}; int DMX_Values[] = {0,0,0,0}; unsigned int CH[] = {0,0,0,0}; unsigned int buf_CH[] = {0,0,0,0}; int ch_mode[] = {2,2,2,2}; const int buttonPin_ENTER = 14; int buttonState_ENTER = HIGH; const byte interruptPin = 3; #define GATE_IMPULSE 5 #define FREQ 101 unsigned char clock_cn; unsigned int clock_tick; unsigned char i; unsigned long previousMillisS[] = {0,0,0,0}; unsigned
in „Probem mit Arduino DMXSerial und WS2812 / Triac Steuerung“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
dmx-demux3.ino
#include <DMXSerial.h> #include "U8glib.h" #include <EEPROM.h> #include "TimerOne.h" //Timer 1 für die Triac Ansteuerung #include <FastLED.h> #define NUM_LEDS 4 // 4 Status LEDs eine pro Kanal #define DATA_PIN 12 CRGB leds[NUM_LEDS]; U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NONE|U8G_I2C_OPT_DEV_0); // I2C / TWI const int Strobe_Pin[] = {6,9,10,11}; // Definition der Ausgabepins const int buttonPin_UP = 15; // Definition der Taster const int buttonPin_ENTER = 17; const int buttonPin_DOWN = 16; int Startkanal; // DMX Startadressen int Startkanal2; int Startkanal3; int Startkanal4; int ch_mode[] = {
in „Probem mit Arduino DMXSerial und WS2812 / Triac Steuerung“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
dmx-demux3.ino
#include "U8glib.h" #include <EEPROM.h> #include "TimerOne.h" //Timer 1 für die Triac Ansteuerung #include <DMXSerial.h> #include <FastLED.h> #define NUM_LEDS 5 // 4 Status LEDs eine pro Kanal CRGB leds[NUM_LEDS]; U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NONE|U8G_I2C_OPT_DEV_0); // I2C / TWI const int Strobe_Pin[] = {6,9,10,5}; // Definition der Ausgabepins byte Triac_Pin[4] = {8,8,8,8}; const int buttonPin_UP = 15; // Definition der Taster const int buttonPin_ENTER = 17; const int buttonPin_DOWN = 16; int Startkanal; // DMX Startadressen int Startkanal2; int Startkanal3; int Startkanal4; int ch_mode
in „Probem mit Arduino DMXSerial und WS2812 / Triac Steuerung“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
STM32_TIMER.ino
#include "Arduino.h" #include "STM32_REGS.h" void setup() { *RCC_CFGR &= ~(0b1111 << PLLMUL); //pll*2 *RCC_CFGR |= (0b0101 << PLLMUL); *RCC_CFGR &= ~(1 << PLLSRC); //pll input source hsi/2 *RCC_CFGR |= (PLL_INPUT_HSI_HALF << PLLSRC); *RCC_CR &= ~(1 << PLLON); //pll on *RCC_CR |= (PLL_ON << PLLON); while (!(*RCC_CR & PLLRDY)) {}; //wait until pll is ready *RCC_CFGR &= ~(0b11 << SW); //use pll as system clock *RCC_CFGR |= (PLL_SYSTEM_CLOCK << SW); while (!(*RCC_CFGR & 8)) {}; //wait until pll is ready as system clock *RCC_CFGR &= ~(0b1111 << 4); //divide clock by 1 *RCC_CFGR |= (0b0000 << 4); *GPIOA_CRL
in „STM32 Ratsuchend“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Sipdial_esp32.ino
/* ==================================================================== * * Copyright (c) 2018 Juerge Liegner All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided
-
Datei
dmx-demux5.ino
#include "U8glib.h" #include <EEPROM.h> #include "TimerOne.h" //Timer 1 für die Triac Ansteuerung #include <DMXSerial.h> #include <digitalWriteFast.h> #include <FastLED.h> #define NUM_LEDS 5 // 4 Status LEDs eine pro Kanal #define OLDVERSION 0 CRGB leds[NUM_LEDS]; U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NONE | U8G_I2C_OPT_DEV_0); // I2C / TWI const uint8_t Dimmer_Kurve[] = // Dimmer Kurve für die Triacs { 4, 11, 15, 17, 20, 22, 24, 27, 29, 30, 32, 33, 35, 36, 38, 39, 40, 42, 43, 44, 45, 46, 47, 48, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 59, 60, 61, 62, 63, 64, 65, 66, 66, 67, 68, 69, 70, 70, 71, 72, 73
in „Probem mit Arduino DMXSerial und WS2812 / Triac Steuerung“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Sensor_Test_02.ino
// Arduino sketch to receive Technoline TX205 D-TH temperature/humidity RF sensor telegrams // Written by 'rainer_1' for German Arduino Forum // interrupthandler rx433Handler() by 'jurs', modified by rainer_1 (Thanks to jurs) #define RX433DATA 2 // receive pin for hardware interrupts #define RX433INTERRUPT 0 // interrupt number for receive pin #define KW9010_SYNC 8000 // length in µs of starting pulse #define KW9010_ONE 4000 // length in µs of ONE pulse #define KW9010_ZERO 2000 // length in µs of ZERO pulse #define KW9010_GLITCH 499 // pulse length variation for ONE and ZERO pulses #define KW9010_MESSAGELEN
in „Wetterstation, Außensensor TX205 von Technoline auslesen, CRC-verfahren gesucht“ · Haus & Smart Home ·
-
Datei
ServoAttachDMX.ino
#include <Servo.h> #include <DMXSerial.h> Servo myServo0; Servo myServo1; Servo myServo2; Servo myServo3; Servo myServo4; Servo myServo5; Servo myServo6; Servo myServo7; Servo myServo8; Servo myServo9; Servo myServo10; Servo myServo11; Servo myServo12; Servo myServo13; Servo myServo14; Servo myServo15; Servo myServo16; Servo myServo17; Servo myServo18; Servo myServo19; Servo myServo20; Servo myServo21; Servo myServo22; Servo myServo23; Servo myServo24; Servo myServo25; Servo myServo26; Servo myServo27; Servo myServo28; Servo myServo29; Servo myServo30; Servo myServo31; Servo myServo32; Servo myServo33
in „Servos mit DMX Signal steuern_DMXtoPWM“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
test_max3100.ino
#define MAX_CS 4 #define MAX_MOSI 2 #define MAX_MISO 3 #define MAX_SCK 5 // config, XTAL=3,6864MHz #define CFG 0xC000 // 230k4 //#define CFG 0xC001 // 115k2 //#define CFG 0xC002 // 57k6 //#define CFG 0xC003 // 28k8 //#define CFG 0xC004 // 14k4 //#define CFG 0xC005 // 7k2 //#define CFG 0xC006 // 3k6 //#define CFG 0xC007 // 1k8 //#define CFG 0xC008 // 76k8 //#define CFG 0xC009 // 38k4 //#define CFG 0xC00A // 19k2 //#define CFG 0xC00B // 9k6 //#define CFG 0xC00C // 4k8 //#define CFG 0xC00D // 2k4 //#define CFG 0xC00E // 1k2 //#define CFG 0xC00F // 600 // SOFT-SPI, Arduino style /* uint16_t MAX_IO
in „FIFO im MAX3100“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Vcc_Arduino_Nano.ino
// for Atmega 328P - Arduino Nano //int readVcc() { // int result; // Read 1.1V reference against AVcc // ADMUX = _BV(REFS0) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1); // delay(2); // Wait for Vref to settle // ADCSRA |= _BV(ADSC); // Convert // while (bit_is_set(ADCSRA,ADSC)); // result = ADCL; // result |= ADCH<<8; // result = int(1125300 / result); // Back-calculate AVcc in mV - normal range should be 1024000L - 1228800L // return result; //} // float readVcc() { float vcc; int result; // Read 1.1V reference against AVcc ADMUX = _BV(REFS0) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1); delay(2); // Wait for
in „Messen der uC_eigenen Ub mit Arduino Nano“ · Analoge Elektronik und Schaltungstechnik ·
-
Datei
NodeMCU2.ino
#include <SoftwareSerial.h> SoftwareSerial mySerial(D7, D8); // RX, TX unsigned long Zeit = 0; void setup() { // Open serial communications and wait for port to open: Serial.begin(115200); pinMode(D3,OUTPUT); while (!Serial) {} // set the data rate for the SoftwareSerial port mySerial.begin(4800); } void loop() { // run over and over //while (mySerial.available()>0) { Serial.write(mySerial.read()); Serial.print("Empfangen\n"); //} if(millis()> Zeit) { mySerial.print("Hallo"); Zeit = millis() +1000; } }
in „Serielle Datenübertragen vom Arduino Uno zum NodeMCU (ESP8266)“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
esp32_webserver.ino
#include <WiFi.h> #include <WebServer.h> enum { LED1pin = 2 }; enum { S_OFF = 0, S_BLINK = 1, S_ON = 2 }; enum { PORT = 80 }; // Put your SSID & Password const char* ssid = "dlink"; // Enter SSID here const char* password = "dir600=0"; //Enter Password here WebServer server(80); // create a hardware timer hw_timer_t *timer = NULL; volatile byte LED1status = S_OFF; volatile byte led_blink_state = LOW; void IRAM_ATTR onTimer() { if (LED1status == S_BLINK) { led_blink_state = !led_blink_state; digitalWrite(LED1pin, led_blink_state); } } void setup() { Serial.begin(115200); delay(100); pinMode(LED1pin
in „ESP8266 - WebServer mit blinkender LED nach Submit/Form“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
sketch_4leds.ino
/* * ---------------------------------------------------------------------------- * "THE BEER-WARE LICENSE" (Revision 42): * <joerg@FreeBSD.ORG> wrote this file. As long as you retain this notice you * can do whatever you want with this stuff. If we meet some day, and you think * this stuff is worth it, you can buy me a beer in return. Joerg Wunsch * ---------------------------------------------------------------------------- */ // Simple Arduino sketch, switching a pair of pins as active outputs around // to drive a LED. LEDs can be connected to D2/D6, D3/D7, D4/D8, D5/D9. #include <EveryTimer.h
in „LED Steckspiel“ · Analoge Elektronik und Schaltungstechnik ·
-
Datei
Pulsweite_messen_001.ino
/* IDE 1.8.13 avr-gcc 10.2.0 Arduino Mega2560 05.10.2020 */ #include <util/atomic.h> #include <avr/interrupt.h> // beide Pins sind direkt verbunden const byte pinINT0 = 21; // Mess-Eingang const byte pinTakt = 12; // OC1B Takt-Ausgang volatile unsigned long overflowCountT4; // im Overflow Interrupt Timer 4 volatile bool messungFinish = false; // Datenauswertung const byte ANZAHLDATEN = 20; volatile unsigned long dataStart[ANZAHLDATEN]; volatile unsigned long dataStop[ANZAHLDATEN]; unsigned long oldLength; void setup (void) { Serial.begin(115200); Serial.println("\nStart"); pinMode(pinINT0, INPUT
in „Timer Overflow Counter - Wie richtig berücksichtigen?“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Pulsweiten_messen_007.ino
/* https://www.mikrocontroller.net/topic/504066#new IDE 1.8.13 avr-gcc 10.2.0 Arduino Nano Every 06.10.2020 Arduino Nano Every PinOut (ATmega4809) _ __|_|__ | | (D13) PE2 + + PE1 (D12) 3.3V + + PE0 (D11) (AREF) PD7 + + PB1 (D10)(~)(TCA0 Channel 1) (D14) PD3 + + PB0 (D 9)(~)(TCA0 Channel 0) (D15) PD2 + + PE3 (D 8) (D16) PD1 + + PA1 (D 7) (D17) PD0 + + PF4 (D 6)(~)(TCB0) (D18) PF2 + + PB2 (D 5)(~)(TCA0 Channel 2) (D19) PF3 + + PC6 (D 4) (D20) PD4 + + PF5 (D 3)(~)(TCB1) (D21) PD5 + + PA0 (D 2) 5.0V + + GND RESET + + RESET GND + + PC5 (D 0) VIN + + PC4 (D 1) |_______| */ #include <util/atomic.h> #
in „Timer Overflow Counter - Wie richtig berücksichtigen?“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
uC_Logger.ino
/* Spannung messen mit ADS1115 Werte auf I2C-OLED ausgeben Werte auf SD-Karte speichern Arduino-IDE 1.8.9 / Hardware: ProMini Optiboot Die Pins 0 bis 13 und die Analogen Pins A0 bis A5, die als Digitale Ein/Ausgaenge verwendet werden koennen. Wenn ein analoger Eingang mit pinMode als digitaler Ein/Ausgang definiert wurde, werden aus A0 bis A5 die Pins 14 bis 19. A6 und A7 kann man nicht digital nutzen. PWM: 3, 5, 6, 9, 10, 11 D2 - Power On D3 - Schalter 01 D4 - Schalter 02 D5 - Schalter 03 D6 - Schalter 04 D7 - D8 - D9 - Schalter 05 D10 - CS - nicht anderweitig nutzbar D11 - SD-MOSI - fuer SD-Reader
in „Arduino China-ProMini stürzt ab“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Function_Pointer_Demo.ino
// *************************************** // einfache Demo für Funktionszeiger // *************************************** uint16_t (* func_ptr)(void); uint16_t (* func_ptr2[3])(void); uint16_t ii; uint16_t func1 (void) { Serial.println ("hier mal eine erste Func"); delay(1000); return 0; } uint16_t func2 (void) { Serial.println ("hier mal eine andere Func"); delay(1000); return 0; } uint16_t func3 (void) { Serial.println ("das macht noch nicht viel Sinn aber man sieht wie es funktioniert"); delay(2000); return 0; } void setup() { Serial.begin(9600); func_ptr2[0] = func1; func_ptr2[1] = func2;
in „Arduino - Alternativen zu bedingter Compilierung und sog. "Procedur-Variablen"“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Sonoff_Timer_Steuerung.ino
// Libraries #include <ESP8266WiFi.h> #include <ESP8266WebServer.h> #include <TTBOUNCE.h> #include <EEPROM.h> extern "C" { #include "user_interface.h" } //======SERVER PART====================================================== const char* ssid = "SSID"; const char* password = "PASSWORD"; ESP8266WebServer server ( 80 ); char htmlResponse[3000]; //======LOKALER PART====================================================== os_timer_t myTimer; bool tickOccured; bool timerrunning; int RelaisPin = 13; // GPIO13 Blaue LED auf dem Sonoff TTBOUNCE b = TTBOUNCE(0); int time_ss = 1000; int time_ds = 2000; void handleRoot
in „2fach Timer für Kaffeemühle“ · Analoge Elektronik und Schaltungstechnik ·
-
Datei
PLC-LOX-300.ino
/* Copyright (C) 2019 Ing. Pavel Sedlacek This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If
in „1 Wire auf 2 GPIO pins“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
ESP32_SPI.ino
#include<SPI.h> //Library for SPI #define SPI_SCK 18 //Serial Clock(Master Output) #define SPI_MOSI 23 //Master Output,Slave Input #define SPI_MISO 19 // #define SPI_CS 5 //Chip Select,Slave Transmit Enable(active low,Master Output) #define SS 5 char retstr[40]; char retchr; void setup (void) { Serial.begin(115200); //set baud rate to 115200 for usart pinMode(SPI_CS, OUTPUT); pinMode(LED, OUTPUT); pinMode(SPI_SCK, OUTPUT); pinMode(SPI_MOSI, OUTPUT); pinMode(SPI_MISO, INPUT); digitalWrite(SS, HIGH); // disable Slave Select SPI.begin (SPI_SCK,SPI_MISO,SPI_MOSI); SPI.setBitOrder(MSBFIRST); SPI.setDataMode
in „ESP32 - SPI funktioniert nicht“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
ShiftRegisterTest.ino
#define CLOCK 2 #define DATA 4 void setup() { // put your setup code here, to run once: pinMode(CLOCK, OUTPUT); pinMode(DATA, OUTPUT); shiftOut(DATA, CLOCK, MSBFIRST, 16777215); } void loop() { // put your main code here, to run repeatedly: }
in „CD4015 Schieberegister aneinanderreihen“ · Mikrocontroller und Digitale Elektronik ·