-
Datei
dreh_stepp.ino
/* Schrittmotor als Drehgeber; Auswertung per Interrupt auf einem AVR. Das gezeigte C-Beispielprogramm laeuft auf einem ATmega328. Hier wurde testweise ein Arduino UNO R3 verwendet, da ohne grosse Loeterei Stromversorgung und Datenausgabe ueber den USB-Anschluss erledigt werden. F_CPU beträgt typisch 16MHz. Zum Test wurde ein einfacher Schrittmotor verwendet, der als Generator zwei 90° phasenverschobene Ausgangsspannungen erzeugt: 48 Schritte/Umdrehung (7,5°), Strangspannung 12V bei 30Ohm Innenwiderstand. Der Motor hat zwei Wicklungen mit Mittenanzapfung und wird hier wie ein bipolarer Schrittmotor
in „Schrittmotor als Drehgeber mit Dynamik, AVR“ · Projekte & Code ·
-
Datei
MonoflopRetrigger.ino
/* Arduino IDE 1.8.19 ATmega2560 01.02.2026 */ const byte pinLed {28}; // Pinnummer byte countTrigger; constexpr byte countMax {6}; // Limit wann Zwangs-Aus constexpr unsigned long timeStep {1000}; unsigned long timeout; unsigned long lastMillis; enum class Funktion : uint8_t {Taster, Schalter}; template <uint8_t pin, uint16_t debounce, Funktion mode> class Kontakt { private: bool pushed {false}; bool oldPress {true}; unsigned long lastDebounce {0}; bool timer (void) { const unsigned long ms {millis()}; bool state {false}; if (ms - lastDebounce >= debounce) { lastDebounce = ms; state = true; } return
in „Monostufe mit Retrigger für Arduino“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
NiclaVoice.ino
#include "NDP.h" #include <Wire.h> // UART TX-Pin auf LP101EXT/P0.20 #define NICLA_TX Serial1 void sendit(char* label) { // LED blau bei Match nicla::leds.begin(); nicla::leds.setColor(blue); delay(200); nicla::leds.setColor(off); nicla::leds.end(); // Senden der Bytes an ESP32 if (strcmp(label, "NN0:Helmet") == 0) { NICLA_TX.write(0x01); } else if (strcmp(label, "NN0:Iron Man") == 0) { NICLA_TX.write(0x02); } else if (strcmp(label, "NN0:Shutdown") == 0) { NICLA_TX.write(0x03); } else if (strcmp(label, "NN0:Startup") == 0) { NICLA_TX.write(0x04); } else if (strcmp(label, "NN0:Repulsor") == 0) {
-
Datei
BluetoothNicla.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; // ID für Match // Callback bei Match void sendMatch(char* label) { // LED blau bei Match nicla::leds.begin(); nicla::leds.setColor(blue); delay(200); nicla::leds.setColor(off); nicla::leds.end(); // Byte setzen if (strcmp(label, "NN0:Helmet") == 0) matchID = 0x01; else if (strcmp(label, "NN0:Iron Man") == 0) matchID = 0x02; else
-
Datei
BluetoothESP.ino
#include <BLEDevice.h> #include <BLEUtils.h> #include <BLEScan.h> #include <BLEAdvertisedDevice.h> #define LED_PIN 2 // LED blinkt bei Match BLEScan* pBLEScan; BLEAdvertisedDevice* myDevice = nullptr; bool deviceFound = false; // UUIDs müssen mit Nicla Peripheral übereinstimmen const char* SERVICE_UUID = "12345678-1234-1234-1234-1234567890AB"; const char* CHAR_UUID = "87654321-4321-4321-4321-BA0987654321"; class MyAdvertisedDeviceCallbacks: public BLEAdvertisedDeviceCallbacks { void onResult(BLEAdvertisedDevice advertisedDevice) { if (advertisedDevice.getName() == "NiclaVoiceBLE") { myDevice = new
-
Datei
Kuehlkoffer006.ino
/* Kuehlkoffer006 Ganz was neues: Die Steuer-Ausgänge mit Handy steuern */ // Load Wi-Fi library #include <WiFi.h> // Replace with your network credentials const char* ssid = "Augustiner"; const char* password = "13281328"; // 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 LuefterState = "aus"; String InnenluefterState = "aus"; String KompressorState = "aus"; String TurboState = "aus"; // Assign output variables to GPIO pins const int Luefter = 20; const int Innenluefter =
in „ESP32-C3 als Accesspoint - wie fehlersicher machen?“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Schaltsequenz001.ino
/** * Ablaufdiagramm - Zeitdiagramm * * schalter _----------_____ Schalterstellung * absaugung _-------------__ Verzoegertes abschalten * kreissaege ____-------_____ Verzoegertes einschalten * Der Schalter arbeitet invers und ist entprellt * Alle Zeiten in ms * */ #include <CombieTimer.h> #include <CombiePin.h> #include <CombieTypeMangling.h> using namespace Combie::Millis; Combie::Pin::InvInputPin<2> schalter; // schalter zwischen Pin und GND(invertierend) Combie::Pin::OutputPin<3> absaugung; // Combie::Pin::OutputPin<4> kreissaege; // Combie::Timer::EntprellTimer entprell { 20_ms}; // Schalter
in „Debounce von Tasten mit dem Candidate-Pattern (Platformunabhängig, Theorie)“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Kuehlkoffer006.ino
/* Kuehlkoffer006 Ganz was neues: Die Steuer-Ausgänge mit Handy steuern */ // Load Wi-Fi library #include <WiFi.h> // Replace with your network credentials const char* ssid = "Augustiner"; const char* password = "13281328"; // 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 LuefterState = "aus"; String InnenluefterState = "aus"; String KompressorState = "aus"; String TurboState = "aus"; // Assign output variables to GPIO pins const int Luefter = 20; const int Innenluefter =
in „ESP32-C3 als Accesspoint - wie fehlersicher machen?“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Giga_009.ino
// Programm für Arduino Giga mit Bildschirm // Giga_009_Poti_Scala // LED_PR1 = D51/PE5, LED_PR2 = D40/PE6, PR1 = A11/PA0_C, PR2 = A10/PA1_C #include <Arduino_GigaDisplay_GFX.h> #include <Arduino_GigaDisplay.h> #include "Fonts/FreeMonoBold18pt7b.h" GigaDisplay_GFX display; // create the object #include <farbe16.h> #define PR1 A11 #define PR2 A10 #define LED_PR1 51 #define LED_PR2 40 #define DRE_A 35 #define DRE_B 36 #define DRE_KN 34 #define GIGA_RED 86 #define GIGA_GREEN 87 #define GIGA_BLUE 88 // Einstellungen für Scala und Rahmen #define SCALAEIN 0 // 1 = Scala eingeschaltet (Scala selbst, ohne
in „Arduino GIGA + GigaDisplay Scala Problem“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
OLED_Analogwert.ino
/* OLED Ansteuerung Test 13032026 This example code is in the public domain. */ #include <Wire.h> #include <Adafruit_GFX.h> #include <Adafruit_SSD1306.h> #define SCREEN_WIDTH 128 // Breite in Pixel #define SCREEN_HEIGHT 64 // Höhe in Pixel // OLED Display Instanz erstellen (I2C) // Reset Pin wird hier nicht benötigt, daher -1 Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1); int zaehler = 0; void setup() { // Initialisierung mit I2C Adresse 0x3C (die meisten Displays) if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { for(;;); // Bei Fehler unendlich warten } display.clearDisplay()
in „I2C Display einfache Frage“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
WiznetTester.ino
/* Web Server A simple web server that shows the value of the analog input pins. using an Arduino Wiznet Ethernet shield. Circuit: * Ethernet shield attached to pins 10, 11, 12, 13 * Analog inputs attached to pins A0 through A5 (optional) created 18 Dec 2009 by David A. Mellis modified 9 Apr 2012 by Tom Igoe modified 02 Sept 2015 by Arturo Guadalupi */ #include <SPI.h> #include <Ethernet.h> // Enter a MAC address and IP address for your controller below. // The IP address will be dependent on your local network: byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; IPAddress ip(192, 168, 0, 46)
in „Arduino und halbfunktionaler Wiznet W5500“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
OLED_Analogwert.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 u8g.drawStr(2, 10, "Analogwert:"); // Position für Spannung U1 setzen 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 für Spannung
in „I2C Display einfache Frage“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
bis6.ino
#include <CombiePin.h> #include <CombieTimer.h> #include <CombieTools.h> #include <CombieTypeMangling.h> using namespace Combie::Millis; using Taster = Combie::Pin::TasterGND<2>; // Taster zwischen Pin und GND(invertierend) using OutPin = Combie::Pin::OutputPin<13>; // Ausgang (nicht invertierend) using Counter = Combie::Tools::Counter<unsigned>; Counter counter; Taster taster; OutPin outPin; Combie::Timer::EntprellTimer entprell {20_MilliSekunden}; Combie::Tools::FlankenErkennung flankenerkennung; Combie::Timer::FallingEdgeTimer toff {1.5_Sekunden}; // abfallende Flanke wird verzoegert //Combie::
in „Monostufe mit Retrigger für Arduino“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
blink_forum.ino
#define LEDPIN PB1 void setup() { // put your setup code here, to run once: pinMode(LEDPIN, OUTPUT); } void loop() { // put your main code here, to run repeatedly: digitalWrite(LEDPIN,LOW); delay(1000); digitalWrite(LEDPIN,HIGH); delay(1000); }
in „py32v002A: Blink-Binary "gesucht"“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
event_ctrl.ino
/* -------------------------------------------------------- event_ctrl.ino Eventbasierendes System, hier ganz bewusst ohne Interrupts 03.05.2026 R. Seelig -------------------------------------------------------- */ #include "sn74hc595.h" /* --------------------------------
in „Schulnotenbewertung eines Arduino-Programms“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
event_ctrl.ino
/* -------------------------------------------------------- event_ctrl.ino Eventbasierendes System, hier ganz bewusst ohne Interrupts 03.05.2026 R. Seelig -------------------------------------------------------- */ #include "sn74hc595.h" /* --------------------------------
in „Schulnotenbewertung eines Arduino-Programms“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
eventctrl_uc.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
TimerBug.ino
#include <util/atomic.h> #define AtomicSection ATOMIC_BLOCK(ATOMIC_RESTORESTATE) /* Arduino Mega2560 Timer 2: CTC, Mode 2 Pinouts >>> http://www.pighixxx.net/pinoutspg/boards/ Uno >>> http://www.pighixxx.net/portfolio-items/uno/?portfolioID=314 Mega2560 >>> http://www.pighixxx.net/portfolio-items/mega/?portfolioID=314 */ //const byte pin_T2 = 10; const byte pin_T2 = LED_BUILTIN; void setup(void) { Serial.begin(9600); pinMode(LED_BUILTIN, OUTPUT); pinMode(pin_T2, OUTPUT); Serial.print("OCR2A"); Serial.print('\t'); formatiere_Byte (OCR2A); Serial.print("OCR2B"); Serial.print('\t'); formatiere_Byte
in „Attiny13a stürzt ab“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
klimaanlage_1.ino
#include "esp_timer.h" #include "WiFi.h" #include "esp_now.h" #include <Preferences.h> Preferences preferences; typedef struct struct_message{ int id; int einspeise_leistung; int mittelwert_oben_links; int mittelwert_unten_links; int mittelwert_oben_rechts; int mittelwert_unten_rechts; } struct_message; struct_message myData; int32_t server_werte[5] = {0,0,0,0,0}; int64_t zeit_speicher[300]; int32_t index_1 = 0; bool m = 0; int32_t druck_zeiger = 0; int64_t aus_zeit = 0; byte inhalts_liste[288]; int32_t inhalts_index = 0; byte sende_schritt = 0; int64_t sende_start_zeit = 0; int64_t sende_ziel_zeit
in „Klimaanlage steuern in Abhängigkeit von PV-Leistung“ · Haus & Smart Home ·
-
Datei
klimaanlage_1.ino
#include "esp_timer.h" #include "WiFi.h" #include "esp_now.h" #include <Preferences.h> Preferences preferences; typedef struct struct_message{ int id; int einspeise_leistung; int mittelwert_oben_links; int mittelwert_unten_links; int mittelwert_oben_rechts; int mittelwert_unten_rechts; } struct_message; struct_message myData; int32_t server_werte[5] = {0,0,0,0,0}; int64_t zeit_speicher[300]; int32_t index_1 = 0; bool m = 0; int32_t druck_zeiger = 0; int64_t aus_zeit = 0; byte inhalts_liste[288]; int32_t inhalts_index = 0; byte sende_schritt = 0; int64_t sende_start_zeit = 0; int64_t sende_ziel_zeit
in „Klimaanlage steuern in Abhängigkeit von PV-Leistung“ · Haus & Smart Home ·
-
Datei
weichen_Test.ino
// ============================================================ // CONRAD WEICHEN-PRUEFGERAET // ARDUINO NANO // // PWM-WECHSELSPANNUNG UEBER DIE VORHANDENE BRUECKE // // Pin 3 = PWM // Pin 2 = Richtung / Polaritaet // // Die vorhandene Hardware erzeugt daraus: // // PWM + LOW // PWM + HIGH // // und damit eine Wechselspannung am Ausgang. // // ------------------------------------------------------------ // // A6 = Frequenz-Grundeinstellung // 50 ... 200 Hz // // A7 = Tastverhaeltnis // 25 ... 100 % // // A0 = EIN // A1 = AUS // // A2 = Frequenz PLUS // A3 = Frequenz MINUS // // + / - veraendert
-
Datei
TransponderArduino.ino
/* Name: TransponderArduino.ino Created: 27.11.2017 19:42:09 Author: Thomas Kloiber */ #include <EEPROM.h> //EEPROM.write(addr, value); #include <Wiegand.h> #include <avr/wdt.h> //EEPROM Adressen #define addrFutterBeimMelken 0 #define
in „Arduino Mega für Programm nicht richtig aus“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
schalter_upload.ino
int taster = 37; int relaisein = 45; int relaisaus = 43; int on = 0; void setup() { // put your setup code here, to run once: pinMode(37,INPUT_PULLUP); pinMode(45,OUTPUT); pinMode(43,OUTPUT); } void loop() { // put your main code here, to run repeatedly: //einschalten if (on == 0) { if (digitalRead(taster) ==LOW) { digitalWrite(relaisein,HIGH); if (digitalRead(taster) == HIGH) { digitalWrite(relaisein,LOW); } } on = 1; } //ausschalten if (on == 1) { if (digitalRead(taster) ==LOW) { digitalWrite(relaisaus,HIGH); if (digitalRead(taster) == HIGH) { digitalWrite(relaisaus,LOW); } } on = 0; } }
in „Arduino: Schalter reagiert nur gelegentlich“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
schalter_klappt.ino
int taster = 37; int relaisein = 45; int relaisaus = 43; int on = 0; int portstatus = 0; int rote_Taste() { int rt=digitalRead(37); if (rt==LOW) { delay(20); rt=digitalRead(37); if (rt==LOW) { return 1; } } return 0; } int relaiszustand() { int rt=digitalRead(31); if (rt==LOW) { delay(20); rt=digitalRead(31); if (rt==LOW) { return 1; } } return 0; } void setup() { // put your setup code here, to run once: pinMode(31,INPUT_PULLUP); pinMode(37,INPUT_PULLUP); pinMode(45,OUTPUT); pinMode(43,OUTPUT); } void loop() { digitalWrite(45,LOW); digitalWrite(43,LOW); Serial.begin(9600); Serial.println ("Relais"
in „Arduino: Schalter reagiert nur gelegentlich“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Bistabiles_Relais.ino
/* Ansteuerung eines bistabilen Relais mit Taster (Toggle) */ #define TASTER 37 #define RELAIS_EIN 45 #define RELAIS_AUS 43 int relais = 0; // Taste lesen und Flanke erkennen int taste_flanke() { static int taste_alt; int taste, flanke=0; taste = digitalRead(TASTER); if (taste && !taste_alt) { flanke = 1; } taste_alt = taste; return flanke; } void setup() { pinMode(TASTER, INPUT_PULLUP); pinMode(RELAIS_EIN, OUTPUT); pinMode(RELAIS_AUS, OUTPUT); Serial.begin(9600); // Reset fuer Relais, AUS digitalWrite(RELAIS_AUS, HIGH); delay(50); digitalWrite(RELAIS_AUS, LOW); } void loop() { if (taste_flanke
in „Arduino: Schalter reagiert nur gelegentlich“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Bistabiles_Relais.ino
/* Ansteuerung eines bistabilen Relais mit Taster (Toggle) */ #define TASTER 37 #define RELAIS_EIN 45 #define RELAIS_AUS 43 int relais = 0; // Taste lesen und Flanke erkennen int taste_flanke() { static int taste_alt; int taste, flanke=0; taste = digitalRead(TASTER); if (taste && !taste_alt) { flanke = 1; } taste_alt = taste; return flanke; } // Relais schalten int set_relais(int state) { if (state) { digitalWrite(RELAIS_EIN, HIGH); } else { digitalWrite(RELAIS_AUS, HIGH); } delay(50); digitalWrite(RELAIS_AUS, LOW); digitalWrite(RELAIS_EIN, LOW); } void setup() { pinMode(TASTER, INPUT_PULLUP);
in „Arduino: Schalter reagiert nur gelegentlich“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
spi_tft.ino
/* Verbindungen zwischen Arduino und TFT-Controller Signal Arduino TFT-Anschluß GND GND Pin1 SCLK Pin13 Pin4 ser. Takt MISO Pin12 Pin3 nicht benötigt MOSI Pin11 Pin2 ser. Daten /CS Pin10 Pin5 Freigabe + Bit-Synchronisierung Alle Funktionen ohne Gewähr Michael Nowak 2019-03-20 www.mino-elektronik.de */ #include <SPI.h> #define uchar unsigned char #define schar signed char #define uint unsigned int #define ushort unsigned short #define ulong unsigned long #include <avr/io.h> #include <avr/interrupt.h> #include <stdlib.h> #include <stdio.h> #include <string.h> // Vorwärtsreferenzen void tft_touchmeld
-
Datei
schalter_upload.ino
// arduino mega 2560 int taster = 37; //37 ---> PC0 ( https://www.element14.com/community/docs/DOC-87013/l/arduino-mega-2560-rev3-pinout-atmega2560-pin-mapping-eagle-files-schematics-and-more ) //debounce Port C #define DEBOUNCE_PINS PINC int relaisA = 45; int relaisB = 43; int toggle = 0; // ------------- DEBOUNCER CLASS ------------- // debounce example // http://www.ganssle.com/debouncing-pt2.htm // http://www.ganssle.com/images/debouncecode.jpg #define DEBOUNCER_MAX_CHECKS 10 class Debouncer //use only one instance! { public: Debouncer(); void update(); //must be called in loop() int digitalRead
in „Arduino: Schalter reagiert nur gelegentlich“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
SPI_Test.ino
const int PIN_OUT_SS = 12; const int PIN_OUT_MOSI = 10; const int PIN_OUT_MISO = 9; const int PIN_OUT_SCK = 11; const int PIN_OUT_IRQ = 8; const int PIN_IN_SS = 2; const int PIN_IN_MOSI = 4; const int PIN_IN_MISO = 5; const int PIN_IN_SCK = 3; const int PIN_IN_IRQ = 6; int abc = 0; void irqchange(){ abc ++; } void setup() { // put your setup code here, to run once: Serial.begin(9600); if(digitalRead(PIN_OUT_IRQ) == 1){ Serial.write("OUTIRQ\n"); } if(digitalRead(PIN_IN_IRQ) == 1) { Serial.write("INIRQ\n"); } pinMode(PIN_OUT_SS, OUTPUT); pinMode(PIN_OUT_MOSI, OUTPUT); pinMode(PIN_OUT_MISO, INPUT
in „RFM12B Modul - Senden/Empfangen funktioniert nicht“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
CAN_send.ino
#include <mcp_can.h> #include <SPI.h> #include "setup.h" MCP_CAN CAN0(10); // Set CS to pin 10 void setup() { Serial.begin(115200); // Initialize MCP2515 running at 16MHz with a baudrate of 500kb/s and the masks and filters disabled. if(CAN0.begin(MCP_ANY, CAN_500KBPS, MCP_8MHZ) == CAN_OK) Serial.println("MCP2515 Initialized OK!"); else Serial.println("Error Initializing MCP2515..."); CAN0.setMode(MCP_NORMAL); // Change to normal mode to allow messages to be transmitted } void loop() { for(byte x = 0; x<16; x++) { byte sndStat = CAN0.sendMsgBuf(Devices[x], 0, 8, matrixArray[16][8]); delay(32); Serial.println
in „Re: Can bus mcp 2515 senden“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
LEDWeiterschaltenCallback.ino
/** * * LED Schaltfolge * * Ein Taster, zwei LEDs * * Startzustand beide aus. * Erster Tastendruck, led1 geht an * Zweiter Tastendruck, led2 geht an * Dritter Tastendruck, beide LEDs gehen aus, Automat geht in den Startzustand * * * */ #include <CombiePin.h> #include <CombieTimer.h> #include <CombieTools.h> using namespace Combie::Tools; using namespace Combie::Timer; using namespace Combie::Pin; using CounterType = Counter<byte>; TasterGND<2> taster; // Taster gegen GND geschaltet OutputPin<13> led1; OutputPin<12> led2; EntprellTimer entprellen(20); FlankenErkennung flankenerkennung; CounterType counter
in „einfache und übersichtliche Flanken erkennung“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Maiskolben_TFT.ino
#include <SPI.h> #include <TFT_ILI9163C.h> #include <PID_v1.h> #include <EEPROM.h> #include "TimerOne.h" #include "definitions.h" /* * If your display stays white, uncomment this. * Cut reset trace (on THT on upper layer/0R), connect STBY_NO (A1) with reset of TFT (at 4050). * See also readme in mechanical folder for reference. */ //#define USE_TFT_RESET /* * If red is blue and blue is red change this * If not sure, leave commented, you will be shown a setup screen */ //#define HARDWARE_DEFINED_TFT 2 /* * Based on your Hardware-Revision there may be modifications to the PCB. * In V3 and up is a second
in „Maiskolben Lötstation Display steht Kopf“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
v24.ino
int l = 4; int th = 8; int tl = 9; int to = 10; int ch; int p = 1; void setup() { pinMode (l, OUTPUT ); //LED pinMode (th, INPUT); // Touchsensor 1 pin in und out festlegung pinMode (tl, INPUT); // Touchsensor 2 pinMode (to, INPUT); // Ausschalter } void loop() { if (digitalRead (th) == HIGH){ // Wenn der Touchsensor 1 berührt wird ch = ch + p; // wird der PWM Wert um 1 erhöht analogWrite (l, ch); // und dann am LED PIN ausgegeben delay (5); // eine Zeitverezögerung damit der Arduino die Werte richtig verarbeiten kann und ausgeben if (ch >= 255){ // hier wird geprüft ob der PWM Wert höher oder gleich
in „Arduino Tocuhsensor LED "Dimmen"“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
testFader.ino
/* * Pin Definitions */ const int buttonStartPin = 2; const int LEDPin = 5; // LED /* * global states for main state machine */ enum states : int { stateIdle = 0, stateFadeUp, stateFadeDown }; /* * Global Variables */ int actualState = stateIdle; // main state int oldState = -1; // previous state unsigned long waitTime = 0; // watit time 0: inactive unsigned long timeStart; // start time marker unsigned long debounceTime; // debouncing timer int buttonStartOld = 1; // button old state /* * start a non blocking delay */ void startDelay(unsigned long delayTime_ms) { Serial.print("start Delay: "); Serial.println
in „Gehwegbeleuchtung Fading mit Taster“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
loraAtmega.ino
#include "LowPower.h" //set the chip to really low power sleep #include <RadioLib.h> //for Lora module #include <BME280I2C.h> #include <Wire.h> //for I2C //pins for RFM98W #define RESET 9 #define NSS 10 #define MOSI 11 #define MISO 12 #define SCK 13 #define DIO0 2 #define DIO1 3 SX1278 lora = new Module(NSS, DIO0, RESET, DIO1); BME280I2C bme; float temperature, temperature_last; uint8_t humidity, humidity_last; uint16_t pressure; float vcc; #define TEMP_THRESHOLD 2 //0.2°C #define HUM_THRESHOLD 2 //2 % #define SLEEPTIME_SEC 240 //4 min. #define DEVICE_ID 3 void setup() { Serial.begin(115200); //Init
in „Atmega328p LoRa Node (RFM98w) - Zu hoher Stromverbrauch!“ · Haus & Smart Home ·
-
Datei
projekt_47.ino
#include <math.h> int t=29; int m=8; int mm; int y=2020; int yy; double jd; double a; double b; double c; double d; double ee; double f; double g; double i; double ta; double w; double de; // datum ergebnis int me; // int je; double eps; double exc; double m0; // double e; //excentric anomalie int x=0; double stp; double lambda; double declin; double alpha; double h; //stundenwinkel double azirise; //Aufgangswinkel double aziset; double lstr; double lsts; double gstr; double gsts; double t0; double gst; double ut; double utr; double uts; byte dst=1; // über Pinabfrage byte zone=1; double lctr;
in „Nachkommastellen Arduino“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
HelloWorld.ino
/* HelloWorld.pde "Hello World!" example code. >>> Before compiling: Please remove comment from the constructor of the >>> connected graphics display (see below). Universal 8bit Graphics Library, https://github.com/olikraus/u8glib/ Copyright (c) 2012, olikraus@gmail.com All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce
in „Arduino OLED Display Ansteuern & "Hello World" Programme gehen nicht.“ · Softwareentwicklung ·
-
Datei
BalancingWii.ino
/* * Welcome to MultiWii. * * If you see this message, chances are you are using the Arduino IDE. That is ok. * To get the MultiWii program configured for your robot, you must switch to the tab named 'config.h'. * Maybe that tab is not visible in the list at the top, then you must use the drop down list at the right * to access that tab. In that tab you must enable your board or sensors and optionally various features. * For more info go to http://www.multiwii.com/wiki/index.php?title=Main_Page * * Have fun, and do not forget MultiWii is made possible and brought to you under the GPL License.
-
Datei
espLogger.ino
#include <Arduino.h> #include <WiFi.h> #include <WebServer.h> #define NTP_SERVER "de.pool.ntp.org" #define TZ_INFO "WEST-1DWEST-2,M3.5.0/02:00:00,M10.5.0/03:00:00" // Western European Time #define SSID ";-)" #define PASS ";-)" // attach a LED to PIO 2 #define LED_PIN 2 #define CHUNKSIZE (128U) IPAddress local_IP(;-)); IPAddress gateway(;-)); IPAddress subnet(;-)); IPAddress primaryDNS(;-)); IPAddress secondaryDNS(;-)); typedef struct line line_t; struct line { tm timestamp; uint8_t* content; uint_fast32_t len; line_t* next; }; typedef struct chunk chunk_t; struct chunk { uint8_t content[CHUNKSIZE]
in „Fehlersuche ESP32, der mit Hilfe der Arduino IDE programmiert wurd“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Pulsweite_messen.ino
/* https://www.mikrocontroller.net/topic/504066#new IDE 1.8.13 avr-gcc 10.2.0 Arduino Nano Every 03.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
kwb13.ino
// Author windundsternne V0.9 // Das Programm liest Control und Sense Daten vom Bus // eines KWB Easyfire mit und sendet diese per MQTT an // fhem. Updates können OTA durchgeführt werden. // Ist bestimmt nicht fehlerfrei läuft aber seit einer Weile stabil // Hardware // Webmos d1 mini Pro + HER MAX485 module // Stromversorgung über Kessel 24V-> 7800 Spannungsregler // Neben den Kesselwerten werden noch Brennerlaufzeit Gesamtenergie // berechnet mit der der Pelletverbrauch bestimmt werden kann (ca. 4.3kg/kwh bei einem EF2) // Dank an Dirk Abel und seine Doku zu, KWB RS-485 Interface // Individualisierungen
-
Datei
SD_Testen.ino
/* * Connect the SD card to the following pins: * * SD Card | ESP32 * D2 - * D3 SS = D5 * CMD MOSI = D23 * VSS GND * VDD 3.3V * CLK SCK = D18 * VSS GND * D0 MISO = D19 * D1 - */ #include "FS.h" #include "SD.h" #include "SPI.h" // const char * UDPWort = "14:14:44 <135>14:14:35 PPP: dialup1: event: snychronize ifOperStatus with config ,status: initial / dormant (up) -> initial / dormant (dormant)"; String UDPWort = "14:14:44 <135>14:14:35 PPP: dialup1: event: snychronize ifOperStatus with config ,status: initial / dormant (up) -> initial / dormant (dormant)"; void listDir(fs::FS &fs, const char * dirname
in „GPS Logger mit Atmega328 oder ESP8266“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
AnalogInput.ino
int analogPin1 = A9; // Pin int val = 0 ; // Variable, die den gelesenen Wert speichert float x_temp1, w_temp1 = 30, e_temp1 ; float p_value1, k_p1 = 0.036 ; float i_value1, e_sum1 = 0, k_i1 = 0.03, t_s = 0.02; float y_value1; float PWM; void setup() { Serial.begin(9600); // Setup der seriellen Verbindung analogReadResolution(13); } void loop() { val = analogRead(analogPin1); // Pin einlesen float temperature1 = val * (200.0 / 8192.0); //Regler x_temp1 = temperature1; // Ist-Wert Anode e_temp1 = w_temp1 - x_temp1; // Abweichung Anode //p_Anteil p_value1 = k_p1 * e_temp1; // Anode //i_Anteil e_sum1 =
in „Zähler für PWM-Signal“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Test-Exponent.ino
#include <LiquidCrystal_I2C.h> LiquidCrystal_I2C lcd(0x27, 20, 4); // Frage wie codiere ich : // val = 0.89 * exp(0.1415 * Wert/10) double val; double wert; const float b = 0.8900; // Basiswert Umrechnung const float e = 0.1415; // Exponent Umrechnung void setup() { lcd.begin(20,4); lcd.init(); lcd.backlight(); } void loop() { wert = 400; val = pow(b, (e* wert / 10)); // Exp.-Umrechnung lcd.setCursor(0, 0); lcd.print(" "); lcd.setCursor(0, 0); lcd.print(wert); lcd.setCursor(10, 0); lcd.print(val); }
-
Datei
cheap_eyes.ino
/* ***************************************** * ****************BilloEyes**************** * * for 2x 0.96 OLED with IIC * /* ***************************************** /** * The MIT License (MIT) * * Copyright (c) 2018 by ThingPulse, Daniel Eichhorn * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit
-
Datei
PLC-LOX.ino
* UDP syntax: signals: DS18B20 1wire sensor packet: rail1 1w 2864fc3008082 25.44 DS2438 1wire sensor packet: rail1 1w 2612c3102004f 25.44 1.23 0.12 digital input state: rail1 di1 1 analog input state: rail1 ai1 250 commands: relay on command: rail1 do12 on relay off command: rail1 do5 off high side switch on command: rail1 ho2 on high side switch off command: rail1 ho4 off low side switch on command: rail1 lo1 on low side switch off command: rail1 lo2 off analog output command: rail1 ao1 180 status command: rail1 stat10 reset command: rail1 rst default scan cycles: 1wire cycle: 30000 ms analog
in „1 Wire auf 2 GPIO pins“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
ExternalTick.ino
#include <Streaming.h> #include <INTERVAL.h> #include <util/atomic.h> #define AtomicSection ATOMIC_BLOCK(ATOMIC_RESTORESTATE) // http://ww1.microchip.com/downloads/en/DeviceDoc/ATmega48A-PA-88A-PA-168A-PA-328-P-DS-DS40002061A.pdf volatile uint16_t overflowCount; uint32_t getTicks() { union // AVR only hack { uint32_t ticks; struct { uint16_t lower; uint16_t upper; }; } t; AtomicSection { t.lower = TCNT1; t.upper = overflowCount; } return t.ticks; } ISR(TIMER1_OVF_vect) { overflowCount++; } // Timer/Counter1, Normal Mode // Overflow Interrupt Enable // External clock source on T1 pin. (PD5 Arduino
in „Arduino Interrupt Drehzahlmessung Faulhaber Motor“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
sketch.ino.txt
#include <Arduino.h> const uint8_t row_pins[4] = {4, 5, 6, 7}; const uint8_t col_pins[6] = {8, 9, 10, 11, 12, 11}; uint8_t row_cnt = 0; uint8_t col_cnt = 0; uint8_t row_cnt2 = 23; volatile bool matrixImage[4][6] = { 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0 }; ISR(TIMER0_COMPA_vect) { //This is the interrupt request if (col_cnt < 6) { col_cnt++; } else { col_cnt = 0; } switch (row_cnt) { case 0: PORTD = B00010000; row_cnt = 1; Serial.println(row_cnt); //Wird nicht ausgeführt break; case 1: PORTD = B00100000; row_cnt = 2; break; case 2: PORTD = B01000000; row_cnt =
in „Arduino ignoriert Code“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Tastenfeld_ins_array.ino
// Ließt beim Tastenfeld erste Zahl ein if(eingabe_zaehler==0){ int eingabe=check_tastenfeld(); if( eingabe <= 15){ single_blink_blau(); // feedback das man weiß das die gedrückte taste angenommen wurde eingabe[eingabe_zaehler]=eingabe; eingabe_zaehler++; // <---- dieser Wert würde bei dir dann in der ISR erhöht werden delay(50); } } // Ließt beim Tastenfeld zweite Zahl ein if(eingabe_zaehler==1){ int eingabe=check_tastenfeld(); if( eingabe <= 15){ single_blink_blau(); eingabe[eingabe_zaehler]=eingabe; eingabe_zaehler++; // <---- dieser Wert würde bei dir dann in der ISR erhöht werden delay(50);
in „Nummerneingabe SwitchCase AVR“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
EEPROM_Programmer.ino
/* * ARDUINO EEPROM PROGRAMMER */ #define CLOCK 2 #define DATA 3 #define WRITE_ENABLE 4 #define OUTPUT_ENABLE 5 #define EEPROM_IO_ZERO 6 #define EEPROM_IO_SEVEN 13 void setup() { //-------------------------------------------------------------- digitalWrite(CLOCK, LOW); digitalWrite(DATA, LOW); digitalWrite(WRITE_ENABLE, HIGH); digitalWrite(OUTPUT_ENABLE, HIGH); pinMode(CLOCK, OUTPUT); pinMode(DATA, OUTPUT); pinMode(WRITE_ENABLE, OUTPUT); pinMode(OUTPUT_ENABLE, OUTPUT); // put your setup code here, to run once: Serial.begin(9600); writeData(420, 70); Serial.println(readData(420)); } void loop() { // put
in „Arduino EEPROM Programmer, kann zwar lesen, aber nicht schreiben“ · Mikrocontroller und Digitale Elektronik ·