-
Datei
HIPP_TIMER.ino
// Test Program to evaluate T1 Capture performance // Input configured for falling edge detection // Application Requirement Range is 1ms-10s // T1 clocked at 16MHz // Capture input (coupled with 4n7 and 1K Pullup) // Input using D8 (PB ) pin // Calibrated TTL Test Generator with // 0.1Hz-100kHz Output range // // 24-01-24 V1.00 #define ICP_INPUT 8 void setup() { pinMode(ICP_INPUT, INPUT_PULLUP); delay(100); init_InputCapture(); Serial.begin(115200); } void loop() { InputCapture_out(); delay(1000); } volatile unsigned long ICP_val = 0, T1OVF_Ctr = 0; /*********************************************
in „AVR T1 Capture Problem - Meinung erbeten“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
timer1.ino
// learning timer1 on atmega 328 // pins for timers //const byte poc2B = 3; // pd3 // reserved Tim2 const byte pcin1 = 5; // pd5 Input Count (for wgm 14,15) const byte picp1 = 8; // pb0 Input Capt const byte poc1A = 9; // pb1 const byte poc1B = 10; // pb2 //const byte poc2A = 11; // pb3 // reserved Tim2 // pins for debug const byte povf = 12; //pb4 const byte dovfS = B00010000; // to set/reset pin fast const byte pcap = 13; //pb5 const byte dcapS = B00100000; // counts for ints, just used to see if called byte volatile cntO; // overflow byte volatile cntA; // byte volatile cntB; // byte volatile
in „AVR Timer1 Capture und Overflow gleichzeitig“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
read_modifiziert.ino
/* This sketch shows how to read a PWM signal */ // Each signal must be read with an volatile unsigned int #include <PulseInput.h> volatile unsigned int input; /* each signal requires a variable */ void setup() { Serial.begin(9600); // 2. assign variables to receive signal attachPulseInput(8, input); // pin 8 as INPUT_PULLUP /* Generate pwm signal */ constexpr int PIN = 3; // PWM capable pin constexpr int ON_TIME = 1000; // Pulse width in microseconds constexpr float DUTY_CYCLE = ON_TIME * 255.0 / 2024.0; analogWrite(PIN, DUTY_CYCLE); /* To stop reading an already specified input, use this function
in „Induktiver Positionssensor - Fragen dazu“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Test1.ino
// Simple I2C test for 128x32 oled. // Use smaller faster AvrI2c class in place of Wire. // Edit AVRI2C_FASTMODE in SSD1306Ascii.h to change the default I2C frequency. // #include "SSD1306Ascii.h" #include "SSD1306AsciiAvrI2c.h" // 0X3C+SA0 - 0x3C or 0x3D #define I2C_ADDRESS 0x3C // Define proper RST_PIN if required. #define RST_PIN -1 SSD1306AsciiAvrI2c oled; //------------------------------------------------------------------------------ void setup() { #if RST_PIN >= 0 oled.begin(&Adafruit128x32, I2C_ADDRESS, RST_PIN); #else // RST_PIN >= 0 oled.begin(&Adafruit128x32, I2C_ADDRESS); #endif // RST_PIN
in „Mit Wire.h über I2C auf LCD-Display 1602 zugreifen“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
LCD_Example.ino
// |———————————————————————————————————————————————————————| // | made by Arduino_uno_guy 11/13/2019 | // | https://create.arduino.cc/projecthub/arduino_uno_guy| // |———————————————————————————————————————————————————————| #include LiquidCrystal_I2C.h #include Wire.h //initialize the liquid crystal library //the first parameter is the I2C address //the second parameter is how many rows are on your screen //the third parameter is how many columns are on your screen LiquidCrystal_I2C lcd(0x27, 16, 2); void setup() { //initialize lcd screen lcd.init(); // turn on the backlight lcd.backlight(); }
in „LCD-Display mit Arduino will nicht“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
trivial_demo.ino
#define PIN 0 #define K1 421.0 #define K2 751.0 uint32_t time_high, time_low, last_time, new_time; float temperature; void setup() { Serial.begin(12345); pinMode(PIN, INPUT); new_time = last_time = micros(); } void loop() { while(digitalRead(PIN)); new_time = micros(); time_high = new_time - last_time; last_time = new_time; while(!digitalRead(PIN)); new_time = micros(); time_low = new_time - last_time; last_time = new_time; temperature = K1 - (K2 * time_high) / (float)time_low; Serial.print(time_low); Serial.print(" "); Serial.print(time_high); Serial.print(" "); Serial.println(temperature); }
in „TMP05 Temperatursensor ohne µC auslesen“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
FILTER_median.ino
// Algo from Detlef _. (detlef_a) 19.05.2024 20:53 // https://www.mikrocontroller.net/topic/567716#7668204 //typedef float median_t; //typedef int32_t index_t; typedef int16_t median_t; typedef uint8_t index_t; #define NN (3) median_t median(median_t neu) { index_t k, m; static index_t gross[NN]; static index_t w = 0; static median_t alt[NN]; //Ini if (w == 0) { for (m = 0; m < NN; m++) alt[m] = 0; for (m = 0; m < NN; m++) gross[m] = m; w = 1; } // Den ältesten rausschmeissen k = 0; while (1) { if (gross[k] == NN - 1) break; k++; } while (1) { if (k == 0) break; gross[k] = gross[k - 1]; k--; } //
in „Effizienter Running Median“ · Digitale Signalverarbeitung / DSP / Machine Learning ·
-
Datei
motorSpeed.ino
/* * Speed measurement with optical encoder * On every rising edge the time delta to the last rising edge is printed to the serial port. * Additionaly LED_BUILTIN output shows the trigger point. * * 2024-06-27 Christoph M. */ // pin change interrupt base code: // https://wolles-elektronikkiste.de/en/interrupts-part-2-pin-change-interrupts const int interruptPin = 6; volatile bool event = false; volatile uint32_t TimeDelta = 0; volatile byte changedPin = 0; const byte interruptPinMask = 0b11111100; volatile byte lastInterruptPinsStatus = 0b01010100; volatile bool risingEdge = false; // PCINT2_vect
-
Datei
eforth_328.ino
/******************************************************************************/ /* Arduino eForth.C, 1.0: For Atmega328 on arduino Uno */ /******************************************************************************/ /* Chen-Hanson Ting */ /* Version 2.0, 06nov11cht */ /* Compile new commands in RAM */ /* */ /* Version 1.0, 21sep11cht */ /* Adopted from eForth_11.c */ /* Compiled by Arduino as a sketch */ /* Follow closely the original eForth model */ /* Kernel has 32 primitives */ /* code[] array must be filled with rom.mif produced by cefMETA328 */ /* @, !, C@ and C! access RAM memory */
in „eFORTH as Arduino Sketch“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
eforth_328.ino
/******************************************************************************/ /* Arduino eForth.C, 1.0: For Atmega328 on arduino Uno */ /******************************************************************************/ /* Chen-Hanson Ting */ /* Version 2.0, 06nov11cht */ /* Compile new commands in RAM */ /* */ /* Version 1.0, 21sep11cht */ /* Adopted from eForth_11.c */ /* Compiled by Arduino as a sketch */ /* Follow closely the original eForth model */ /* Kernel has 32 primitives */ /* code[] array must be filled with rom.mif produced by cefMETA328 */ /* @, !, C@ and C! access RAM memory */
in „eFORTH as Arduino Sketch“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
WebServer.ino
void handleRoot(AsyncWebServerRequest *request) { if (getDatafromMemoryAndConnect() == true || WiFi.isConnected()) { // Redirect to setupmanager. requestForWiFiList == true; request->redirect("/setupmanager.html"); } else { // Otherwise, redirect to Auth. requestForWiFiList == true; request->redirect("/setupmanager.html"); } } void serverHandles(){ server.on("/", handleRoot); server.on("/setupmanager", HTTP_POST, [](AsyncWebServerRequest *request) { request->send(SPIFFS,"setupmanager.html", "text/html"); }); server.on("/api/networks", HTTP_GET, [](AsyncWebServerRequest *request) { requestForWiFiList
in „ESP32 Watchdog Problem“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Blink_5000.ino
/* Starts with 15 flashes, then turns on an LED on for five seconds, then off for five seconds, repeatedly. modified 20 July 2024 by Manfred */ int StartCount = 0; void setup() { // initialize all ports pinMode (1, INPUT_PULLUP); pinMode (2, INPUT_PULLUP); pinMode (3, INPUT_PULLUP); pinMode (4, INPUT_PULLUP); pinMode (5, INPUT_PULLUP); pinMode (6, INPUT_PULLUP); pinMode (7, INPUT_PULLUP); pinMode (8, INPUT_PULLUP); pinMode (9, INPUT_PULLUP); pinMode (10, INPUT_PULLUP); pinMode (11, INPUT_PULLUP); pinMode (12, INPUT_PULLUP); pinMode (13, OUTPUT); pinMode (14, INPUT_PULLUP); pinMode (15, INPUT_PULLUP);
in „Schaltungsproblem oder Arduinoproblem“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
riscvCpu.ino
// https://github.com/cnlohr/mini-rv32ima/tree/master/mini-rv32ima // Copyright 2022 Charles Lohr, you may use this file or any portions herein under any of the BSD, MIT, or CC0 licenses. // 23.01.15 converted to Arduino by mchris // This Version can run on an Arduino Nano #include "minirv32ima.h" uint32_t ram_amt = MINI_RV32_RAM_SIZE; // online RISCV interpreter // https://www.cs.cornell.edu/courses/cs3410/2019sp/riscv/interpreter/ // online assembler // https://riscvasm.lucasteske.dev/ /* .global _boot .text _boot: andi x1,x1,0 addi x2,x2,1 loop: addi x2,x2,1 jal x3,loop */ uint8_t ram_image[] =
in „RISC/V kommt in Schwung“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
irsndconfig.h
------------------------------------------------------------------- * ESP8266 (Arduino, see IRSEND.ino) *--------------------------------------------------------------------------------------------------------------------------------------------------- */ #elif defined (__xtensa__) # define IRSND_PIN
in „IRMP - Infrared Multi Protocol Decoder“ · Projekte & Code ·
-
PDF
WS81.pdf
napi´cia) 8. feszültségválasztó kapcsoló (csak átkapc solható verziónál) 1. SieÈov˘ vypínaã 1. OmreÏno stikalo 1. Võrgulüliti 2. Optická kontrola regulácie 2. Vizualna kontrola krmiljenja 2. Optiline reguleerimis- 3. Otoãn˘ potenciometer na 3. Vrtljivi potenciometer za kontroll nastavenie teploty (plynulo
in „Lötstation nachbauen, aber welche“ · Mikrocontroller und Digitale Elektronik ·
-
PDF
positionsregelung.pdf
Diffcrenzbildungziehenundcrhält Umlechnrng aufUn.liehungcn somr ein Siiularionsmodell(Abbildung44), in den dic RcibunC duEh€ino Rc'bslton DiesenReibnron kün man diFkt nessc., inden @ dic Srrske .infrhäurcineb.slimr. vcnü.rtige DEhzlhl eselr undd.n dab.1lch einslellc.d.bstalon&e. Mdoßem nißr. D'cer slarionälc Mormtron enßpncht
in „Kaskaden Regelung Gleichstrommotor“ · Digitale Signalverarbeitung / DSP / Machine Learning ·
-
Datei
Web_IO_Status_Bedienung_Passwort_V3.txt
/* Web_Authentication.ino - Webduino Authentication example */ /* This example assumes that you're familiar with the basics * of the Ethernet library (particularly with setting MAC and * IP addresses) and with the basics of
in „Arduino - Webserver“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Web_IO_Status_Bedienung_Passwort_V3.cpp
/* Web_Authentication.ino - Webduino Authentication example */ /* This example assumes that you're familiar with the basics * of the Ethernet library (particularly with setting MAC and * IP addresses) and with the basics of
in „Arduino - Webserver“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Reset_Toner_Chip_SP150.ino
with Arduino Uno R3 // Sources: // http://www.mikrocontroller.net/topic/369267 // AND // FILE: Reset.ino // AUTHOR: Ludovic Guégan adjusted for SP150 Viktor D. // VERSION: 0.2 // PURPOSE: Reset chip for Ricoh SP150 toner // DATE: 2026-03-016 // // Released to the public domain //Wirings: #include <Wire.h
in „Hack: Ricoh Aficio SP100e Toner Chip“ · Projekte & Code ·
-
Datei
Reset_Toner_Chip_SP100e.ino
with Arduino Uno R3 // Sources: // http://www.mikrocontroller.net/topic/369267 // AND // FILE: Reset.ino // AUTHOR: Ludovic Guégan // VERSION: 0.1 // PURPOSE: Reset chip for Ricoh SP112 toner // DATE: 2016-03-03 // URL: https://github.com/lugu/reset_sp112 // // Released to the public domain // Last modified
in „Hack: Ricoh Aficio SP100e Toner Chip“ · Projekte & Code ·
-
Datei
MAX7219_8.ino
########################################################################### # File Name: MAX7219_5.ino # Board: Arduino UNO # Programming Language: Wiring / C /Processing /Fritzing / Arduino IDE # # Objective: Scrolling LED dot Matrix # # Operation: Scrolls a message over a 64x8 LED dot matrix ######
in „LED Matrix MAX7219 8x8 an Arduino will nicht.“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
SPI_Interrupt_UDP_SoftwareSerial_v3.ino
software) und gibt die Werte vom Arduino aus * Derzeitiger Master softwareSerial_HX711_Arduino_final.ino * * ATTENTION: * THE RX/TX-pins are not allowed to beo connected if the code * is uploades to the board * * MÖGLICHE PINBELEGUNGEN * * Variante 1 * --------------------------------------------------
in „ADXL345 und ESP8266: Echtzeitdatenergassung mit konstanter Abtastrate und Interrupts“ · Mikrocontroller und Digitale Elektronik ·
-
PDF
MAX4508-MAX4509.pdf
10V,NO_ = 0.2mA C, E 20 Ω Channels (Note 5) M 25 +25°C 0.5 +0.5 NO_ Off-Leakage Current – (Note 6) INO_(OFF) V NO_= ±10V, VCOM_ = +10V C, E -5 +5 nA M -50 +50 +25°C -2 +2 MAX4508 C, E -20 +75 M -200 +200 COM_ Off-Leakage Current ICOM_(OFF)V COM_ – ±10V, nA (Note 6) V NO_= +10V +25°C -1 +1 MAX4509 C,
in „Messsystem mit PhotoMOS“ · Analoge Elektronik und Schaltungstechnik ·
-
Datei
countdown_timer_4x7_seg_26082016.ino.ino
//Library #include <SevenSeg.h> //Seven Seg SevenSeg disp (5, 25, 28, 27, 6, 23, 22); //Defines the segments A-G: SevenSeg(A, B, C, D, E, F, G); //Constants const int numOfDigits =4; int digitPins [numOfDigits]={13,12,11,10}; //CC(or CA) pins of segment //13= left seg; 12= left_mittel; 11=right_mittel; 10= right; const int startBT = 7; const int changeBT = 8; const int setBT = 9; const int dotPoint1=A0; //left digit const int dotPoint2=A1; //left_mittel digit const int dotPoint3=A2; //right_mittel digit const int dotPoint4=A3; //right const int BrakeBT=2; //Interrupt PAUSE/Frage Taster //Variables
in „Countdown_with 4x7seg.Anzeigen“ · Mikrocontroller und Digitale Elektronik ·
-
PDF
74HC299_74HCT299_PHI.pdf
0, Q7 24 40 50 60 4.5 19 34 43 51 6.0 PHL/ PLH propagation delay 66 200 250 300 ns 2.0 Fig.6 CP to InO 24 40 50 60 4.5 19 34 43 51 6.0 PHL/ propagation delay 66 200 250 300 ns 2.0 Fig.7 MR to Q , Q or I/O 24 40 50 60 4.5 0 7 n 19 34 43 51 6.0 t 3-state output enable time 50 155 195 235 ns 2.0 Fig.9 PZH
in „74HC299 ansteuern“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
s65_display.ino
int rst = 4; int cs = 5; int clk = 6; int dat = 7; #define S65_WIDTH 176 #define S65_HEIGHT 132 void s65_writeReg(uint8_t reg) { digitalWrite(cs, LOW); s65_writeSPI(0x74); //index register s65_writeSPI(0x00); s65_writeSPI(reg); digitalWrite(cs, HIGH); return; } void s65_writeData(uint16_t data) { digitalWrite(cs, LOW); s65_writeSPI(0x76); //instruction or RAM data s65_writeSPI(data>>8); s65_writeSPI(data); digitalWrite(cs, HIGH); return; } void s65_writeCmd(uint8_t reg, uint16_t param) { s65_writeReg(reg); s65_writeData(param); return; } void s65_writeSPI(uint8_t data) { int mask; for(mask = 0x80; mask
in „PIC24FJ + S65 Display ohne Funktion“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
BlinkDemoForum.ino
/* Arduino-Sketch "Blinken und Warnblinken" Input: Zwei Taster (normal offen und LOW, bei Betätigung HIGH) Output: Zwei LEDs Programmlogik: Linker Taster: Schaltet blinken links an/aus Rechter Taster: Schaltet blinken rechts an/aus Beide Taster gleichzeitig: Warnblinken Das Warnblinken wird in ein blinken rechts oder links umgeschaltet, sobald während des Warnblinkens der linke oder rechte Taster betätigt wird */ // Anfang des Benutzerdefinierbaren Variablenbereichs #define BLINKPINLEFT 12 // digitaler Ausgang linke LED #define BLINKPINRIGHT 13 // digitaler Ausgang rechte LED #define BUTTONLEFT 2 //
in „programmierung arduino schalter“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
i2c.ino
#include "i2c.h" #include <util/twi.h> #include <util/delay.h> void init_i2c() { PORTC &= ~(1 << 4); PORTC &= ~(1 << 5); TWSR = 0;//(1 << TWPS0); TWBR = ((F_CPU/SCL_CLOCK)-16)/2;//I2C_PRESCALER; TWCR = (1 << TWEN); } void start_i2c() { TWCR = (1 << TWINT) | (1 << TWSTA) | (1 << TWEN); while(!(TWCR & (1 << TWINT))); if ((TWSR & 0xF8) != TW_START){ Serial.print(" |Error: Start -> "); Serial.print(TWSR & 0xF8); } } void send_i2c_address(uint8_t adr, uint8_t w) { send_i2c((adr<<1) | w); //send_i2c(0xD0); if ((TWSR & 0xF8) != TW_MT_SLA_ACK){ Serial.print(" |Error: ADRESS -> "); Serial.print(TWSR &
in „Atmega328P I2C - kein Ack vom Slave“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
lcd_wertbed_sprintf.ino
#include <LiquidCrystal.h> //Variablendeklaration ANFANG LiquidCrystal lcd(12,11,5,4,3,2); long potPin1 = A1; long potPin2 = A2; //Variablendeklaration ENDE void setup() { lcd.begin(16,2); lcd.clear(); lcd.setCursor(0,1); lcd.print("LADEDRUCK: "); lcd.setCursor(0,0); lcd.print("LADELUFT: "); //lcd.home(); im void loop-> set cursor0,0 pinMode(potPin1,INPUT); pinMode(potPin2,INPUT); } void loop() { char s[18]; lcd.setCursor(10,0); sprintf(s,"%4d", (analogRead(potPin1))); lcd.print(s); lcd.setCursor(10, 1); sprintf(s,"%4d", (analogRead(potPin2))); lcd.print(s); // Aber: Wenn du jetzt zügig von 0 bis
in „LCD und wertbedingter Text“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
AnalogInOutSerial.ino
/* Analog input, analog output, serial output Reads an analog input pin, maps the result to a range from 0 to 255 and uses the result to set the pulsewidth modulation (PWM) of an output pin. Also prints the results to the serial monitor and to 2 Virtual Instruments of program Serialcominstruments.exe. The circuit: * potentiometer connected to analog pin 0. Center pin of the potentiometer goes to the analog pin. side pins of the potentiometer go to +5V and ground * LED connected from digital pin 9 to ground created 29 Okt. 2013 by Dipl.Ing. gatsby This example code is in the public domain. */ //
in „Projekt: Virtuelle Instrumente an serielle Schnittstelle“ · Projekte & Code ·
-
Datei
Fertiger_Programtext_2.ino
#include <MenuItem.h> #include <Menu.h> #include <LiquidCrystal.h> #define lichtschranke1 A14 #define lichtschranke2 A15 LiquidCrystal lcd (8,9,4,5,6,7); Menu myMenu; float i=0; unsigned long start_Zeitmessung; unsigned long ende_Zeitmessung; float Geschwindigkeit = 0; float Bestenliste_1 = 0; float Bestenliste_2 = 0; int Grenze1 = 0; int Grenze2 = 0; int startSeen = 0; int endeSeen = 0; MenuItem item001 ("Messung", 001, 011, 001, 002, 002); MenuItem item002 ("Einstellung", 002, 012, 002, 001, 001); MenuItem item011 ("Start", 011, 011, 001, 021, 021); MenuItem item021 ("Bestenliste", 021, 021,
in „Lichtschranke Hilfe“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
ComInstruments1.ino
/****************************************************************************** Beispiel Funktion für SerialComInstruments mit dem Arduino Duemilanove avr.device = atmega328p avr.clock = 16000000 uart.baud = 38400 Datum : 06.11.2013 Autor : Dipl.Ing. gatsby *******************************************************************************/ // Senden eines Telegramms an den PC void SendString(byte InstrNr, int MWert) { Serial.print('#'); Serial.print(InstrNr); Serial.print('M'); Serial.print(MWert); Serial.print('<'); } // Die setup Routine wird nur einmal nach dem Reset durchlaufen: void setup()
in „Projekt: Virtuelle Instrumente an serielle Schnittstelle“ · Projekte & Code ·
-
Datei
ComInstruments2.ino
/****************************************************************************** Beispiel Funktion für SerialComInstruments mit dem Arduino Duemilanove Das Programm erzeugt künstliche Daten, die mit dem PC-Programm SerialComInstruments V0.33 Copyright Ulrich Albert Maassen Mönchengladbach angezeigt werden können. Damit kann das PC-Programm getestet werden und die Darstellungsmöglichkeiten des PC-Programms aufgezeigt werden. Eine Sinus-und Cosinuskurve wird erzeugt und an die Instrumente #90 und #51, #52 gesendet. Istwerte von 0..100 werden erzeugt und an die Instrumente #1, #40 und #60 gesendet. Die
in „Projekt: Virtuelle Instrumente an serielle Schnittstelle“ · Projekte & Code ·
-
Datei
ComInstruments2.ino
/****************************************************************************** Beispiel Funktion für SerialComInstruments mit dem Arduino Duemilanove Das Programm erzeugt künstliche Daten, die mit dem PC-Programm SerialComInstruments V0.33 Copyright Ulrich Albert Maassen Mönchengladbach angezeigt werden können. Damit kann das PC-Programm getestet werden und die Darstellungsmöglichkeiten des PC-Programms aufgezeigt werden. Eine Sinus-und Cosinuskurve wird erzeugt und an die Instrumente #90 und #51, #52 gesendet. Istwerte von 0..100 werden erzeugt und an die Instrumente #1, #40, #41 und #60 gesendet
in „Projekt: Virtuelle Instrumente an serielle Schnittstelle“ · Projekte & Code ·
-
Datei
sketch_miele3.ino
// DÜNSTABZUGSHAUBE DA-73 MIELE // Arduino Uno Rev.3 // Programm: Peter und Marian Barton // Stand 07.12.2013 #include <EEPROM.h> // Konstanten Deklaration int IN2 = 14; // Tastenfeld: int IN3 = 15; int IN4 = 16; int IN5 = 17; int IN6 = 18; int OUT7 = 10; // Triacs Steuerung: int OUT8 = 11; int OUT9 = 12; int OUT22 = 8; int OUT14 = 13; // LED Ausgabe: int OUT15 = 19; int OUT16 = 2; int OUT17 = 3; int OUT18 = 4; int OUT19 = 5; int OUT20 = 6; int OUT21 = 7; int OUT23 = 9; // Licht Relais: long timer15 = 90000; long timer30 = 180000; unsigned long filterTime = 10800000; int ledFeld[2][5]; //LED Matrix
in „Microcontroller für Abzugshaube (Miele DA73)“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Servo_abstand_LCD.ino
#include <TFT.h> #include <SPI.h> #include <Servo.h> #define echo 4 #define trig 10 #define CS A3 #define DC A2 #define RES 7 #define MOSI 6 #define SCLK 2 Adafruit_ST7735 screen = Adafruit_ST7735(CS, DC, MOSI, SCLK, RES); Servo myservo; // create servo object to control a servo // a maximum of eight servo objects can be created int dis; char disC[5]; String disS; int pos = 0; // variable to store the servo position void abstand(){ digitalWrite(trig, LOW); delayMicroseconds(2); digitalWrite(trig, HIGH); delayMicroseconds(10); digitalWrite(trig, LOW); dis = pulseIn(echo, HIGH); disS = String(dis
in „Servo Arduino“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Servo_abstand_LCD.ino
#include <TFT.h> #include <SPI.h> #include <Servo.h> #define echo 4 #define trig 10 #define CS A3 #define DC A2 #define RES 7 #define MOSI 6 #define SCLK 2 Adafruit_ST7735 screen = Adafruit_ST7735(CS, DC, MOSI, SCLK, RES); Servo myservo; // create servo object to control a servo // a maximum of eight servo objects can be created int dis; char disC[5]; String disS; int pos = 0; // variable to store the servo position int freeRam () { extern int __heap_start, *__brkval; int v; return (int) &v - (__brkval == 0 ? (int) &__heap_start : (int) __brkval); } void abstand(){ digitalWrite(trig, LOW); delayMicroseconds
in „Zuckungen Servo Arduino“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
LED_Matrix_Fehler.ino
int a=1,b=0,c=0,d=0,e=0,f=0,g=0,h=0; int input=0; #define display_array_size 8 #define data_null 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 // null char #define data_ascii_A1 a,b,c,d,e,f,g,h /** **"A" #define A { // {0, 0, 0, 0, 0, 0, 1, 0}, //0x02 {0, 0, 0, 0, 1, 1, 0, 0}, //0x0C {0, 0, 0, 1, 1, 0, 0, 0}, //0x18 {0, 1, 1, 0, 1, 0, 0, 0}, //0x68 {0, 1, 1, 0, 1, 0, 0, 0}, //0x68 {0, 0, 0, 1, 1, 0, 0, 0}, //0x18 {0, 0, 0, 0, 1, 1, 0, 0}, //0x0C {0, 0, 0, 0, 0, 0, 1, 0} //0x02 } **/ byte data_ascii[][display_array_size] = { data_null, data_ascii_A1 }; const int row1 = 2; // the number of the
in „Definieren von variable im laufenden Programm“ · Softwareentwicklung ·
-
Datei
LED_Matrix_Original.ino
LED_Matrix_Original.ino
in „Definieren von variable im laufenden Programm“ · Softwareentwicklung ·
-
Datei
LED_Matrix_Fehler.ino
unsigned int input=0; unsigned int in; unsigned int a[8]; #define display_array_size 8 #define data_null 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 // null char byte data_ascii[][display_array_size] = { data_null, {a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7]} }; const int row1 = 2; // the number of the row pin 24 const int row2 = 3; // the number of the row pin 23 const int row3 = 4; // the number of the row pin 22 const int row4 = 5; // the number of the row pin 21 const int row5 = 17; // the number of the row pin 4 const int row6 = 16; // the number of the row pin 3 const int row7 = 15; // the
in „2 stellige Zahl Seriell übertragen“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
sensorless_bl_test.ino
/* 3 = HIGH A 5 = HIGH B 6 = HIGH C 9 = LOW A 10 = LOW B 11 = LOW C */ byte state = 1; int bmf_a = 0; int bmf_b = 0; int bmf_c = 0; int bmf_all = 0; void setup() { //Serial.begin(9600); pinMode(A0,INPUT); pinMode(A1,INPUT); pinMode(A2,INPUT); pinMode(A3,INPUT); pinMode(3, OUTPUT); pinMode(5, OUTPUT); pinMode(6, OUTPUT); pinMode(9, OUTPUT); pinMode(10, OUTPUT); pinMode(11, OUTPUT); // 4khz PWM TCCR0A = _BV(COM0A1) | _BV(COM0B1) | _BV(WGM00); TCCR0B = _BV(CS01); TCCR1A = _BV(COM1A1) | _BV(COM1B1) | _BV(WGM10); TCCR1B = _BV(CS11); TCCR2A = _BV(COM2A1) | _BV(COM2B1) | _BV(WGM20); TCCR2B = _BV(CS21
in „BLDC Kommutieren“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
TNARX_lcd_komm.ino
int cs = 3; int clock = 4; int data = 5; byte bild[112] ={0,0,0,0,0,0,0,0, //1. Stelle (ganz rechts) c,x,d,b,g,a,e,f x=nicht belegt/keine Auswirkung) 1,0,1,1,0,1,1,1, //2. Stelle: 0 (als Beispiel) 1,0,0,1,0,0,0,0, //3. Stelle: 1 0,0,1,1,1,1,1,0, //4. Stelle: 2 1,0,1,1,1,1,0,0, //5. Stelle: 3 1,0,0,1,1,0,0,1, //6. Stelle: 4 1,0,0,0,1, // Glocke,Schrägstich,MEM,CHAN,x 1,0,0, // 1(DP),0(DQ),0(DR) - 1/2 duty, obere Segmente D54-D112 folgen) //hier beginnt die obere Hälfte 1,0,1,0,1,1,0,1, //7. Stelle: 5 1,0,1,0,1,1,1,1, //8. Stelle: 6 1,0,0,1,0,1,0,0, //9. Stelle: 7 1,0,1,1,1,1,1,1, //10. Stelle: 8 1,0,1,1,1,1,0,1
in „Dokumentation gesucht (UC121902-TNARX-A)“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Drehgeber_per_interrupt.ino
/* Drehgeberauswertung per Interrupt auf einem AVR. Das gezeigte C-Beispielprogramm läuft auf einem ATmega328. Hier wurde testweise ein Arduino UNO R3 verwendet, da ohne große Löterei Stromversorgung und Datenausgabe über den USB-Anschluß erledigt werden. Zum Test wurde ein mechanischer Drehgeber verwendet, dessen gemeinsamer Anschluß an 0V (GND) liegt. An einem Schaltausgang, hier PHASE_A genannt, wird mit einen 10k Pullup- Widerstand nach +5V (VCC) der '1'-Pegel erzeugt und über ein RC-Glied (Tiefpass) 100k/1nF an den INT0- Eingang des ATmega328 (PORTD.2) gelegt. (beim Arduino: digitaler Eingang "2
in „Drehgeber per Interrupt auswerten, AVR“ · Projekte & Code ·
-
Datei
I2CVersuch.ino
#include "NDP.h" #include <Wire.h> #define ESP_SLAVE_ADDR 0x42 volatile uint8_t matchToSend = 0; void sendit(char* label) { // LED blau bei Match nicla::leds.begin(); nicla::leds.setColor(blue); delay(200); nicla::leds.setColor(off); nicla::leds.end(); if (strcmp(label, "NN0:Helmet") == 0) matchToSend = 0x01; else if (strcmp(label, "NN0:Iron Man") == 0) matchToSend = 0x02; else if (strcmp(label, "NN0:Shutdown") == 0) matchToSend = 0x03; else if (strcmp(label, "NN0:Startup") == 0) matchToSend = 0x04; else if (strcmp(label, "NN0:Repulsor") == 0) matchToSend = 0x05; else if (strcmp(label, "NN0:Stones
-
Datei
I2CESP.ino
#include <Wire.h> #define NICLA_MASTER_ADDR 0x42 #define LED_PIN 2 #define I2C_SDA 19 #define I2C_SCL 16 volatile uint8_t lastMatch = 0; void receiveEvent(int howMany) { while (Wire.available()) { lastMatch = Wire.read(); if (lastMatch != 0) { digitalWrite(LED_PIN, HIGH); delay(150); digitalWrite(LED_PIN, LOW); delay(150); } } } void setup() { pinMode(LED_PIN, OUTPUT); digitalWrite(LED_PIN, LOW); Wire.begin(NICLA_MASTER_ADDR, I2C_SDA, I2C_SCL); Wire.onReceive(receiveEvent); } void loop() { // passiv warten }
-
Datei
BluetoothNiclaKannSenden.ino
#include <ArduinoBLE.h> BLEService testService("12345678-1234-1234-1234-1234567890ab"); BLEByteCharacteristic testChar( "87654321-4321-4321-4321-ba0987654321", BLERead | BLENotify ); uint8_t counter = 1; unsigned long lastSend = 0; void setup() { Serial.begin(115200); BLE.begin(); BLE.setLocalName("NiclaBLETest"); BLE.setAdvertisedService(testService); testService.addCharacteristic(testChar); BLE.addService(testService); testChar.writeValue((byte)0x00); BLE.advertise(); Serial.println("BLE Test Advertised"); } void loop() { BLE.poll(); BLEDevice central = BLE.central(); if (!central || !central.connected
-
Datei
BluetoothESPKAnnEmpfangen.ino
#include <ArduinoBLE.h> BLEDevice nicla; BLECharacteristic testChar; void setup() { Serial.begin(115200); while (!Serial); if (!BLE.begin()) { Serial.println("BLE init failed"); while (1); } Serial.println("ESP BLE scanning..."); BLE.scan(); // 🔥 DAS HAT GEFEHLT } void loop() { BLE.poll(); if (!nicla) { BLEDevice dev = BLE.available(); if (dev) { Serial.print("Found device: "); Serial.println(dev.localName()); if (dev.localName() == "NiclaBLETest") { Serial.println("Connecting to Nicla..."); BLE.stopScan(); if (dev.connect()) { Serial.println("Connected"); dev.discoverAttributes(); testChar = dev.characteristic
-
Datei
FunktionierendeSpamBluetooth.ino
#include "NDP.h" #include <ArduinoBLE.h> // BLE Service & Characteristic UUIDs BLEService matchService("12345678-1234-1234-1234-1234567890AB"); BLEByteCharacteristic matchChar("87654321-4321-4321-4321-BA0987654321", BLERead | BLENotify); volatile uint8_t matchID = 0; volatile bool matchPending = false; volatile int lastLabelIndex = -1; // letztes gesendetes Label merken // Alle Labels in Array definieren const char* labels[] = { "Combat", "Helmet", "Iron Man", "Repulsor", "Shutdown", "Startup", "Stones", "noise", "unknown" }; // Callback bei Match void sendMatch(int labelIndex) { // Nur neues Label
-
Datei
mit_ohne_analogRead.ino
void setup() { pinMode(PC13, OUTPUT); //pinMode(PA5, INPUT); } void loop() { digitalWrite(PC13, LOW); Serial.println("Tick"); delay(500); digitalWrite(PC13, HIGH); Serial.println("Tack"); //Serial.println(analogRead(PA5)); }
in „Warum ist die USB/CDC Implementierung der Cube HAL so groẞ?“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
ntc_cout_demo.ino
/* -------------------------------------------------------- ntc_cout_demo.cpp demonstriert die Verwendung eines abgepeckten cout in Verbindung mit einem NTC-Widerstand 07.03.2026 R. Seelig -------------------------------------------------------- */ #include <Arduino.h> #include "cout_light.h" #include "v003_adc.h" // Objektinstanz fuer cout_light cout_light<HardwareSerial> cout_serial(Serial); ADC ntc1(PD4); // und Umleiten auf den Namen "cout" ... :-) nicht ganz die feine Art #define cout cout_serial // mittels LookUp-Table Generator aus // www.jjflash.de/ntc_table_v2.html erzeugte Tabelle // und
in „CH32V003 und Arduino“ · Mikrocontroller und Digitale Elektronik ·