-
Datei
18-002A.ino
#include <RF24Network.h> #include <RF24.h> #include <RF24Mesh.h> #include <ESP8266WiFi.h> #define _VERSION 1005 uint32_t displayTimer = 0; // NRF24L01+ CE auf GPIO15 / Pin12 RF24 radio(15, 2); // CE, CS RF24Network network(radio); RF24Mesh mesh(radio,network); void setup(void){ WiFi.setAutoConnect ( false ); pinMode(12,OUTPUT); //B pinMode(16,OUTPUT); //R pinMode(14,OUTPUT); //G pinMode(0,OUTPUT); //SCK pinMode(5,INPUT); //MISO pinMode(4,OUTPUT); //MOSI pinMode(2,OUTPUT); //CS pinMode(15,OUTPUT); //CE //pinMode(9, INPUT); //IRQ analogWrite(12,120); analogWrite(14,150); analogWrite(16,200); Serial.begin
in „ESP8266 - Arduino - HTTP Get, ESP stürzt ab.“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
18-002A.ino
#include <RF24Network.h> #include <RF24.h> #include <RF24Mesh.h> #include <ESP8266WiFi.h> #include <ESP8266HTTPClient.h> #define _VERSION 1005 uint32_t displayTimer = 0; // NRF24L01+ CE auf GPIO15 / Pin12 RF24 radio(15, 2); // CE, CS RF24Network network(radio); RF24Mesh mesh(radio,network); const char* ssid = "M287E09"; const char* password = "123456789"; // Global variables void setup(void){ Serial.begin(115200); Serial.println(); Serial.print("Version: "); Serial.println(_VERSION); Serial.println("Booting Sketch..."); WiFi.setAutoConnect ( false ); while(WiFi.waitForConnectResult() != WL_CONNECTED
in „ESP8266 - Arduino - HTTP Get, ESP stürzt ab.“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
WebStream-web.ino
/* WebRadio Example Very simple HTML app to control web streaming Copyright (C) 2017 Earle F. Philhower, III 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
in „Webradio basteln“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Atmega328_Interrupt.ino
/* --------------------------------------------------------- * Interrupt Definitionen * -------------------------------------------------------- */ #include <avr/sleep.h> #include <avr/interrupt.h> #include <avr/io.h> volatile int led = 10; // entspricht PB1 volatile int interrupt = 9; //entspricht PB0 /*-------------------------------------------------------------- * Bluetooth Definitionen * ------------------------------------------------------------- */ //#include <Arduino.h> #include <SPI.h> #include "Adafruit_BLE.h" #include "Adafruit_BluefruitLE_SPI.h" #include "Adafruit_BluefruitLE_UART.h
in „Atmega328, Probleme mit Interrupt und Bluetooth“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
AchtfachRelaisSchalten.ino
/** * 8 Taster, gegen GND geschaltet * also invers funktionierend * * 8 Relais auf einer der China üblichen Relaiskarte * ebenfalls invers schaltend * * Die Entprellzeit von 20ms ist in CombieTimer als default * vorgegeben. * * Funktion: * Jeder Tastendruck toggelt den Schaltzustand des zugehörigen Relais. */ #include <CombiePin.h> #include <CombieTimer.h> #include <CombieTools.h> class Task // Interface { public: virtual void init() = 0; virtual void run() = 0; }; template<byte inPin,byte outPin> class Taster2Relais: public Task { private: Combie::Pin::TasterGND<inPin> taster; Combie::Pin::RelaisINV
in „statische Polymorphie per CRTP in Embedded Systemen“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Fading_atiny_85.ino
/* Fading This example shows how to fade an LED using the analogWrite() function. The circuit: - LED attached from digital pin 9 to ground. created 1 Nov 2008 by David A. Mellis modified 30 Aug 2011 by Tom Igoe This example code is in the public domain. http://www.arduino.cc/en/Tutorial/Fading */ int ledPin = 4; // LED connected to digital pin 9 void setup() { // nothing happens in setup } void loop() { // fade in from min to max in increments of 5 points: for (int fadeValue = 0 ; fadeValue <= 255; fadeValue += 5) { // sets the value (range from 0 to 255): analogWrite(ledPin, fadeValue); // wait
in „Arduino as ISP“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
pdc_uno_CAN_.ino
#include <mcp_can.h> #include <SPI.h> const int SPI_CS_PIN = 10; MCP_CAN CAN(SPI_CS_PIN); int cm ; void setup() { pinMode(A5,OUTPUT); analogWrite(A5,0); pinMode(A0, INPUT); Serial.begin(115200); Serial.println("restart UNO PDC CAN BUS"); while (CAN_OK != CAN.begin(CAN_500KBPS)) {Serial.println("CAN BUS MCP 2515 / MCP 2562 init fail"); Serial.println(" Init CAN BUS again"); delay(100); } Serial.println("CAN BUS init ok!"); } unsigned char stmp[8] = {0, 0, 0, 0, 0, 0, 0, 0}; void loop() { if ( analogRead(A0)> 400){ Serial.print("r : "); Serial.println(" ON !!!!!!!!!!!!!!!!!!!!"); stmp[0] = 64; }
-
Datei
tiny1b.ino
#include <avr/io.h> #include <avr/wdt.h> #include <avr/interrupt.h> #include <avr/sleep.h> #include <util/delay.h> #define DUTY 20 #define LED_PIN PB0 #define ONTIME 7210 #define OFFTIME 10101 //#define ONTIME 213 //#define OFFTIME 425 //#define ONTIME 5 //#define OFFTIME 5 #define BIT(x) (1<<x) #define N_1 (_BV(CS00)) #define N_8 (_BV(CS01)) #define N_64 (_BV(CS01) | _BV(CS00)) #define N_256 (_BV(CS02)) #define N_1024 (_BV(CS02) | _BV(CS00)) static void setPrescaler(uint8_t mode) { cli(); CLKPR = bit(CLKPCE); CLKPR = mode; sei(); } uint8_t onoff = 1; volatile uint16_t seccount = 0; volatile uint16
in „AtTiny13: Watchdog Interrupt dauert lange“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Multi_SD_SIM.ino
/* (C) 2019 R.Schick / Thorsten Gurzan - beelogger.de 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
in „Wird diese if-Schleife jemals ausgeführt?“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
DTZ_Logger_OPEN.ino
/** * DTZ Logger * Version 3.3.OPEN (ohne Datenverschlüsselung des gesendeten Datenstromes) * 25.06.2021 P. Rebesky **/ #include <ESP8266WiFi.h> //ESP8266 Core WiFi Library #include <ESP8266WiFiMulti.h> //ESP8266 Core WiFi Library #include <DNSServer.h> #include <ESP8266WebServer.h> //Local WebServer #include "configDTZ.h" #include "strings.h" #include <LittleFS.h> // LittleFS is declared #include <NTPClient.h> #include <base64.h> #include <WiFiManager.h> // https://github.com/tzapu/WiFiManager #include <ESP8266HTTPClient.h> #include <WiFiClient.h> ADC_MODE(ADC_VCC); #define BoardTaster 0 #define
in „DTZ541 mMe Datenlogger mit ESP (WEB-Sicht)“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
UhrWS2812.ino
/** * NeoClock * * Clock using 60 WS2812B/Neopixel LEDs and DS3231 RTC * * Libraries needed: * * Adafruit NeoPixel (Library Manager) - Phil Burgess / Paint Your Dragon for Adafruit Industries - LGPL3 * * Rtc by Makuna (Library Manager) - Michael C. Miller * * Arduino Timezone Library (https://github.com/JChristensen/Timezone) - Jack Christensen - CC-BY-SA * * Time Library (https://github.com/PaulStoffregen/Time) - Paul Stoffregen, Michael Margolis - LGPL2.1 */ #include <Adafruit_NeoPixel.h> #ifdef __AVR__ #include <avr/power.h> #endif #if defined(ESP8266) #include <pgmspace.h> #else #include <avr/
in „LED Uhr mit RTC braucht Taster“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
i2cscanner.ino
// ------------------------------------------ // AI Thinker A1S Chip identifier for Arduino // i2c_scanner Easy LED detection // AC101 LED 4 is high (next to earphone jack) // ES8388 LED 5 is active (next to earphone jack) // Serial messages 115200 are also available // Friedemann Wolpert 2021 #include <Wire.h> const byte led_5 = 19; const byte led_4 = 22; void setup() { bool bFound = false; Wire.begin(33, 32); // Begin with AC-101 Audio Codec Chip pinMode(led_4, OUTPUT); pinMode(led_5, OUTPUT); Serial.begin(115200); Serial.println("\nsetup() finished\n"); digitalWrite(led_4, HIGH); // turn the LED
in „ESP32 A1S Eval“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
SimpleBleDevice.ino
// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the
in „ESP32 D1 MINI als Bluetooth Master“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
BLE_server_multiconnect.ino
/* Video: https://www.youtube.com/watch?v=oCMOYS71NIU Based on Neil Kolban example for IDF: https://github.com/nkolban/esp32-snippets/blob/master/cpp_utils/tests/BLE%20Tests/SampleNotify.cpp Ported to Arduino ESP32 by Evandro Copercini updated by chegewara Create a BLE server that, once we receive a connection, will send periodic notifications. The service advertises itself as: 4fafc201-1fb5-459e-8fcc-c5c9c331914b And has a characteristic of: beb5483e-36e1-4688-b7f5-ea07361b26a8 The design of creating the BLE server is: 1. Create a BLE Server 2. Create a BLE Service 3. Create a BLE Characteristic
in „ESP32 D1 MINI als Bluetooth Master“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
DTZ_Logger_OPEN.ino
/** * DTZ Logger OPEN without encryption * Version 3.6 * 28.08.2021 P. Rebesky * author Creator P.Rebesky * Copyright (©): 2020-2022 by Peter Rebesky * This code can use in private cases only. Every business or companies using of this codes or codes parts is required an approval of us (me) * Every private using can exchange some parts of code or modify some code-lines. This code is allowed change for private use only. * This software is basicly owned by Peter Rebesky and any comercial using is forbidden without approval of us (me). **/ #include <ESP8266WiFi.h> //ESP8266 Core WiFi Library #include <ESP8266WiFiMulti.h
in „DTZ541 mMe Datenlogger mit ESP (WEB-Sicht)“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
DTZ_Logger_OPEN.ino
/** * DTZ Logger OPEN without encryption * Version 3.6 * 28.08.2021 P. Rebesky * author Creator P.Rebesky * Copyright (©): 2020-2022 by Peter Rebesky * This code can use in private cases only. Every business or companies using of this codes or codes parts is required an approval of us (me) * Every private using can exchange some parts of code or modify some code-lines. This code is allowed change for private use only. * This software is basicly owned by Peter Rebesky and any comercial using is forbidden without approval of us (me). **/ #include <ESP8266WiFi.h> //ESP8266 Core WiFi Library #include <ESP8266WiFiMulti.h
in „DTZ541 mMe Datenlogger mit ESP (WEB-Sicht)“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Multi_LED_Blinker.ino
#define LED_CNT 20 #define TIME_STEP 10 // Millisekunden typedef struct { unsigned int pin; unsigned int period; unsigned int duty; unsigned int cnt; } led_t; // Definition der LED-Blinkmuster // Periodendauer und Leuchtdauer in 10ms Schritten led_t leds[LED_CNT] = { // IO-Pin, Periode, Leuchtdauer, Zaehler {1, 20, 10, 1000}, {2, 30, 5, 1000}, {3, 40, 3, 1000}, {4, 99, 50, 1000}, {5, 77, 60, 1000}, {6, 66, 60, 1000}, {7, 88, 5, 1000}, {9, 101, 50, 1000}, {10, 200, 100, 1000}, {11, 300, 10, 1000}, {12, 400, 350, 1000}, {13, 500, 250, 1000}, {14, 1000, 100, 1000}, {15, 999, 100, 1000}, {16, 777,
in „20 LEDs unterschiedlich blinken lassen“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
xmem-test-2.ino
void setup() { uint32_t arraysize = 1024; Serial.begin(57600); XMCRA |= 1ul<<7; // Switch ext mem iface on XMCRB = 0; static uint32_t dataBuffer1[1024]; static uint32_t dataBuffer2[1024]; static uint32_t dataBuffer3[1024]; static uint32_t dataBuffer4[1024]; static uint32_t dataBuffer5[1024]; uint32_t* dataBuffer6 = new uint32_t[arraysize]; uint32_t* dataBuffer7 = new uint32_t[arraysize]; Serial.println(); Serial.print("Dynamic buffer 1 of "); Serial.print(arraysize * sizeof(uint32_t)); Serial.print(" bytes created, address: 0x"); Serial.println((uintptr_t)dataBuffer1, HEX); Serial.print("Dynamic
in „Arduino Mega2560 mit externem RAM: linker flag für .data section geht nicht“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
ESP32_SPItest.ino
#include <SPI.h> SPIClass SPI1(HSPI); void setup() { pinMode(4,OUTPUT); // Reset MAX3421 digitalWrite(4,0); delay(5000); digitalWrite(4,1); // Pins for clk, miso, mosi, ss SPI1.begin (14, 32, 13, 15); SPI1.setHwCs(true); } void loop() { SPI1.beginTransaction(SPISettings(3000, MSBFIRST, SPI_MODE0)); SPI1.transfer16(0xA200); // Write 00 to R20 SPI1.endTransaction(); delay(1000); SPI1.beginTransaction(SPISettings(3000, MSBFIRST, SPI_MODE0)); SPI1.transfer16(0xA2ff); // Write 00 to R20 SPI1.endTransaction(); delay(1000); }
in „Frage zu SPI.beginTransaction“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Denmark_V2.ino
//Festlegung der Variaablen bzw. I/O auf dem Board //-----Antriebe--------- int AUF1 = 23; // Einlesekanal Schranke Auf (BOM1) int ZU1 = 22; // Einlesekanal Schranke ZU (BOM1) int AUF2 = 3; // Einlesekanal Schranke Auf (BOM2) int ZU2 = 2; // Einlesekanal Schranke ZU (BOM2) int AUF3 = 25; // Einlesekanal Schranke Auf (BOM3) int ZU3 = 24; // Einlesekanal Schranke ZU (BOM3) int AUF4 = 21; // Einlesekanal Schranke Auf (BOM4) int ZU4 = 20; // Einlesekanal Schranke ZU (BOM4) int AUF5 = 27; // Einlesekanal Schranke Auf (BOM5) int ZU5 = 26; // Einlesekanal Schranke ZU (BOM5) int AUF6 = 29; // Einlesekanal
in „Arduino Programmierung“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Denmark_V5.ino
int AUF1 = 23; // Einlesekanal Schranke Auf (BOM1) int ZU1 = 22; // Einlesekanal Schranke ZU (BOM1) int AUF2 = 3; // Einlesekanal Schranke Auf (BOM2) int ZU2 = 2; // Einlesekanal Schranke ZU (BOM2) int AUF3 = 25; // Einlesekanal Schranke Auf (BOM3) int ZU3 = 24; // Einlesekanal Schranke ZU (BOM3) int AUF4 = 21; // Einlesekanal Schranke Auf (BOM4) int ZU4 = 20; // Einlesekanal Schranke ZU (BOM4) int AUF5 = 27; // Einlesekanal Schranke Auf (BOM5) int ZU5 = 26; // Einlesekanal Schranke ZU (BOM5) int AUF6 = 29; // Einlesekanal Schranke Auf (BOM6) int ZU6 = 28; // Einlesekanal Schranke ZU (BOM6) int
in „Delay Arduino“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
SwissThermSim.ino
/* */ #define Sensor_OUT 4 void setup() { pinMode(Sensor_OUT, OUTPUT); pinMode(LED_BUILTIN, OUTPUT); Serial.begin(115200); } void loop() { // msg is 440ms total, rate is 1000ms // sync 9 ms low 5ms hi, 14ms total digitalWrite(Sensor_OUT, LOW); delay(9); digitalWrite(Sensor_OUT, HIGH); delay(5); digitalWrite(Sensor_OUT, LOW); //data 60*2ms + 60*4ms = 360ms for (int i=0;i<60;i++) { delay(1); digitalWrite(Sensor_OUT, HIGH); delay(1); digitalWrite(Sensor_OUT, LOW); delay(1); digitalWrite(Sensor_OUT, HIGH); delay(3); digitalWrite(Sensor_OUT, LOW); } // pause delay(1); digitalWrite(Sensor_OUT, HIGH); delay(
in „Kennt jemand diese WarmwasserWärmepumpe?“ · Haus & Smart Home ·
-
Datei
DTZ_Logger_OPEN.ino
/** * DTZ Logger * Version 3.8 * 18.02.2022 P. Rebesky * author Creator P.Rebesky * Copyright (©): 2020-2022 by Peter Rebesky * This code can use in private cases only. Every business or companies using of this codes or codes parts is required an approval of us (me) * Every private using can exchange some parts of code or modify some code-lines. This code is allowed change for private use only. * This software is basicly owned by Peter Rebesky and any comercial using is forbidden without approval of us (me). **/ #include <ESP8266WiFi.h> //ESP8266 Core WiFi Library #include <ESP8266WiFiMulti.h>
in „Digitale Stromzähler auslesen und in DB speichern“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
ASLGZ_Logger_OPEN.ino
/** * DTZ EEG Logger * Version 3.8 for AS1440 & Landis&Gyr * 18.02.2022 P. Rebesky * author Creator P.Rebesky * Copyright (©): 2020-2022 by Peter Rebesky * This code can use in private cases only. Every business or companies using of this codes or codes parts is required an approval of us (me) * Every private use can exchange some parts of code or modify some code-lines. This code can change for private use only. * This software is basicly owned by Peter Rebesky and any comercial use is forbidden without approval of us (me). **/ #include <ESP8266WiFi.h> //ESP8266 Core WiFi Library #include <ESP8266WiFiMulti.h
in „Digitale Stromzähler auslesen und in DB speichern“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Relaisboard_v1.ino
#include <Arduino.h> #define warten_nach_press 300 // Ausgang Pin #define Relais1 12 #define Relais2 11 #define Relais3 10 #define Relais4 9 #define Relais5 8 #define Relais6 7 #define Relais7 6 #define Relais8 5 #define Relais9 4 #define Relais10 3 #define UP 2 #define DOWN 13 // / Segment Anzeige PIN Belegung #define a A2 #define b A3 #define c A4 #define d A5 #define e A6 #define f A1 #define g A0 /* a -------- | | f | | b |__g___| | | e | | c |__d___| */ // Reihenfolge a,b,c,d,e,f,g uint8_t pins_fuer_zahl[12][7] = { {a,b,c,d,e,f,0}, // 0 {b,c,0,0,0,0,0}, // 1 {a,b,d,e,g,0,0}, // 2 {a,b,g,e
in „Relais Umschalter mit up & down Tasten und Display“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Test1_KB.ino
#include "Keyboard.h" const int buttonPin = 11; // input pin for pushbutton const int ledPin = 1; // the number of the LED pin int previousButtonState = HIGH; // for checking the state of a pushButton void setup() { // make the pushButton pin an input: pinMode(buttonPin, INPUT); // initialize the LED pin as an output: pinMode(ledPin, OUTPUT); // initialize control over the keyboard:218 Keyboard.begin(); } void loop() { // read the pushbutton: int buttonState = digitalRead(buttonPin); // if the button state has changed, if ((buttonState != previousButtonState) // and it's currently pressed: && (
in „Probleme mit Keyboard.h“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Programm_V1.ino
// -------------------- Parameter zur Liniarisierung ----------------- int a = 1; //Hier maximale Geschwindigkeit je kleiner umso schneller float b = 30000.0f; //Hier minimale Geschwindigkeit je größer umso langsamer int c = 1021; // ------------------------------------------------------------------- #include <math.h> //TIMER #include <TimerOne.h> void _timerOne(); volatile long int timerOne; //BUZZER #define BUZZER 2 //TASTER #define TASTER_START_PAUSE 3 #define TASTER_NULLPUNKT 4 #define TASTER_LINKS 5 #define TASTER_RECHTS 6 //MOTOR #define DIR 7 #define STEP 8 //ENABLE #define ENABLE 9 //POTI
in „Schrittmotor macht keine Drehzahl“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
RFID_Write_Ogris.ino
/* Write personal data of a MIFARE RFID card using a RFID-RC522 reader Uses MFRC522 - Library to use ARDUINO RFID MODULE KIT 13.56 MHZ WITH TAGS SPI W AND R BY COOQROBOT. ----------------------------------------------------------------------------------------- MFRC522 Arduino Arduino Arduino Arduino Arduino Reader/PCD Uno/101 Mega Nano v3 Leonardo/Micro Pro Micro Signal Pin Pin Pin Pin Pin Pin ----------------------------------------------------------------------------------------- RST/Reset RST 9 5 D9 RESET/ICSP-5 RST SPI SS SDA(SS) 10 53 D10 10 10 SPI MOSI MOSI 11 / ICSP-4 51 D11 ICSP-4 16 SPI
in „Arduino IDE Byte Array als string ausgeben“ · Softwareentwicklung ·
-
Datei
hochRunterZaehler.ino
/* simple gui to test the serial communication between an Arduino and the PC It has 3 buttons: - up counter - down counter - adc read setup: 1. programm your Arduino 2. addapt the serial port in your python script to the serial port used on your PC 3. run the python script PC: python with tkinter and pyserial MC: any Arduino 22.05.07 first version by mchris serial communication with python and Arduino: https://create.arduino.cc/projecthub/ansh2919/serial-communication-between-python-and-arduino-e7cce0 */ int Zaehler = 0; void setup() { Serial.begin(115200); } void loop() { while (!Serial.available
-
Datei
frequencyCounterScpi.ino
/* Frequency Generator with SCPI parser setup: 1. programm your Arduino 2. addapt the serial port in your python script to the serial port used on your PC 3. run the python script PC: python with tkinter and pyserial MC: any Arduino 22.05.06 first version by mchris 22.05.08 V0.2, SCPI parser lib included by mchris Use SCPI library from https://github.com/Vrekrer/Vrekrer_scpi_parser */ #include "Arduino.h" #include "Vrekrer_scpi_parser.h" SCPI_Parser my_instrument; #define FREQENCY_PIN 8 void setup() { //We change the `hash_magic_number` variable before registering the commands my_instrument.hash_magic_number
-
Datei
DTZ_Logger_OPEN.ino
/** * DTZ Logger * Version 3.91 * 09.05.2022 P. Rebesky * author Creator P.Rebesky * Copyright (©): 2020-2022 by Peter Rebesky * This code can use in private cases only. Every business or companies using of this codes or codes parts is required an approval of us (me) * Every private using can exchange some parts of code or modify some code-lines. This code is allowed change for private use only. * This software is basicly owned by Peter Rebesky and any comercial using is forbidden without approval of us (me). **/ #include <ESP8266WiFi.h> //ESP8266 Core WiFi Library #include <ESP8266WiFiMulti.h>
in „Digitale Stromzähler auslesen und in DB speichern“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Sperlings_VU_UNO.ino
// -------------------------------- // -- VU Meter - Scott's version -- // -------------------------------- #include <FastLED.h> #include <EEPROM.h> #include <JC_Button.h> # define LEFT_OUT_PIN 6 // Left channel data out pin to LEDs [6] # define RIGHT_OUT_PIN 5 // Right channel data out pin to LEDs [5] # define LEFT_IN_PIN A5 // Left aux in signal [A5] # define RIGHT_IN_PIN A4 // Right aux in signal [A4] # define BRIGHTNESS_PIN A2 // Brightness potentiometer in [A2] # define SENSITIVITY_PIN A1 // Sensitivity potentiometer in [A1] # define BTN_PIN 3 // Push button on this pin [3] # define DEBOUNCE_MS
in „Arduino Sketch mittels Kippschalter anders "loopen" lassen“ · Projekte & Code ·
-
Datei
Batterie_Kapazit_t.ino
int A0_wert; float Spannung_Solar; float Batterie_Kapazitaet; void setup() { Serial.begin(115200); } void loop() { A0_wert = analogRead(A0); Spannung_Solar = ((A0_wert / 1024.0) * 5) ; Batterie_Kapazitaet = map(Spannung_Solar , 4.2 , 3 , 100 , 0 ); Serial.print(" VA = "); Serial.println(Spannung_Solar); Serial.print(" % "); Serial.println(Batterie_Kapazitaet); delay(1000); }
in „Batterie Stand in % anzeigen“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Sleep_ProMini.ino
// **** INCLUDES ***** #include "LowPower.h" void setup() { DDRD &= B00000011; // set Arduino pins 2 to 7 as inputs, leaves 0 & 1 (RX & TX) as is DDRB = B00000000; // set pins 8 to 13 as inputs PORTD |= B11111100; // enable pullups on pins 2 to 7 PORTB |= B11111111; // enable pullups on pins 8 to 13 pinMode(13,OUTPUT); digitalWrite(13, LOW); } int delay13H = 300; int delay13L = 500; void loop() { // Enter power down state for 8 s with ADC and BOD module disabled LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF); digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level) delay(delay13H
in „ATMega328P low power funktioniert nicht“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
l2a.ino
/* Die Routine l2a() wandelt die Zahl 'zahl' in eine ASCII-Zeichenkette, die in s[12] abgelegt wird: Vorzeichen, max. 10 Ziffern, Abschluss -> 12 Byte. Zeitaufwendige Divisionen werden durch Subtraktionen ersetzt, was deutlich schneller ausgefuehrt wird. Bei Bedarf kann 'int32_t' durch 'int16_t' ersetzt werden; hierdurch wird der Code reduziert, die Ausfuerung beschleunig aber der Wertebereich auf -32768 bis 32767 begrenzt. Nach Anpassung kann diese Routine auch dazu verwendet werden, die Mantisse von float Zahlen sehr schnell zu wandeln. Michael Nowak, 2004-11-09, www.mino-elektronik.de 2017-01-29
-
Datei
Monitorhalterung2_2.ino
const int K1_A_0 = 2; //Wand 0=aus, 1=ein DO const int K2_B_0 = 3; //Scharnier 0=aus, 1=ein DO const int K3_C_0 = 4; //Monitor 0=aus, 1=ein DO const int K4_A_1 = 5; //Wand 0=rechts, 1=links DO const int K5_B_1 = 6; //Scharnier 0=rechts, 1=links DO const int K6_C_1 = 7; //Monitor 0=rechts, 1=links DO const int Achse_A_0 = 9; //Wand 1=eingefahren DI const int Achse_A_1 = 8; //Wand 1=ausgefahren DI const int Achse_B_0 = 11; //Scharnier 1=eingefahren DI const int Achse_B_1 = 10; //Scharnier 1=ausgefahren DI const int Achse_C_0 = 12; //Monitor 1=eingefahren DI const int Achse_C_1 = 13; //Monitor 1=
in „Falsche Analogwerte im Seriellen Monitor“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
SimpleSoftSerial.ino
// print with manual made software serial the // by the user button selected blinking led // STM32F4 Discovery #define SOFTSERIAL_BAUDRATE 115200 #define SOFTSERIALPIN_TX PC1 #define USERBUTTON PA0 #define GREENLED PD12 #define ORANGELED PD13 #define GREDLED PD14 #define BLUELED PD15 #define REDLEDOTGOVERCURRENT PD5 #define NUMLEDS 5 const uint8_t Led[] = {GREENLED, ORANGELED, GREDLED, BLUELED, REDLEDOTGOVERCURRENT}; #define BITDELAY 1000000UL / SOFTSERIAL_BAUDRATE #define ZEROLEVEL LOW #define ONELEVEL HIGH void writeByte(uint8_t b) { digitalWrite(SOFTSERIALPIN_TX,LOW); // start bit delayMicroseconds(BITDELAY
in „STM32F4 Discovery Arduino“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
LedVuMeter.ino
// LED VU-Meter // turns on the LEDs depending on the sound level detected from the microphon // STM32F4 Discovery #define USERBUTTON PA0 #define GREENLED PD12 #define ORANGELED PD13 #define GREDLED PD14 #define BLUELED PD15 #define REDLEDOTGOVERCURRENT PD5 #define MICROPHON_CLK_INPUT PB10 #define MICROPHON_PDMDATA_OUTPUT PC3 #define NUMLEDS 5 const uint8_t Led[] = {GREENLED, ORANGELED, GREDLED, BLUELED, REDLEDOTGOVERCURRENT}; void setup() { for (int n = 0; n < NUMLEDS; n++) pinMode(Led[n], OUTPUT); pinMode(MICROPHON_CLK_INPUT, OUTPUT); } void setLed(uint8_t n, uint8_t state) { if(n==4)digitalWrite(Led[n], !state);
in „STM32F4 Discovery Arduino“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
analogReadSerial.ino
// read analog pin and print it via software serial // STM32F4 Discovery #define ANALOGPIN PA1 #define SOFTSERIAL_BAUDRATE 115200 #define SOFTSERIALPIN_TX PC1 #define USERBUTTON PA0 #define GREENLED PD12 #define ORANGELED PD13 #define GREDLED PD14 #define BLUELED PD15 #define REDLEDOTGOVERCURRENT PD5 #define NUMLEDS 5 const uint8_t Led[] = {GREENLED, ORANGELED, GREDLED, BLUELED, REDLEDOTGOVERCURRENT}; #define BITDELAY 1000000UL / SOFTSERIAL_BAUDRATE #define ZEROLEVEL LOW #define ONELEVEL HIGH void writeByte(uint8_t b) { digitalWrite(SOFTSERIALPIN_TX,LOW); // start bit delayMicroseconds(BITDELAY
in „STM32F4 Discovery Arduino“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
LCDemo7Segment.ino
//We always have to include the library #include "LedControl.h" /* Now we need a LedControl to work with. ***** These pin numbers will probably not work with your hardware ***** pin 12 is connected to the DataIn pin 11 is connected to the CLK pin 10 is connected to LOAD We have only a single MAX72XX. */ LedControl lc=LedControl(12,11,10,1); /* we always wait a bit between updates of the display */ unsigned long delaytime=250; void setup() { /* The MAX72XX is in power-saving mode on startup, we have to do a wakeup call */ lc.shutdown(0,false); /* Set the brightness to a medium values */ lc.setIntensity
in „LedControl lässt sich nicht mit WeMos D1 mini kompilieren“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
LiedKlingel2017.ino
const byte BUTTONPIN=2; const byte SPEAKERPIN=9; const byte MELODIES=100; const uint16_t ton[]PROGMEM= { 262, // c tone frequenciesin Hz 277, //cis 294, //d 311, //dis 330, //e 349, //f 370, //fis 392, //g 416, //gis 440, //a 466, //b 495, //h 524, //c' 554, //cis' 588, //d' 622, //dis' 660, //e' 698, //f' 740, //fis' 784, //g' 831, //gis' 880, //a' 929, //b' 992, //h' 1050, //c'' 1106, //cis'' 1179, //d'' 1244, //dis'' 1316, //e' 1397, //f'' 1562, //g'' auf position von fis'' verschoben }; const uint8_t duration[] PROGMEM= { 2, //1/32 Zeit in 20 ms Schritten 3, //1/32. 4, //1/16 6, //1/16. 8,
in „Klingel mit 100 Melodien - last minute Weihnachtsgeschenk“ · Projekte & Code ·
-
Datei
WifiMonitor.ino.txt
/** * WLAN Monitor mit ESP-01 Modul. * * Kontrolliert die Erreichbarkeit eines Internet Servers * und zeigt den Status mit einer bunten LED an. * * Grün = Alles Ok * Blau = Verbindung ist langsam * Rot = Verbindung ist ausgefallen * Aus = Keine Verbindung zum AP * * Ein leichtes Flackern der LED bestätigt, dass das Modul arbeitet. * * Die Schaltung ist ganz einfach: * Das ESP-01 Modul wird mit einem Steckernetzteil und LF33CV versorgt. * Die RGB-LED ist so angeschlossen: * * LED 3x 220 Ohm * VCC o---+---|>|---[===]-------o GPIO2 blau (=TxD) * | * +---|>|---[===]-------o GPIO1 rot * | * +---|>|---[==
in „Quick&dirty - schnelle Problemlösungen selbst gebaut“ · Projekte & Code ·
-
Datei
monoflop_retriggerbar_002.ino
int Schalter; int InputPin = 2; int rot = 12; int gruen = 10; int ledPin = 13; void setup() { Serial.begin(9600); pinMode(InputPin,INPUT_PULLUP); pinMode(rot,OUTPUT); pinMode(gruen,OUTPUT); pinMode(ledPin,OUTPUT); } void loop() { digitalWrite(ledPin,LOW); Schalter = digitalRead(InputPin); Serial.println(Schalter,DEC); if (Schalter == 1) { digitalWrite(rot,HIGH); digitalWrite(gruen,LOW); delay(3000); } if (Schalter == 0) { digitalWrite(rot,LOW); digitalWrite(gruen,HIGH); } }
in „Arduino UNO retriggerbares Monoflop if while“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
monoflop_retriggerbar_003.ino
int Schalter; int InputPin = 2; int rot = 12; int gruen = 10; int ledPin = 13; void setup() { Serial.begin(9600); pinMode(InputPin,INPUT_PULLUP); pinMode(rot,OUTPUT); pinMode(gruen,OUTPUT); pinMode(ledPin,OUTPUT); } void loop() { digitalWrite(ledPin,LOW); Schalter = digitalRead(InputPin); Serial.println(Schalter,DEC); while (Schalter == 1) { digitalWrite(rot,HIGH); digitalWrite(gruen,LOW); delay(3000); digitalRead(InputPin); } if (Schalter == 0) { digitalWrite(rot,LOW); digitalWrite(gruen,HIGH); } }
in „Arduino UNO retriggerbares Monoflop if while“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
monoflop_retriggerbar_004.ino
int Schalter; int InputPin = 2; int rot = 12; int gruen = 10; int ledPin = 13; void setup() { Serial.begin(9600); pinMode(InputPin,INPUT_PULLUP); pinMode(rot,OUTPUT); pinMode(gruen,OUTPUT); pinMode(ledPin,OUTPUT); } void loop() { digitalWrite(ledPin,LOW); Schalter = digitalRead(InputPin); Serial.println(Schalter,DEC); while (Schalter == 1) { digitalRead(Schalter); digitalWrite(rot,HIGH); digitalWrite(gruen,LOW); digitalRead(Schalter); delay(3000); digitalRead(Schalter); } if (Schalter == 0) { digitalWrite(rot,LOW); digitalWrite(gruen,HIGH); } }
in „Arduino UNO retriggerbares Monoflop if while“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
monoflop_retriggerbar_005.ino
int Schalter; int InputPin = 2; int rot = 12; int gruen = 10; int ledPin = 13; void setup() { Serial.begin(9600); pinMode(InputPin,INPUT_PULLUP); pinMode(rot,OUTPUT); pinMode(gruen,OUTPUT); pinMode(ledPin,OUTPUT); } void loop() { digitalWrite(ledPin,LOW); Schalter = digitalRead(InputPin); Serial.println(Schalter,DEC); if (Schalter == HIGH) { digitalWrite(rot,HIGH); digitalWrite(gruen,LOW); delay(3000); } if (Schalter == LOW) { digitalWrite(rot,LOW); digitalWrite(gruen,HIGH); } }
in „Arduino UNO retriggerbares Monoflop if while“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
monoflop_retriggerbar_005.ino
int Schalter; int InputPin = 2; int rot = 12; int gruen = 10; int ledPin = 13; void setup() { Serial.begin(9600); pinMode(InputPin,INPUT_PULLUP); pinMode(rot,OUTPUT); pinMode(gruen,OUTPUT); pinMode(ledPin,OUTPUT); } void loop() { digitalWrite(ledPin,LOW); Schalter = digitalRead(InputPin); Serial.println(Schalter,DEC); while (Schalter == HIGH) { digitalWrite(Schalter,HIGH); digitalWrite(rot,HIGH); digitalWrite(gruen,LOW); delay(3000); Schalter --; } if (Schalter == LOW) { digitalWrite(rot,LOW); digitalWrite(gruen,HIGH); } }
in „Arduino UNO retriggerbares Monoflop if while“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
monoflop_retriggerbar_008.ino
int Input = 2; int rot = 12; int gruen = 10; int ledPin = 13; void setup() { pinMode(Input,INPUT_PULLUP); pinMode(rot,OUTPUT); pinMode(gruen,OUTPUT); pinMode(ledPin,OUTPUT); } void loop() { while (digitalRead(Input) == HIGH) { digitalWrite(rot,HIGH); digitalWrite(gruen,LOW); delay(3000); } if (digitalRead(Input) == LOW) { digitalWrite(rot,LOW); digitalWrite(gruen,HIGH); } }
in „Arduino UNO retriggerbares Monoflop if while“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
boolean_and_004.ino
int a = 2; int b = 3; int rot = 12; int gruen = 10; int ledPin = 13; int c; void setup() { pinMode(a,INPUT_PULLUP); pinMode(b,INPUT_PULLUP); pinMode(rot,OUTPUT); pinMode(gruen,OUTPUT); pinMode(ledPin,OUTPUT); } void loop() { digitalWrite(ledPin,LOW); c = digitalRead(a) && digitalRead(b); if (c == HIGH) { digitalWrite(gruen,LOW); digitalWrite(rot,HIGH); } else { digitalWrite(gruen,HIGH); digitalWrite(rot,LOW); } }
in „Arduino UNO retriggerbares Monoflop if while“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Ventilator_mit_Regelung_und_Display.ino
#include <LiquidCrystal.h> LiquidCrystal lcd(12,13,8,4,7,2); const int tempsenso=A0; int temp; const int motor=6; int endwert; float Wert1; const int LED=3; const int LED2=5; const int LED1=9; float TempDisplay; void setup() { pinMode(tempsenso,INPUT); //misst temperatur (bekommt Signal) Serial.begin(9600); pinMode(motor, OUTPUT); //dreht sich (gibt Signal) pinMode(LED, OUTPUT); //LED aus pinMode(LED1, OUTPUT); // leuchtet blau (gibt Signal) pinMode(LED2, OUTPUT); //LED aus lcd.begin(16,2); //16,2 ist die Bezeichnung der Zeilen und Spalten (16=Spalten, 2=Zeilen) lcd.setCursor(0,0); //bestimmt die
in „Arduino, LCD und PWM“ · Mikrocontroller und Digitale Elektronik ·