#include <Wire.h> int value = 0; int value_max; long time_start; int impuls = 119; //select the pulse length depending on the frequency int measure_time = 0; int base = 0; void setup() { pinMode(A0, INPUT); pinMode(A1, INPUT); pinMode(8, OUTPUT); pinMode(A4, INPUT); pinMode(A5, OUTPUT); } void loop() { measure_time = analogRead(A4); // determining the measure-time between [0,1023] µsec digitalWrite(8,HIGH); // creating a pulse in the excitation coil with the duration = impuls µs delayMicroseconds(impuls); digitalWrite(8, LOW); value_max = 0; time_start = micros(); while(micros() - time_start <
millis() Gedönse ist in C. Man kann auch ganz ohne C++ in der Arduinowelt auskommen. Einfach die *.ino leer lassen und eine *.c Datei anlegen mit einer main() Funktion. So gehen auch reine *.S Assembler Anwendungen. Aber grundsätzlich hast du recht! Arduino ist meist C++. Nicht im Kern, aber rundherum
Arduino F. schrieb im Beitrag #7956639: > In *.cpp oder *.ino nicht. okay, also im *.ino gehts also gar nicht - okay. Wastl schrieb im Beitrag #7956640: > Bist du zu > faul die paar Beiträge dieses Threads zu lesen? Ja, ich bin sehr faul. Nemopuk
Thorsten S. schrieb im Beitrag #7956698: > okay, also im *.ino gehts also gar nicht - okay. Die PROGMEM Geschichte geht, auch auf AVR Arduino in *.ino oder *.cpp die __flash Geschichte nur in *.c Dateien. Random .. schrieb im Beitrag #7956697: > Warum landet
/* PIO frequency measurement 2025-10-21 mchris https://www.mikrocontroller.net/topic/580993#7954679 PIO Assembler: https://wokwi.com/tools/pioasm */ #include "fmes.pio.h" // Includes the compiled PIO assembly program for blinking #include <hardware/gpio.h> #include <hardware/pio.h> #include "hardware/clocks.h" #define TESTPIN 16 // Macro for frequency input // function to translate #if defined(ARDUINO_ARCH_MBED) #include <pinDefinitions.h> static int translate_pin(int pin) { return digitalPinToPinName(pin); } #else static int translate_pin(int pin) { return pin; } #endif static PIO pio; static
espressif/arduino-esp32/blob/release/v3.0.x/libraries/ESP32/examples/AnalogOut/ledcFrequency/ledcFrequency.ino [code] Bit resolution | Min Frequency [Hz] | Max Frequency [Hz] 1 | 489 | 40078277 2 | 245 | 20039138 3
struct Daten { // static const byte READ_BUFFER_SIZE {20}; static const int READ_BUFFER_SIZE {15000}; // Datentyp und Arraygrösse geändert - Es sollen Dateien bis ca. 10 kB eingelesen werden. char rxBuffer [READ_BUFFER_SIZE + 1] {'\0'}; // Platz für 20 Zeichen + Null-Terminator //byte index {0}; int index {0}; // Datentyp aufgrund Puffergrösse geändert char c {'\0'}; }; Daten meinBuffer; int total = 0; void setup() { Serial.begin(19200); } void loop() { // liefert true wenn das LF eingelesen wurde if (readLine(Serial, meinBuffer)) { Serial.print("Eingelesen: "); Serial.println(meinBuffer.rxBuffer
Multi_Clock_Kai_NEC_Send_Big_R4_WiFi_2025.ino
void setup(){
// Perform once at startup
lc.shutdown(0,false);
// The MAX72XX is in power-saving mode on startup,
// and lc.setIntensity(0,0);
// Set brightness to a low value
lc.setIntensity(0,0);
Multi_Clock_Kai_NEC_Send_Big_R4_WiFi_2025.ino
void setup(){
// Perform once at startup
lc.shutdown(0,false);
// The MAX72XX is in power-saving mode on startup,
// and lc.setIntensity(0,0);
// Set brightness to a low value
lc.setIntensity(0,0);
Multi_Clock_Kai_NEC_Send_Big_R4_WiFi_2025.ino - Arduino IDE 2.3.6
void setup(){
// Perform once at startup
lcd.shutdown(0,false);
// The MAX72XX is in power-saving mode on startup,
// and LCD is turned off;
lcd.setIntensity(0,0);
// Set brightness
Melody_ARM_aus_EEPROM_all.ino.map [GCC3]
All By Module By File By Section By SubSection Memory Configuration Parser trace
Section SubSection Address Size Demangled Name Module Name File Name
.bss .bss 20000260 28
.bss .bss 2000027c
Melody_ARM_aus_EEPROM_all.ino - Arduino UNO R4 WiFi
int divider = 0;
int notes = 50;
// All songs are shortened to 60 notes
for (snd = 1; snd < 10; snd++);
// Play melody 8 + 9
Ausgabe Serieller Monitor X
Copy flash to eeprom
1
// **************************************************** // Melodien aus EEPROM vom 27. 09. 2025 // **************************************************** const /*PROGMEM*/ char title[] = { // List of text for melody-titles new 30.06.2025 - change number_mel too! "Asa Branca " // 1 Asa Branca 0 text-length 14 all titles full length "Take on me " // 2 Take on me "Starwars " // 3 Starwars "Cantina-Band " // 4 Cantina-Band "Game of Throne" // 5 Game of Thrones "Fuer Elise " // 6 Für Elise "Greensleeves " // 7 Greensleeves "Silent Night " // 8 Silent Night "Happy Birthday" // 9 Happy Birthday "Nokia Ringtone
void melodie(){ // Play melody 1- number mel from external eeprom - new if (snd > 0){ // Melody not stopped ofset = (snd-1) * ((length*4) +15); // Offset = 0*50*2= 0, 1*50*2 = 100 integers! *2 -> *4 int ext_ee_adr = EXT_EE_MELODY_R+1 + ofset; // Address base + offset - ignore first byte which is the data-type - moved to here 26-09-2025 tempo=read_ext_eeprom(ext_ee_adr + 14); // Melody tempo starts at address +14 int wholenote = (60000 * 4) / tempo; // Calculate note (tempo is integer) int divider = 0, noteDuration = 0; // Clear divider and note duration divider=read_integer(ext_ee_adr+15+thisNote
// **************************************************** // Melodien aus PROGMEM vom 27. 09. 2025 // **************************************************** const PROGMEM char title[] = { // List of text for melody-titles new 30.06.2025 - change number_mel too! "Asa Branca " // 1 Asa Branca 0 text-length 14 all titles full length "Take on me " // 2 Take on me "Starwars " // 3 Starwars "Cantina-Band " // 4 Cantina-Band "Game of Throne" // 5 Game of Thrones "Fuer Elise " // 6 Für Elise "Greensleeves " // 7 Greensleeves "Silent Night " // 8 Silent Night "Happy Birthday" // 9 Happy Birthday "Nokia Ringtone
#include "util/atomic.h" unsigned long mymillis = 0; int main (void) { const unsigned long eventInterval = 1000; unsigned long previousTime = 0; DDRB |= (1 << PB5); TCCR1B |= (1 << WGM12); // Configure timer 1 for CTC mode TIMSK1 |= (1 << OCIE1A); // Enable CTC interrupt OCR1A = 7999; // Set CTC compare value to 1 Hz at 8 MHz AVR clock , with a prescaler of 256 TCCR1B |= (1 << CS00); // Start timer at F_CPU /256 sei (); // Enable global interrupts while (1) { // Updates frequently unsigned long currentTime; ATOMIC_BLOCK(ATOMIC_RESTORESTATE) currentTime = mymillis; // This is the event if (currentTime
gerade auch bemerkt! Dank eines dummen Tippfehlers ist aus meiner beabsichtigten a.c Datei eine ac.ino geworden. Ist mir gerade erst aufgefallen. Nach der Korrektur zeigt sich, dass C das nicht so tut. Also ab jetzt behaupte ich das Gegenteil von eben.
etwas, aber es soll ohne "lib" sein. Verstehe ich nicht. Wenn der Code unbedingt Bestandteil deiner ino Datei sein soll, dann kopiere die benötigten Teile. Was ist daran so schwer? Meine Vermutung: Du willst (dir selbst) ein eigenes Bauwerk vortäuschen, ohne dafür zu lernen wie es funktioniert. Das
#include "uMuxOutputLib.h" #include "debounce.h" constexpr size_t Id1up=3; constexpr size_t Id1dn=0; constexpr size_t Id2up=2; constexpr size_t Id2dn=1; constexpr size_t incount=4; constexpr bool AN=true; constexpr bool AUS=false; constexpr bool ACTIVE_MUX=true; int pins[8] = {6, 7, 8, 9, 10, 11, 12, 13}; int muxes[4] = {3, 2, 4, 5}; const int inpins[incount] = {A0, A1, A2, A3}; const bool cg[11][7] = { /* 0 */ { /* a */ AN, /* b */ AN, /* c */ AN, /* d */ AN, /* e */ AN, /* f */ AN, /* g */ AUS }, /* 1 */ { /* a */ AUS, /* b */ AN, /* c */ AN, /* d */ AUS, /* e */ AUS, /* f */ AUS, /* g */ AUS
/* KC85 Keyboard changes to make consistent output - "A" is now 0x03 like in my chart - debounce - happiness version 26.07.2025 V0: USB-keyboard function: ********************************************* FOR EASIER FLASHING: pin 9 is inputpullup: wen tied to ground the pro micro does not act like a keyboard ********************************************* * * */ /* * scannumber * * * * */ #include <Keyboard.h> #define Serialbaudrate 115200 #define jumperin 9 // Times, wir bleiben daruntger, weil wir nachher der größe nach abfragen, ob größer als #define TIME_MINIMUM 1000 #define TIME_ZERO 4800//unter 5000
Wenn Dich das nervt, mach Dir eine neue .ino Datei und pack dort ElegantOTA Lite hinein. Geht beides gut, als Client oder als AP. https://www.mikrocontroller.net/topic/goto_post/7894518
/* LICENCE see end of file! */ /* Environemental note The program is created for Arduino/ESP8266 and is tested on WIN10 only! */ /* --->>> READ THIS: <<<--- Developer, don't forget to update the version number here! */ // File main control ---------------------------------------------------------- #pragma once // Use this file only once to avoid redefinition problems class SplitText { /** * @class SplitText * @brief Utility class for identifying start and end indices of "words" * within a text using protected and non-protected delimiters. * * This class is a helper class to OledPrint and processes
/* LICENCE see end of file! */ /* Environemental note The program is created for Arduino/ESP8266 and is tested on WIN10 only! */ /* --->>> READ THIS: <<<--- Developer, don't forget to update the version number here! */ // Values visible in THIS file only! // namespace SelfValues { // static constexpr char FILE_AND_VERSION[] = "00.0025"; // } #ifndef DUMMY // Macro statements ============================================= #ifndef DUMMY // 3rd party includes ------------------------------------------- // 3rd party files #include <Arduino.h> #include <Streaming.h> // For convenient printouts to Serial
6602-dcf77-decoder https://github.com/udoklein/dcf77/blob/master/examples/Simple_Clock/Simple_Clock.ino http://www.n4iqt.com/wwv/EM6_wwvbE.pdf https://blog.blinkenlight.net/experiments/dcf77/dcf77-receiver-modules/ hier im Forum: https://www.mikrocontroller.net/topic/487789#6124845 https://www.mikrocontroller.net
we flashed with the LED and used 10% of the available memory. Now we will use the basic-blink-pin.ino program. After compiling it, it will has 468 bytes. The difference is 430 bytes.
const int led = 0;
const int sleep = 1000;
// the setup routine runs once when you press reset:
void setup() {
// initialize