-
Datei
nokia_display.ino
/* --------------------------------------------------------------------------- NOKIA_DISPLAY_DEMO Ein Nokia 3310 oder 3410 Display mittels ARDUINO betreiben --------------------------------------------------------------------------- */ // Originalpindefinitionen aus PLAYGROUND.ARDUINO.CC /* #define PIN_SCE 7 #define PIN_RESET 6 #define PIN_DC 5 #define PIN_SDIN 4 #define PIN_SCLK 3 */ #define PIN_SCE 10 #define PIN_RESET 8 #define PIN_DC 9 #define PIN_SDIN 11 #define PIN_SCLK 13 #define LCD_C LOW #define LCD_D HIGH #define nokia3410 #ifdef nokia3410 /* -----------------------------------------
in „Nokia 3310 Display; Arduino; 74HC4050“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
ArduinoCDC.ino
#include <avr/wdt.h> //#include <util/delay.h> #define B2 (0x04) #define B3 (0x08) #define B5 (0x20) #define pSS B2 #define pDATA B3 #define pCLK B5 void send_byte(uint8_t c) { SPDR = c; loop_until_bit_is_set(SPSR, SPIF); //wait for transmission complete delayMicroseconds(700); return; } void send_package(uint8_t c0, uint8_t c1, uint8_t c2, uint8_t c3, uint8_t c4, uint8_t c5, uint8_t c6, uint8_t c7) { send_byte(c0); send_byte(c1); send_byte(c2); send_byte(c3); send_byte(c4); send_byte(c5); send_byte(c6); send_byte(c7); return; } void setup() { Serial.print("Main"); attachInterrupt(0, stateChange, RISING
in „Arduino friert ein: SPI und PinChange Interrupt“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
lcd_wertbedingt.ino
#include <LiquidCrystal.h> //Variablendeklaration ANFANG LiquidCrystal lcd(12,11,5,4,3,2); int potPin1 = A1; int potPin2 = A2; int Luft = 0; //Variablendeklaration ENDE void setup() { lcd.begin(16,2); lcd.clear(); //lcd.home(); im void loop-> set cursor0,0 pinMode(potPin1,INPUT); pinMode(potPin2,INPUT); } void loop() { lcd.clear(); lcd.setCursor(0,0); lcd.print("LADELUFT: "); lcd.print(analogRead(potPin1)); lcd.setCursor(0,1); lcd.print("LADEDRUCK: "); lcd.print(analogRead(potPin2)); if(potPin1 >= 100) { lcd.setCursor(14,0); lcd.print("!!"); } else { lcd.setCursor(14,0); lcd.print("OK"); } delay
in „LCD und wertbedingter Text“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
postloggertinyfin6.ino
#include <JeeLib.h> #include <avr/sleep.h> #include <avr/interrupt.h> #define myNodeID 8 #define DIO1 10 // d10 #define DIO2 14 // d10 #define LOGGERNUM 104 #define Serial 1 // set to 1 to also report readings on the // Serial port #define DEBUG 1 // set to 1 to display each loop() run and PIR trigger #define TEST_LIMIT 10 #define RETRY_PERIOD 10 // how soon to retry if ACK didn't come in #define RETRY_LIMIT 5 // maximum number of times to retry #define ACK_TIME 80 // number of milliseconds to wait for an ack // set the sync mode to 2 if the fuses are still the Arduino default // mode 3 (full powerdown
in „Entprellen von Schalter mit Interrupt und PinChange“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
device_log.ino
#include <SPI.h> // needed for Ethernet library communication with the W5100 (Arduino ver>0018) #include <Ethernet.h> #include <EthernetUdp.h> #include <SD.h> #include <utility/w5100.h> #include "eth_headers.h" #define DEBUG #define SET_SD digitalWrite(10, HIGH);digitalWrite(4, LOW); #define SET_ETHERNET digitalWrite(4, HIGH);digitalWrite(10, LOW); #define LED_ON digitalWrite(13, HIGH); #define LED_OFF digitalWrite(13, LOW); SOCKET s; // our socket that will be opened in RAW mode byte mac[] = {0x90, 0xA2, 0xDA, 0x00, 0x8A, 0x6C}; IPAddress ip(192, 168, 178, 88); IPAddress ntp_server(132, 163, 4, 101
in „Arduino bleibt nach einer gewissen Zeit einfach hängen“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
ArduinoISP.ino
// ArduinoISP version 04m3 // Copyright (c) 2008-2011 Randall Bohn // If you require a license, see // http://www.opensource.org/licenses/bsd-license.php // // This sketch turns the Arduino into a AVRISP // using the following arduino pins: // // pin name: not-mega: mega(1280 and 2560) // slave reset: 10: 53 // MOSI: 11: 51 // MISO: 12: 50 // SCK: 13: 52 // // Put an LED (with resistor) on the following pins: // 9: Heartbeat - shows the programmer is running // 8: Error - Lights up if something goes wrong (use red if that makes sense) // 7: Programming - In communication with the slave // // 23
in „AVR-Programmierung - letzter Schritt“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
V9958.ino
byte pinCSR = 31; byte pinCSW = 33; byte pinWAIT = 35; byte pinINT = 37; byte pinRESET = 39; byte pinCPUCLK = 41; byte pinMODE0 = 53; byte pinMODE1 = 52; /* byte MOD = 0x00; byte MSB = 0x00; byte LSB = 0x00; byte Data = 0x00; byte number = 0; */ //delays void setup() { // initialize the serial communication: DDRA = B11111111; //CD Bus PORTA = 0x00; pinMode(pinCSR, OUTPUT); pinMode(pinCSW, OUTPUT); pinMode(pinRESET, OUTPUT); pinMode(pinMODE0, OUTPUT); pinMode(pinMODE1, OUTPUT); pinMode(pinWAIT, INPUT); pinMode(pinINT, INPUT); pinMode(pinCPUCLK, INPUT); digitalWrite(pinCSR, HIGH); digitalWrite(pinCSW, HIGH
in „Brauche Hilfe beim Ansteuern eines v9958 mit Arduino“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
ScannerSpittewitz.ino
// Rfid Reader für Handscanner mit Textausgabe #include <SoftwareSerial.h> #define ledPin 7 #define speakerPin 9 SoftwareSerial rfidReader = SoftwareSerial(11, -1); byte tagCounter=0; // Auswertung ob alle Tags gelesen sind int stationen = 7; char* cards[] = { // bekannte Tags "05000604E2", "", "", "", "", "", "4F0088925E" }; char* station[] = { // Stationsnummer "Station 1", "Station 2", "Station 3", "Station 4", "Station 5", "Station 6", "Station 7" }; char* sektor[] = { // Sektorangabe "X8 Y13", "X8 Y13", "X8 Y13", "X8 Y13", "X8 Y13", "X8 Y13", "X8 Y13" }; char* info1[] = { // Hinweis zur naechsten
in „Rfid Tags auslesen mit Arduino und Auswertung“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
avr466.ino
#include <avr/io.h> #include <avr/interrupt.h> #include <glcd.h> #include <fonts/allFonts.h> #define CW 0 #define CCW 1 #define TRUE 1 #define FALSE 0 // Speed ramp Data extern clac #define A_T_x100 3141592.65358979 #define T1_FREQ_148 13520 #define A_SQ 314159265.358979 #define A_x20000 314.159265359 #define accel_stepper 30000 // Speed ramp states #define STOP 0 #define ACCEL 1 #define DECEL 2 #define RUN 3 long stepPosition = 0 ; boolean x; typedef struct { //! What part of the speed ramp we are in. unsigned char run_state : 3; //! Direction stepper motor should move. unsigned char dir : 1; /
in „Appnote avr446 Atmega2560 (Arduino)“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
TNARX_lcd.ino
int cs = 3; int clock = 4; int data = 5; int spalte2 = 56; int bild[112] ={1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1}; void setup() { pinMode(cs, OUTPUT); pinMode(clock, OUTPUT); pinMode(data, OUTPUT); //digitalWrite(cs, 0); } void loop() { //display(1,1); //display(8,2); zeichen(); delay(1000); } void zeichen() { //digitalWrite(cs, 1); //digitalWrite(clock, 0); /*for(int x = 0;x < 112;x++) { digitalWrite(clock,
in „Dokumentation gesucht (UC121902-TNARX-A)“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Rundenmessen10.ino
// Um die Runden der Fahrzeuge zu zählen, bedarf es einer Abfrage am Startzielbogen // um dem Mikrocontroller mitzuteilen ob das Fahrzeuge durchgefahren ist oder nicht. // Die Kontrolle, ob ein Fahrzeug durch den Startzielbogen gefahren ist , geschieht durch // eine selbst gebaute Infrarot - Lichtschranke, die am Bogen unten angebracht ist. // Ist die Lichtschranke belegt, dann sendet sie eine 1 an den Mikrokontroller, sobald sich // nicht belegt ist sendet sie eine 0. Durch einen Reset Taster werden die Runden wieder auf zurückgesetzt // Desweiteren soll ich Rundenzeit der beiden Bahnen gemessen werden
in „Rundenzähler Carrera“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Arduino_Drehgeber.ino
/* Drehgeberauswertung per Interrupt auf einem AVR: spezielle Version fuer Arduino UNO R3! 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. Zum Test wurde ein mechanischer Drehgeber verwendet, dessen gemeinsamer Anschluss 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 ueber ein RC-Glied (Tiefpass) 100k/1nF an den PCINT18-Eingang des ATmega328
in „Drehgeber per Interrupt auswerten, AVR“ · Projekte & Code ·
-
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.