-
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 ·
-
Datei
ATmega_SPI_Master.ino
/* SPI Master Demo written by Robert Mollik, 2016 * * This demo uses the SPI protocol on a Arduino Uno R3 / ATmega8 controller * * The demo sends out a request ID depending, whether a temperature or humidity signal shall be obtained from the slave. Both signals * are datatype float, however get received as 4 bytes and need to be re-assembled. */ #include <SPI.h> void setup (void) { Serial.begin(115200); // Serial transmission for demonstration puroses SPI.begin(); // SPI.beginTransaction(SPISettings(00000,MSBFIRST,SPI_MODE0)); SPI.setDataMode(SPI_MODE0); SPI.setBitOrder(MSBFIRST); SPI.setClockDivider
in „ATtinyX5 und SPI Daisy-Chain“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
arduino_client_-_Kopie.ino
#include <ETH.h> #include <WiFi.h> #include <WiFiAP.h> #include <WiFiClient.h> #include <WiFiGeneric.h> #include <WiFiMulti.h> #include <WiFiScan.h> #include <WiFiServer.h> #include <WiFiSTA.h> #include <WiFiType.h> #include <WiFiUdp.h> //#include <ESP8266HTTPUpdateServer.h> //#include <ESP8266mDNS.h> //#include <ArduinoOTA.h> //#include <ESP8266WiFi.h> //#include <DNSServer.h> //#include <ESP8266WebServer.h> #include <PubSubClient.h> //#include <WiFiManager.h> #include <ArduinoJson.h> #include <SPIFFS.h> #define LOAD_PIN 5 #define WRITE_PIN 4 #define CARRIER_PIN 12 #define BIT_PIN 13 #define BIT_DURATION
-
Datei
sketch2.ino.txt
const uint8_t row_pins[4] = {4, 5, 6, 7}; const uint8_t col_pins[6] = {8, 9, 10, 11, 12, 11}; volatile uint8_t row_cnt = 0; uint8_t col_cnt = 0; uint8_t row_cnt2 = 23; #define rowClkPin A0 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; break; case 1: PORTD = B00100000; row_cnt = 2; break; case 2: PORTD = B01000000; row_cnt = 3; break; case 3: PORTD = B10000000; row_cnt
in „Arduino ignoriert Code“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
sketch3.ino.txt
const uint8_t row_pins[4] = {4, 5, 6, 7}; const uint8_t col_pins[6] = {8, 9, 10, 11, 12, 11}; volatile uint8_t row_cnt = 0; uint8_t col_cnt = 0; uint8_t row_cnt2 = 23; boolean isrtrigger = false; #define rowClkPin A0 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 /*digitalWrite(rowClkPin,!digitalRead(rowClkPin)); if (col_cnt < 6) { col_cnt++; } else { col_cnt = 0; } switch (row_cnt) { case 0: PORTD = B00010000; row_cnt = 1; break; case 1: PORTD = B00100000; row_cnt = 2; break
in „Arduino ignoriert Code“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Kondensatormotor_20200220h.ino
int potipin = A5; // atmega pin 28 Poti Schleifer int enlppin = 2; // atmega pin 4 int enlnpin = 3; // atmega pin 5 int enhppin = 4; // atmega pin 6 int lpin = 5; // atmega pin 11 int hpin = 6; // atmega pin 12 int enhnpin = 7; // atmega pin 13 int optopin = 8; // atmega pin 14 schaltet die Optokoppler-Treiber ein unsigned long mvstart; // Multivibrator unsigned long mvist; bool mv; unsigned long enlpstart; unsigned long enlpistzeit; unsigned long enlnstart; unsigned long enlnistzeit; unsigned long enhpstart; unsigned long enhpistzeit; unsigned long enhnstart; unsigned long enhnistzeit; bool enhpmf; bool
in „Arduino Kondensatormotor Drehzahlsteuerung“ · Analoge Elektronik und Schaltungstechnik ·
-
Datei
Linear_Actuator_Code.ino
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //This code calculates the length of the linear actuator. float leadscrewLength(float b,float c,float AcuteObtuse,float angle, float AngleAtZero){ float output; if (AcuteObtuse == 1){angle = AngleAtZero - angle;} if (AcuteObtuse == 2){angle = AngleAtZero + angle;} output = sqrt(b * b + c * c - 2 * b * c * cos((angle) * pi / 180)); return output; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
in „Heliostatensteuerung mit Arduino Uno“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Joystick_Control_Code.ino
void checkJoystick(){ if(digitalRead(plusOneButton) == HIGH && digitalRead(minusOneButton) == HIGH && joystickModeOnOff == 0 && joystickTriggerOnce == 0){ joystickModeOnOff=1; joystickTriggerOnce=1; justFinishedManualControl=1; UDCenter = analogRead(joystickUDAnalogPin); LRCenter = analogRead(joystickLRAnalogPin); MachineOn(machineNumber); } if(digitalRead(plusOneButton) == LOW && digitalRead(minusOneButton) == LOW){joystickTriggerOnce=0;} if(digitalRead(plusOneButton) == HIGH && digitalRead(minusOneButton) == HIGH && joystickModeOnOff == 1 && joystickTriggerOnce == 0){ joystickModeOnOff=0; joystickTriggerOnce
in „Heliostatensteuerung mit Arduino Uno“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Kondensatormotor_20200229b.ino
int potipin = A5; // atmega pin 28 Poti Schleifer int enlppin = 2; // atmega pin 4, Katode Optoled int enlnpin = 3; // atmega pin 5, Katode Optoled int enhppin = 4; // atmega pin 6, Katode Optoled int lpin = 5; // atmega pin 11, Anode Optoled int hpin = 6; // atmega pin 12, Anode Optoled int enhnpin = 7; // atmega pin 13, Katode Optoled int relaispin = 8; // atmega pin 14 schaltet Relais ein int zwkpin = 13; // wird HIGH wenn die Zwischenkreisspannung größer 750VDC wird. unsigned long zwkstart; unsigned long zwkist; unsigned long zwkvz = 100; bool zwk; unsigned long mvstart; // Multivibrator unsigned
in „Arduino Kondensatormotor Drehzahlsteuerung“ · Analoge Elektronik und Schaltungstechnik ·
-
Datei
Kondensatormotor_20200306b.ino
int testpin = 9; // atmega pin 15 int potipluspin = 12; // atmega pin 18 Poti Pluspol int potischleiferpin = A5; // atmega pin 28 Poti Schleifer Über RC-TP int enuppin = 2; // atmega pin 4, Katode Optoled int enunpin = 3; // atmega pin 5, Katode Optoled int enzppin = 4; // atmega pin 6, Katode Optoled int upin = 5; // atmega pin 11, Anode Optoled int zpin = 6; // atmega pin 12, Anode Optoled int enznpin = 7; // atmega pin 13, Katode Optoled int relaispin = 8; // atmega pin 14 schaltet Relais ein int zwkpin = 13; // atmega pin 19 wird HIGH wenn die Zwischenkreisspannung größer 750VDC wird. int netzpin
in „Arduino Kondensatormotor Drehzahlsteuerung“ · Analoge Elektronik und Schaltungstechnik ·
-
Datei
cc1101_Receive.ino
// These examples are from the Electronics Cookbook by Simon Monk //https://github.com/LSatan/SmartRC-CC1101-Driver-Lib // mod by Little_S@tan //#include <cc1101_debug_service.h> #include <ELECHOUSE_CC1101_SRC_DRV.h> int gdo0; const int n = 61; const byte ccregister[47] = { 0x07, // IOCFG2 GDO2 Output Pin Configuration 0x2E, // IOCFG1 GDO1 Output Pin Configuration 0x80, // IOCFG0 GDO0 Output Pin Configuration 0x07, // FIFOTHR RX FIFO and TX FIFO Thresholds 0x57, // SYNC1 Sync Word, High Byte 0x43, // SYNC0 Sync Word, Low Byte 0x3E, // PKTLEN Packet Length 0x0E, // PKTCTRL1 Packet Automation Control
in „ESP8266 Wemos D1 & CC1101“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
200311mi2200.ino
#include <ESP8266WiFi.h> #include <WiFiClient.h> #include <ESP8266WebServer.h> #include <ESP8266mDNS.h> #include <Wire.h> #ifndef STASSID #define STASSID "gs23w" //Netzwerkname eingeben FabLab_Guest #define STAPSK "kalHmera23w" //Password eingeben FabLab2018 //#define STASSID "FabLab_Guest" //Netzwerkname eingeben FabLab_Guest //#define STAPSK "FabLab2018" //Password eingeben FabLab2018 #endif const char* ssid = STASSID; const char* password = STAPSK; ESP8266WebServer server(80); //const int led = 13; int RELAY = 12; //NEU hinzu int RESET = 14; //NEU hinzu wg Chirp unsigned int capacitance =0; void
in „Neu bei microcontoller_net und schon eine Frage“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
RFM69_Test.ino
#include <RFM69.h> #include <SPI.h> // Addresses for this node. CHANGE THESE FOR EACH NODE! #define NETWORKID 0 // Must be the same for all nodes #define MYNODEID 2 // My node ID #define TONODEID 1 // Destination node ID // RFM69 frequency, uncomment the frequency of your module: #define FREQUENCY RF69_433MHZ //#define FREQUENCY RF69_915MHZ // AES encryption (or not): #define ENCRYPT false // Set to "true" to use encryption #define ENCRYPTKEY "TOPSECRETPASSWRD" // Use the same 16-byte key on all nodes // Use ACKnowledge when sending messages (or not): #define USEACK true // Request ACKs or not //
in „RFM69HW - Arduino Uno“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
4-Kanal-ATmega.ino
bool PRESSED = LOW; bool NOT_PRESSED = HIGH; //Variablen //RC-bezogen int cnt_CH_1 = 0; //Zähler Channel 1 für Interruptroutine volatile int value_CH_1 = 0; //Übergabewert Channel 1 aus Interruptroutine //Programmbezogen const unsigned long SHORT_PRESS = 50; //Zeit in ms const unsigned long LONG_PRESS = 1000; const int MAX_ERROR = 10; const int SWITCH_STEP = 25; //Schaltlevel für Kanäle -Ch1/3 Nullpunkt+Level -Ch2/4 Nullpunkt-Level int zeroPoint, i, error, counter; //Hilfsvariable bool initZP; unsigned long counter1 = 0; unsigned long counter2 = 0; bool prevStateRight = NOT_PRESSED; bool prevStateLeft
in „Umschreiben von ATmega328 auf ATtiny“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
4-Kanal-ATtiny.ino
#define PRESSED LOW #define NOT_PRESSED HIGH #define SHORTLEFT PB0 #define LONGLEFT PB1 #define SHORTRIGHT PB3 #define LONGRIGHT PB4 //Variablen //RC-bezogen int cnt_CH_1 = 0; //Zähler Channel 1 für Interruptroutine volatile int value_CH_1 = 0; //Übergabewert Channel 1 aus Interruptroutine //Programmbezogen const unsigned long SHORT_PRESS = 50; //Zeit in ms const unsigned long LONG_PRESS = 1000; const int MAX_ERROR = 10; const int SWITCH_STEP = 25; //Schaltlevel für Kanäle -Ch1/3 Nullpunkt+Level -Ch2/4 Nullpunkt-Level int zeroPoint, i, error, counter; //Hilfsvariable bool initZP; unsigned long counter1
in „Umschreiben von ATmega328 auf ATtiny“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
4-Kanal-ATtiny.ino
#define PRESSED LOW #define NOT_PRESSED HIGH #define SHORTLEFT PB0 #define LONGLEFT PB1 #define SHORTRIGHT PB3 #define LONGRIGHT PB4 //Variablen //RC-bezogen int cnt_CH_1 = 0; //Zähler Channel 1 für Interruptroutine volatile int value_CH_1 = 0; //Übergabewert Channel 1 aus Interruptroutine //Programmbezogen const unsigned long SHORT_PRESS = 50; //Zeit in ms const unsigned long LONG_PRESS = 1000; const int MAX_ERROR = 10; const int SWITCH_STEP = 25; //Schaltlevel für Kanäle -Ch1/3 Nullpunkt+Level -Ch2/4 Nullpunkt-Level int zeroPoint, i, error, counter; //Hilfsvariable bool initZP; unsigned long counter1
in „Umschreiben von ATmega328 auf ATtiny“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
_433-mhz-empfang.ino
#include <VirtualWire.h> #include <VirtualWire_Config.h> #include <LiquidCrystal_I2C.h> // 433 MHz Empfänger mit der VirtualWire Library V 1.27 // Verbindungen zum Uno // GND > D4 // Data > D5 // Input > D6 // VCC > D7 LiquidCrystal_I2C lcd(0x27, 16, 2); int inByte; char inText[300]; int index; int i; uint8_t buf[VW_MAX_MESSAGE_LEN]; uint8_t buflen = VW_MAX_MESSAGE_LEN; void setup() { Serial.begin(9600); pinMode(5, INPUT); // pin für 433 mhz vw_setup(5000); // Bits pro Sekunde vw_set_rx_pin(5); // Datenleitung vw_rx_start(); // Empfänger starten lcd.init(); // LCD-Ini lcd.clear(); // LCD-löschen
in „Kommunikation AVR <> PC über RS232“ · Mikrocontroller und Digitale Elektronik ·