-
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 ·
-
Datei
hd44780Test.ino
#include <LiquidCrystal.h> //LiquidCrystal lcd(RS, E, D4, D5, D6, D7); LiquidCrystal lcd(11, 12, 5, 4, 3, 2); void setup() { // LCD initialisieren lcd.begin(16, 2); } void loop() { lcd.setCursor(0,0); lcd.print("Let's"); lcd.setCursor(0,1); lcd.print("get Dangerous!!!"); delay(1000); }
in „Arduino und Hd44780 - keine Kommunikation“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Keystone_Arduino_Samples.ino
/* Module Test Program Control Module by I2C of Arduino Rainer Goldelius */ #include <Wire.h> #include <LiquidCrystal_I2C.h> #include <EEPROM.h> #include <Servo.h> // // const unsigned int Max_Data_Length = 0x102; // // Defines // #define Volume_Key 8 #define Volume_UP 2 #define Volume_DOWN 4 #define Tune_Key 6 #define Tune_UP 5 #define Tune_DOWN 7 #define Module_I2C 0x44 // volatile char Tune_Char = ' '; volatile char Volume_Char = ' '; // typedef union My_4_Bytes { unsigned long Module_4_Data; byte Data_Bytes[4]; }; // // EEProm addresses // const byte Volume_Address = 0; const byte Play_Mode_Address
in „DAB+ Modul KeyStone 8650“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Tttiny_test_3.ino
#include "DigiKeyboard.h" #include <math.h> const int Var1 = 4; //Anzahl der Messdurchläufe const int Fenstergroesse = 4; int VoltArray[Var1]; //Abspeichern der Messwerte in Array int i = 0; float Volt = 0; float Messwert=0; int Pin1 = 7; int Pin2 =8; int Pin3 =9; int Pin4 =10; int Pin5 = 0; int Messeingang = Pin5; bool erlaubeschalten= false; //-------------------------------------------------------------------------------------------------------------------- //Hier wird auf 5 V gerechent, und auch zur MW-Bildung verwendet const int Var2 = 7; //Anzahl der Mittelwerte --Ungerade Zahl wegen Gleichheit
in „Attiny 167(Digispark Pro) USB Verbindung unterbricht nach Programmupload“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
TFT_Test_neu.ino
//Arduino LCD TFT 2,4" Touch Display ILI9341 #include "Adafruit_GFX_AS.h" #include "Adafruit_ILI9341_8bit_AS.h" #include "TouchScreen.h" #define LCD_CS A3 #define LCD_CD A2 #define LCD_WR A1 #define LCD_RD A0 #define LCD_RESET A4 #define YP A1 #define XM A2 #define YM 7 #define XP 6 TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300); #define TS_MINX 150 #define TS_MINY 120 #define TS_MAXX 920 #define TS_MAXY 940 #define BLACK 0x0000 #define BLUE 0x001F #define RED 0xF800 #define GREEN 0x07E0 #define CYAN 0x07FF #define MAGENTA 0xF81F #define YELLOW 0xFFE0 #define WHITE 0xFFFF Adafruit_ILI9341_8bit_AS
in „LCD mit ILI9325 funktioniert nicht!“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Monoflop_MaWin.ino
/* https://www.mikrocontroller.net/topic/322681?goto=new#4523487 */ void setup() { DDRD = 0xFF; } uint8_t zustand[5]; void loop() { uint8_t i, n; for (i = 1; i < 5; i++) zustand[i] = zustand[i - 1]; zustand[0] = n = PORTB; for (i = 1; i < 4; i++) n |= zustand[i]; PORTD = ~zustand[4] & n; delay(100); // Millisekunden }
in „Arduino Uno und analoge Märklin-Weichen“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Drucker_Emu-hex.ino
/* D0...D3 auf PB0..PB3 (D8...D11) PORT_LOW D4...D7 auf PD4...PD7 (D4...D7) PORT_HIGH Strobe PD2 (D2) Ack PD3 (D3) Busy PB4 (D12) */ #define STROBE PD2 // Arduino-Pin 2 #define ACK PD3 // Arduino-Pin 3 #define BUSY PB4 // Arduino-Pin 12 #define ACK_PORT PORTD #define BUSY_PORT PORTB #define STROBE_PIN PIND void setup() { PORTB = PORTB | 0b00010000; // Busy auf H, erstmal Gerät nicht bereit setzen PORTD = PORTD | 0b00001000; // Busy auf H, erstmal Gerät nicht bereit setzen DDRB = (DDRB & 0b11100000) | 0b00010000; // PB0...PB3 Eingang Daten 0...3, PB4 Ausgang Busy DDRD = (DDRD & 0b00000011) | 0b00001000
in „Druckausgabe eines Wetter-Fax-Decoders auf Raspi umleiten“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
BruteForcePreview.ino
/* BurteForcePreview */ int Z1; int Z2; int Z3; int Z4; int NZ1; int NZ2; int NZ3; int NZ4; int irda[] = {1234, 5678, 4321, 8765, 1111, 2222, 3333, 7777, 8888, 9999}; void setup() { Serial.begin(9600); Serial.print("GO"); } void loop() { for (Z1 = 0; Z1 < 10; Z1 = Z1 ++) { if (Z1 == 9) { for (Z2 = 0; Z2 < 10; Z2 = Z2 ++) { if (Z2 == 9) { for (Z3 = 0; Z3 < 10; Z3 = Z3 ++) { if (Z3 == 9) { for (Z4 = 0; Z4 < 10; Z4 = Z4 ++) { } } } } } } } Serial.println(irda[Z1]); Serial.println(irda[Z2]); Serial.println(irda[Z3]); Serial.println(irda[Z4]); }
in „Brute Force mit dem Arduino“ · Mikrocontroller und Digitale Elektronik ·