-
Datei
Monoflop.ino
/* Monoflop 2016-03-27 This example code is in the public domain */ #define SteuerPin 2 #define AusgabePin 13 #define DAUER 50 #define INTERVAL_ms 10 unsigned long time_ms, nexttime; void setup() { //start serial connection Serial.begin(9600); while (!Serial) { ; // wait for serial port to connect. Needed for native USB port only } delay(3000); Serial.println("Weichensteuerung"); //configure SteuerPin as an input and enable the internal pull-up resistor pinMode(SteuerPin, INPUT_PULLUP); pinMode(AusgabePin, OUTPUT); digitalWrite(AusgabePin, LOW); } void loop() { static int Eingang1_alt = HIGH;
in „Arduino Uno und analoge Märklin-Weichen“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Weichen.ino
const int Taste1 = 2; // the number of the pushbutton pin const int Taste2 = 3; // the number of the pushbutton pin const int Taste3 = 4; // the number of the pushbutton pin const int Taste4 = 5; // the number of the pushbutton pin const int Weiche1 = 8; // the number of the LED pin const int Weiche2 = 9; // the number of the LED pin const int Weiche3 = 10; // the number of the LED pin const int Weiche4 = 11; // the number of the LED pin int Taste1st = 1; int Taste2st = 1; int Taste3st = 1; int Taste4st = 1; int Taste1stand = 1; int Taste2stand = 1; int Taste3stand = 1; int Taste4stand = 1; void
in „Arduino Uno und analoge Märklin-Weichen“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Wetterstation.ino
// Example testing sketch for various DHT humidity/temperature sensors // Written by ladyada, public domain #include "DHT.h" #define DHTPIN 3 // PIN # for DHT22 Temperature Sensor #define TXPIN 1 // PIN # for 433Mhz Transmitter #define LEDPIN 0 // PIN # for LED Indicator #define DHTTYPE DHT22 // DHT 21 (AM2301) DHT dht(DHTPIN, DHTTYPE); //char msg1[]={0x0,0xa,0x0,0xf,0x0,0x7,0x0,0x1,0x7,0x0,0x8}; //char msg2[]={0x0,0xa,0x0,0xf,0x1,0x5,0x8,0x6,0x5,0x8,0xa}; unsigned long msg_timer = 10000; // Transmits a signal every 1 minute unsigned long msg_gap = 32; //gap between packets char buf[11]; //message
in „code für TX 3-TH Funksender“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Brute.ino
/* BurteForcePreview */ int Z1; int Z2; int Z3; int Z4; int NZ1; int NZ2; int NZ3; int NZ4; int irda[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; void setup() { Serial.begin(9600); Serial.print("GO"); } void loop() { for (Z1 = 0; Z1 < 10; Z1 = Z1 ++) { for (Z2 = 0; Z2 < 10; Z2 = Z2 ++) { for (Z3 = 0; Z3 < 10; Z3 = Z3 ++) { for (Z4 = 0; Z4 < 10; Z4 = Z4 ++) { Serial.print(irda[Z1]); Serial.print(irda[Z2]); Serial.print(irda[Z3]); Serial.print(irda[Z4]); Serial.println(); } } } } }
in „Brute Force mit dem Arduino“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
leistungmessung.ino
const float pi = 3.14159; int pinSpannungL1 = A0; int pinSpannungL2 = A1; int pinSpannungL3 = A2; int pinStromL1 = A3; int pinStromL2 = A4; int pinStromL3 = A5; int pinLeistungL1pos = 10; int pinLeistungL1neg = 11; bool spannungsNulldurchgang = false; bool spannungL1Null = false; int uL1max = 0; unsigned long uL1maxZeitstempel = 0; int iL1max = 0; unsigned long iL1maxZeitstempel = 0; unsigned long periodenZeit1 = 0; unsigned long periodenZeit2 = 0; unsigned long periodendauer = 0; bool periodenZeit21 = true; float leistungL1 = 0; void setup() { Serial.begin(115200); pinMode(pinLeistungL1pos, OUTPUT
in „Attiny26 Zeitstempel im Programm - (Leistungsmessung)“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Prototype.ino
/* The ArduHomeSystem sorts the ArduinoStatios (also called Slaves) by an ID, to communicate with them: (e.g. ID=1234) The first digit: (room) - 1 = The room, where the Base (Master) is - 2 = The room form the SmartHomes owner - 3 = Garden - 4 = ... The second digit: (class) - 1 = Master - 2 = 2nd Master - 3 = Slave.firstClass - 4 = Slave.secondClass - 5 = ... The third digit: (microcontroller) - 1 = mcOne - 2 = mcTwo - 3 = mcThree The fourth digit: (values) - 1 = sensorValue (e.g.) - 2 = countofX (e.g.) */ //Librarys //RCSwitch #include <RCSwitch.h> RCSwitch mySwitch = RCSwitch(); //Definitions //
in „Protokoll für die Kommunication in einem Selfmade Smarthome“ · Projekte & Code ·
-
Datei
dogl.ino
#include <Arduino.h> #include <SPI.h> #include <dog_7565R.h> #include <font_16x32nums.h> #include <font_6x8.h> #include <font_8x16.h> #include <font_8x8.h> #include <logo_BLH.h> dog_7565R DOG; //the following port definitions are used by our demo board "EA PCBARDDOG7565" int led_green = 3; int led_red = 5; int led_blue = 6; void init_backlight(); void rgb_backlight(byte red, byte green, byte blue); void sample_screen(void); //initialize the backlight and the display void setup() { init_backlight(); //use RGB backlight in this sample code. Please change it to your configuration DOG.initialize(10,
in „DOGL-128S-6 - Kein schwarzer Hintergrund“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
wetter.ino
#include <ESP8266WiFi.h> #include <stdlib.h> #include <DHTesp.h> DHTesp dht; WiFiClient client; // wenn aktiv: Meldungen per Serial // #define SERIAL // wenn aktiv: deep sleep nutzen (Hardwaremodifikation notwendig) #define DEEP // Achtung fuer statische IP #define STATIC_IP #ifdef STATIC_IP #define IPSET_STATIC { 192, 168, 101, 70 } #define IPSET_GATEWAY { 192, 168, 101, 1 } #define IPSET_SUBNET { 255, 255, 255, 0 } #define IPSET_DNS { 192, 168, 101, 2 } IPAddress ip_static = IPSET_STATIC; IPAddress ip_gateway = IPSET_GATEWAY; IPAddress ip_subnet = IPSET_SUBNET; IPAddress ip_dns = IPSET_DNS;
in „ESP-01 funktioniert in Sleep-Mode nur nach 2xReset“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
code.ino
#include <stdint.h> #include <stdbool.h> #include <stdio.h> #include "freertos/xtensa_api.h" #include "freertos/FreeRTOSConfig.h" #include "freertos/FreeRTOS.h" #include "freertos/queue.h" #include "freertos/task.h" #include "esp_log.h" #include "esp_bt.h" #include "esp_bt_main.h" #include "esp_system.h" #include "esp_bt_device.h" #include "esp_gap_bt_api.h" #include "esp_a2dp_api.h" #include "esp_avrc_api.h" #define BT_APP_CORE_TAG "BT_APP_CORE" #define BT_APP_SIG_WORK_DISPATCH (0x01) /** * @brief handler for the dispatched work */ typedef void (* bt_app_cb_t) (uint16_t event, void *param); /* message
in „Esp32 Bluetooth Audio“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
crc.ino
const PROGMEM uint8_t crc8_table[] = { 0, 49, 98, 83, 196, 245, 166, 151, 185, 136, 219, 234, 125, 76, 31, 46, 67, 114, 33, 16, 135, 182, 229, 212, 250, 203, 152, 169, 62, 15, 92, 109, 134, 183, 228, 213, 66, 115, 32, 17, 63, 14, 93, 108, 251, 202, 153, 168, 197, 244, 167, 150, 1, 48, 99, 82, 124, 77, 30, 47, 184, 137, 218, 235, 61, 12, 95, 110, 249, 200, 155, 170, 132, 181, 230, 215, 64, 113, 34, 19, 126, 79, 28, 45, 186, 139, 216, 233, 199, 246, 165, 148, 3, 50, 97, 80, 187, 138, 217, 232, 127, 78, 29, 44, 2, 51, 96, 81, 198, 247, 164, 149, 248, 201, 154, 171, 60, 13, 94, 111, 65, 112, 35, 18
in „Automower G3 mit USB Diagnoseport fernsteuern?“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Wallclock.ino
#include <Wire.h> //Libraries to communicate with RTC #include "RTClib.h" RTC_DS1307 rtc; //create rtc object boolean state = false; boolean state1 = false; int setH; //variable to store hours when setting int setM; //variable to store minutes when setting int setD = 1; //variable for day int setMo = 1; //variable for month unsigned long t1; //used for millis() unsigned long t2; //used for millis(); int segs[] = {2, 3, 4, 5, 6, 7, 8, 9};//abcdefg. segments int digits[] = {10, 11, 12, 13}; //number of digits String num[] = {"11111100", //0 "01100000", //1 "11011010", //2 "11110010", //3 "01100110
in „Große Uhr Flackert Arduino uno“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
watchdog.ino
#include "globvars.h" /* Verhindert für 1 Minute weitere Alarme, wird durch Watchdog ISR wieder ent-blockiert */ void DisableAlarmFor1Minute() { flags.AlarmGo = false; flags.RadarAlarm = false; alarm_counter = 0; } ISR(WDT_vect) { // ReEnable the watchdog interrupt, as this gets reset when entering this ISR and // automatically enables the WDE signal that resets the MCU the next time the // timer overflows WDTCSR |= (1<<WDIE); flags.WDT_Wakeup = true; /* Zaehlt in 8s Schritten hoch, benutzung fuer Sleep Mode, wird durch ISR Alarm zurueck gesetzt 1 Minute = 8 2 Minuten = 15 5 Minuten = 37 */ if
in „Arduino Atmega328P : Wakeup durch INT0 Interrupt bei Power Down“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
sms.ino
#include "globvars.h" /* ------------------------------------------------------ SMS Funktionen Das Problem besteht darin, dass der Empfang einer sms Störungen des Radars verursacht, die einen Fehlalarm auslösen. Im Normalbetrieb empfängt das Gerät aber keine sms. Daher werden Alarme soweit verzögert, bis sicher ist dass keine eingehende sms die Ursache ist. Kommt nach einem Alarm binnen 10s eine sms, die erkannt wird, so wird der Alarm verworfen. ---------------------------------------------------- */ /* Auskommentieren = Es wird keine echte SMS verschickt */ /* ===============================
in „Arduino 328P Resettet sich bei Programmstelle“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
dcf.ino
/* https://www.reichelt.de/dcf-77-empfaengermodul-dcf77-modul-p57772.html?r=1 https://www.reichelt.de/arduino-mini-ver-5-atmega328-arduino-mini-p153046.html?&trstct=pol_5 https://www.amazon.de/Adapter-FT232RL-Arduino-Christians-Technikshop/dp/B0178HVEH0 https://www.issb.de/mw/index.php/Test_elektronischer_Funkuhren-Module_(DCF77)_am_Mikroconcroller#DCF-Modul_von_Reichelt https://playground.arduino.cc/Code/DCF77 https://github.com/udoklein/dcf77 https://www.voelkner.de/products/945544/Barthelme-LEDlight-rigid-15-10f-50450515-LED-Streifen-mit-Loetanschluss-24-V-DC-45cm-Tageslicht-Weiss.html?frm=ffs__50450515 */ #include
in „AEG Adtranz Fallblattanzeiger“ · Analoge Elektronik und Schaltungstechnik ·
-
Datei
oszillation.ino
double osc = 600, avr_osc; double avr_osc_arr[99]; int i; void setup() { Serial.begin (9600); } void loop() { for (i = 98; i > 0; i--) { avr_osc_arr[i] = avr_osc_arr[i - 1]; } avr_osc_arr[0] = osc; avr_osc = avr_osc_arr[0] * 0.010101010101 + avr_osc_arr[1] * 0.010101010101 + avr_osc_arr[2] * 0.010101010101 + avr_osc_arr[3] * 0.010101010101 + avr_osc_arr[4] * 0.010101010101 + avr_osc_arr[5] * 0.010101010101 + avr_osc_arr[6] * 0.010101010101 + avr_osc_arr[7] * 0.010101010101 + avr_osc_arr[8] * 0.010101010101 + avr_osc_arr[9] * 0.010101010101 + avr_osc_arr[10] * 0.010101010101 + avr_osc_arr[11] * 0.010101010101
in „Numerischer Sinusoszillator, Zufallsentdeckung“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
wetter.ino
#include "main.h" #include <ArduinoJson.h> #include <ESP8266WiFi.h> #include <pgmspace.h> #include <stdio.h> #include <String.h> #include <stdint.h> const String HFc = "2"; // Forecast = (Hfc-1) * 3h const int HFcN = 2; // Muss identisch sein mit dem String /* String Literals fuer Openweather */ const String nameOfCity = "YourCity,DE"; // Stadt und Landescode const String apiKey = "YourAPIKey"; // API Key des Hosts WiFiClientSecure client; // Wifi Client Object int status = WL_IDLE_STATUS; /* Forecast */ int WeatherID; /* Die ID der Vorhersage */ uint32_t FC_Unixtime; // Die Uhrzeit der Vorherssage
-
Datei
tools.ino
void SetWeatherLeds() { static int schalter = false; if (!WeatherID) return; /* Alles abschalten */ digitalWrite(LED_ROT,0); digitalWrite(LED_GRN,0); digitalWrite(LED_BLAU,0); digitalWrite(LED_GLB,0); /* Klar bis heiter ? */ if ((WeatherID == 800 ) || (WeatherID == 801)) { digitalWrite(LED_GRN,1); return; } /* Mässig bewölkt ? */ if (WeatherID == 802) { digitalWrite(LED_GRN,1); digitalWrite(LED_GLB,1); return; } /* Stark bewölkt ? */ if ((WeatherID == 803 ) || (WeatherID == 804)) { digitalWrite(LED_GLB,1); return; } /* Nebel? */ if (WeatherID == 741) { digitalWrite(LED_GLB,1); digitalWrite(LED_ROT,
-
Datei
Test.ino
#define SoftVersion "0.02" // General #include <EEPROM.h> // EEPROM functions #include "SPI.h" // SPI interface #include "Adafruit_GFX.h" // Display functions #include "Adafruit_ILI9341.h" // Display specific functions and constants #include <Fonts/FreeMonoBoldOblique12pt7b.h> // Used font // Bluetooth #include <BLEDevice.h> #include <BLEServer.h> #include <BLE2902.h> #include <functional> // ESP specific functions and handlers #include <queue> // Pointers and structs // C++ functionalities #include <string> #include <sstream> // ESP specific libraries #include "esp_system.h" #include "soc/rtc.h"
in „ESP32 Interrupts“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Test.ino
#include <SoftwareSerial.h> //#include <Wire.h> SoftwareSerial altSerial(8, 9); // RX, TX float voltage5V0 = 0; uint16_t voltageRaw = 0; float voltageFB = 0; uint16_t tempRaw = 0; float temp6 = 0; float temp5 = 0; float temp4 = 0; float tempExt = 0; void setup() { // GPIO Setup pinMode(2, OUTPUT); // set pin D2=PD2 as Output pinMode(A7, INPUT); pinMode(A6, INPUT); pinMode(A0, INPUT); pinMode(A1, INPUT); pinMode(A2, INPUT); altSerial.begin(19200); //Wire.begin(); // join i2c bus (address optional for master) //Wire.setClock(400000); } void loop() { while(altSerial.available()){ altSerial.println
in „Atmega 328P wird nicht (mehr) erkannt“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
spitftbitmap.ino
#include <SPI.h> //#include "test.h" #include <Time.h> #include <Adafruit_GFX.h> // Core graphics library #include <Adafruit_ST7735.h> // Hardware-specific library for ST7735 // TFT display and SD card will share the hardware SPI interface. // Hardware SPI pins are specific to the Arduino board type and // cannot be remapped to alternate pins. For Arduino Uno, // Duemilanove, etc., pin 11 = MOSI, pin 12 = MISO, pin 13 = SCK. #define TFT_CS 7 // Chip select line for TFT display #define TFT_RST 6 // Reset line for TFT (or see below...) #define TFT_DC 5 // Data/command line for TFT static const uint8
in „Arduino Custom Firmware für Fitness Armband mit NRF52“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
vfd.ino
/* vacuum fluorescent display driver for Rockwell 10937/10957 controller */ // IO pin assignent Arduino style #define DATA 10 #define SCLK 11 #define POR 12 #define DEBUG_TOGGLE digitalWrite(13, !digitalRead(13)); // toggle onboard LED // the defines must be manually adapted to every Adruino type! // they must match the pinout defined above! // this way IO access is much faster #define SCLK_HIGH PORTB |= (1<<PB7); #define SCLK_LOW PORTB &= ~(1<<PB7); #define DATA_HIGH PORTB |= (1<<PB6); #define DATA_LOW PORTB &= ~(1<<PB6); char my_text[]="Hello World! This is a cool scroller on a VFD! Njoy!!!
in „Suche jemanden mit Oszilloskop zum Optimieren von Signalleitungen“ · Markt ·
-
Datei
tictest.ino
void setup() { // put your setup code here, to run once: Serial.begin(115200); pinMode(2, INPUT); digitalWrite(2, LOW); pinMode(3, OUTPUT); digitalWrite(3, LOW); pinMode(4, OUTPUT); digitalWrite(4, LOW); attachInterrupt(digitalPinToInterrupt(2),pickup,RISING); } void loop() { // put your main code here, to run repeatedly: Serial.println("Starting charging..."); digitalWrite(4, HIGH); delay(2000); Serial.println("Stopping chargin..."); digitalWrite(4, LOW); delay(100); Serial.println("Discharging..."); digitalWrite(3, HIGH); delay(200); digitalWrite(3, LOW); Serial.println("Done!"); delay(3000); }
in „Kondensator mit Optokoppler auf 400V laden“ · Analoge Elektronik und Schaltungstechnik ·
-
Datei
serialevent.ino
#include <avr/pgmspace.h> #include <Wire.h> #include <SPI.h> #include <SD.h> #include <Streaming.h> #include <EEPROM.h> #include "RTClib.h" #include <Time.h> const uint8_t days_in_month [12] PROGMEM = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; const int chipSelect = 10; const char string_0[] PROGMEM = "1=0-Fallend 1-Steigend 2-Beide"; const char string_1[] PROGMEM = "2=Abtast Intervall"; const char string_2[] PROGMEM = "3=0-Datum+Uhrzeit,1-Timestamp,2-Timestamp+Millis,3-Systemmillis"; const char string_3[] PROGMEM = "4=Ausgabe 0-Serial 1-SD 2-Beides"; const char string_4[] PROGMEM = "
-
Datei
Test.ino
int altpos1; int neupos1; int altpos2; int neupos2; int pos1=11; int pos2=10; int positionsmotor; int anders1; int anders2; void setup() { // put your setup code here, to run once: pinMode(pos1, INPUT_PULLUP); pinMode(pos2, INPUT_PULLUP); Serial.begin(9600); altpos1=digitalRead(pos1); anders1=1; altpos2=digitalRead(pos2); anders2=1; } void loop() { // put your main code here, to run repeatedly: neupos1= digitalRead(pos1); if (neupos1>altpos1&anders1==0) { positionsmotor=1; altpos1=neupos1; anders1=1; Serial.println(positionsmotor); Serial.println(); } else { if (neupos1<altpos1&anders1==0) { positionsmotor
in „Flankenauswertung für 2 Eingänge“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Test.ino
int altpos1; int neupos1; int altpos2; int neupos2; int pos1=11; int pos2=10; int positionsmotor; int anders1; int anders2; void setup() { // put your setup code here, to run once: pinMode(pos1, INPUT_PULLUP); pinMode(pos2, INPUT_PULLUP); Serial.begin(9600); altpos1=digitalRead(pos1); anders1=1; altpos2=digitalRead(pos2); anders2=1; } void loop() { // put your main code here, to run repeatedly: neupos1= digitalRead(pos1); if (neupos1>altpos1&anders1==0) { positionsmotor=1; altpos1=neupos1; anders1=1; Serial.println(positionsmotor); Serial.println(); } else { if (neupos1<altpos1&anders1==0) { positionsmotor
in „Flankenauswertung für 2 Eingänge“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Hauptcode.ino
// Einbinden der Bibliotheken //**************************************************************************************************************************************************************** #include <SIM900.h> #include <SoftwareSerial.h> #include <GSM.h> #include <call.h> //**************************************************************************************************************************************************************** //Festlegen der Variablen //*************************************************************************************************************************************
in „Arduino Uno : "Selstsames" Verhalten von 2 Codes“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
test.ino
/********* Complete project details at https://randomnerdtutorials.com *********/ #include <SoftwareSerial.h> // Configure software serial port SoftwareSerial SIM900(7, 8); char incoming_char=0; int statanruf =0; void setup() { // Arduino communicates with SIM900 GSM shield at a baud rate of 19200 // Make sure that corresponds to the baud rate of your module SIM900.begin(4800); // for GSM shield // For serial monitor Serial.begin(115200); SIM900.print("AT+CLIP=1\r"); // turn on caller ID notification delay(100); } void loop() { Serial.println("Warte auf Anrufe"); // Display any text that the GSM
in „Arduino Uno : "Selstsames" Verhalten von 2 Codes“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
test.ino
/********* Complete project details at https://randomnerdtutorials.com *********/ #include <SoftwareSerial.h> #include <SIM900.h> // Configure software serial port SoftwareSerial SIM900(7, 8); char incoming_char=0; int statanruf =0; void setup() { // Arduino communicates with SIM900 GSM shield at a baud rate of 19200 // Make sure that corresponds to the baud rate of your module SIM900.begin(4800); // for GSM shield // For serial monitor Serial.begin(115200); SIM900.print("AT+CLIP=1\r"); // turn on caller ID notification delay(100); } void loop() { Serial.println("Warte auf Anrufe"); // Display
in „Arduino Uno : "Selstsames" Verhalten von 2 Codes“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
workingcontinuouspressure.ino
#include <Wire.h> #include <Adafruit_BMP085.h> // Adafruit Bibliothek einbinden Adafruit_BMP085 bmp; void setup(){ // Seriellen Monitor aktivieren Serial.begin(9600); // Sensor initialisieren if (!bmp.begin()) { Serial.println("Keinen gültigen BMP085 Sensor gefunden!"); while (true) {} } } void loop(){ Serial.print("Luftdruck: "); // readPressure() Luftdruck in Pa auslesen und anzeigen Serial.print(bmp.readPressure()); Serial.println(" Pa"); }
in „brauche Hilfe bei Projekt mit barometrischen sensor“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
workingcontinuouspressure.ino
#include <Wire.h> #include <Adafruit_BMP085.h> // Adafruit Bibliothek einbinden Adafruit_BMP085 bmp; void setup(){ // Seriellen Monitor aktivieren Serial.begin(9600); // Sensor initialisieren if (!bmp.begin()) { Serial.println("Keinen gültigen BMP085 Sensor gefunden!"); while (true) {} } } void loop(){ Serial.print("Luftdruck: "); // readPressure() Luftdruck in Pa auslesen und anzeigen Serial.print(bmp.readPressure()); Serial.println(" Pa"); }
in „brauche Hilfe bei Projekt mit barometrischen sensor“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
shiftout.ino
int latchPin = 2; int clockPin = 0; int dataPin = 11; byte out; void setup() { pinMode(latchPin, OUTPUT); pinMode(clockPin, OUTPUT); pinMode(dataPin, OUTPUT); } void loop() { out++; if(out>255)out=0; delay(50); digitalWrite(latchPin, LOW); shiftOut(dataPin, clockPin, LSBFIRST, out); digitalWrite(latchPin, HIGH); }
in „Arduino mit Schieberegister“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
test.ino
#include <Bridge.h> #include <YunServer.h> #include <YunClient.h> #define uint unsigned int #define ulong unsigned long #define PIN_RAINMETER 8 // Digital 8 long rain_last = 0; volatile int RegenCounter = 0; YunServer server; void setup() { pinMode(13,OUTPUT); digitalWrite(13, LOW); Bridge.begin(); digitalWrite(13, HIGH); server.listenOnLocalhost(); server.begin(); pinMode(PIN_RAINMETER, INPUT); digitalWrite(PIN_RAINMETER, HIGH); attachInterrupt(3, countRainmeter, FALLING); } void loop() { YunClient client = server.accept(); if (client) { process(client); client.stop(); } delay(50); } void process
in „Interrupt zählt ohne Grund“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
ARPBomb.ino
#include <UIPEthernet.h> // see UIPEthernet/utility/uip_arp.c extern int uip_arp_arpin_do_spoof; void setup() { uint8_t mac[6] = {0xFC,0xC2,0x3D,0x03,0x04,0x05}; IPAddress myIP(192,168,0,25); // IP is not strictly neccessary Ethernet.begin(mac, myIP); uip_arp_arpin_do_spoof = 1; } void loop() { Ethernet.maintain(); }
in „Mit einer ARP-Bombe das lokale Netzwerk lahmlegen“ · Projekte & Code ·
-
Datei
ARPBomb.ino
#include <UIPEthernet.h> // see UIPEthernet/utility/uip_arp.c extern int uip_arp_arpin_do_spoof; void setup() { uint8_t mac[6] = {0xFC,0xC2,0x3D,0x03,0x04,0x05}; IPAddress myIP(192,168,0,25); // IP is not strictly neccessary Ethernet.begin(mac, myIP); uip_arp_arpin_do_spoof = 1; } void loop() { Ethernet.maintain(); }
in „Mit einer ARP-Bombe das lokale Netzwerk lahmlegen“ · Projekte & Code ·
-
Datei
ARPBomb.ino
#include <UIPEthernet.h> // see UIPEthernet/utility/uip_arp.c extern int uip_arp_arpin_do_spoof; void setup() { uint8_t mac[6] = {0xFC,0xC2,0x3D,0x03,0x04,0x05}; IPAddress myIP(192,168,0,25); // IP is not strictly neccessary Ethernet.begin(mac, myIP); uip_arp_arpin_do_spoof = 1; Ethernet.maintain(); // attach ENC36J60 interrupt pin to arduino pin 2: attachInterrupt(0, isr, FALLING); } void isr() { Ethernet.maintain(); Ethernet.maintain(); Ethernet.maintain(); Ethernet.maintain(); Ethernet.maintain(); } void loop() { delay(100); noInterrupts(); Ethernet.maintain(); interrupts(); }
in „Mit einer ARP-Bombe das lokale Netzwerk lahmlegen“ · Projekte & Code ·
-
Datei
Accelometer.ino
#include <Wire.h> #define GYRO 0x68 // gyro I2C address #define REG_GYRO_X 0x1D // IMU-3000 Register address for GYRO_XOUT_H #define AUX_DMP_CONTROLL 0x3D // IMU-3000 Register address for controling digital motion processor and the aux device #define Slave_ACC_ADR 0x14 // IMU-3000 Register address for the Acc sensor addrees #define ACC_DATA_START_ADR 0x18 // IMU-3000 Register address for acc semsor data start address #define DATA_RANGE 0x16 // IMU-3000 Register address for analog sample rate and data range #define ACCEL 0x0F // Accel I2C Address #define KXTF9_FILT_REG 0x21 // Data control reg addr
in „Arduino Gyroscope und Accelometer Werte schwanken“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
strandtest.ino
#include <Adafruit_NeoPixel.h> #define PIN 6 // Parameter 1 = number of pixels in strip // Parameter 2 = Arduino pin number (most are valid) // Parameter 3 = pixel type flags, add together as needed: // NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs) // NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers) // NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products) // NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2) Adafruit_NeoPixel strip = Adafruit_NeoPixel(60, PIN, NEO_GRB + NEO_KHZ800); // IMPORTANT: To reduce NeoPixel burnout
in „Auswahl zweier Arduino Sketches“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Weihnachtsledas.ino
#include <Adafruit_NeoPixel.h> #define DATA_PORT PORTD #define DATA_DDR DDRD #define DATA_PIN 6 #define NUMBER_OF_PIXELS 25 #define PIN 6 Adafruit_NeoPixel strip = Adafruit_NeoPixel(60, PIN, NEO_GRB + NEO_KHZ800); unsigned char display_buffer[NUMBER_OF_PIXELS * 3]; static unsigned char *ptr; static unsigned int pos = 0; volatile unsigned char go = 0; void setup(){ pinMode(2, INPUT); DATA_DDR |= (1 << DATA_PIN); // Initialize UART UCSR0A |= (1<<U2X0); UCSR0B |= (1<<RXEN0) | (1<<TXEN0) | (1<<RXCIE0); UCSR0C |= (1<<UCSZ01) | (1<<UCSZ00) ; UBRR0H = 0; UBRR0L = 1; //Baud Rate 1 MBit (at F_CPU = 16MHz
in „Auswahl zweier Arduino Sketches“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Dreizeiler.ino
// Dreizeiler.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <stdio.h> #include <stdlib.h> #include <math.h> void xxx(int idx) { printf("%d Ergebnis%s\n", idx, idx==1?" ":"se"); } // http://www.wisc-online.com/ViewObject.aspx?ID=IAU8307 /* The purpose of this function is to convert an unsigned binary number to reflected binary Gray code. Binary 1-x-0-x-1-x-0-x-1 | ` ` ` ` | | | | | x = xor v v v v v Abarbeitung MSB ... LSB Gray 1 1 0 0 1 */ unsigned short BinaryToGray(unsigned short num) { return (num>>1) ^ num; } /* A tricky Trick: for up to 2^n bits,
-
Datei
dmx.ino
#define RX_STATUS_PIN 2 volatile uint8_t DmxRxField[4]; //array of DMX vals (raw) volatile uint16_t DmxAddress; //start address uint8_t USARTstate; enum {IDLE, BREAK, STARTB, STARTADR}; //DMX states volatile uint8_t gDmxState; void setup() { Serial.begin(250000); //Enable serial reception with a 250k rate pinMode(RX_STATUS_PIN, OUTPUT); //RX STATUS LED pin, blinks on incoming DMX data gDmxState= IDLE; // initial state DmxAddress = 1; // The desired DMX Start Address // put your setup code here, to run once: } ISR(USART0_RX_vect) { digitalWrite(RX_STATUS_PIN, HIGH); static uint16_t DmxCount; uint8
in „Nebelmaschine über Dmx mit arduino steuern“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Stromerkennung.ino
#include <Wire.h> #define MAG_ADDRESS ((char) 0x1E) uint8_t mag_buffer[2], mag_status; int16_t mag_raw[1]; long start_time = 0; long previous_time = 0; long loop_duration = 0; int run_avg = 0; // running average from mag_raw[0] int delta = 0; // delta between actual value mag_raw[0] and running average int smooth_delta = 0; // running averaged delta void setup() { pinMode(13, OUTPUT);// initialize digital pin 13 as an output. Serial.begin(115200); Serial.println("Initializing..."); Wire.begin(); configMag(); previous_time = micros(); } void loop() { start_time = micros(); loop_duration = start_time
in „Strommessung am Kabel“ · Analoge Elektronik und Schaltungstechnik ·
-
Datei
dmx.ino
#include <DmxSimple.h> #include <MIDI.h> #include <avr/pgmspace.h> #include <string.h> extern volatile uint8_t dmxBuffer[DMX_SIZE]; #define MIDI_LIST_SIZE 4 //MIDI_CREATE_DEFAULT_INSTANCE(); MIDI_CREATE_INSTANCE(HardwareSerial, Serial1, MIDI); byte incomingByte; byte note; byte velocity; byte midichannel; const uint8_t dmx_data[MIDI_LIST_SIZE][256] PROGMEM = { {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
in „Arduino DMX 256 Kanäle als Paket senden“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
test.ino
void setup() { pinMode(1, OUTPUT); pinMode(2, OUTPUT); pinMode(2, OUTPUT); pinMode(3, OUTPUT); pinMode(4, OUTPUT); pinMode(5, OUTPUT); pinMode(6, OUTPUT); pinMode(7, OUTPUT); pinMode(8, OUTPUT); pinMode(9, OUTPUT); pinMode(10, OUTPUT); pinMode(11, OUTPUT); pinMode(12, OUTPUT); pinMode(13, OUTPUT); pinMode(13, OUTPUT); pinMode(14, OUTPUT); pinMode(15, OUTPUT); pinMode(16, OUTPUT); pinMode(17, OUTPUT); pinMode(18, OUTPUT); pinMode(19, OUTPUT); pinMode(20, OUTPUT); pinMode(21, OUTPUT); pinMode(22, OUTPUT); pinMode(23, OUTPUT); pinMode(24, OUTPUT); pinMode(25, OUTPUT); pinMode(26, OUTPUT); pinMode(27, OUTPUT
in „Arduino. Transistor schaltet nicht richtig“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Tasterautomat.ino
#include "TaskMacro.h" class OneShot // Signal Merker { private: bool signal = false; protected: void set(const bool value = true) { signal = value; } public: bool get() // signal wird konsumiert { bool temp = signal; signal = false; return temp; } }; class Taster : public OneShot { public: void run(const byte pin, const bool invers = false) { static int i = 0 ; // Schleifenzähler bool taster = digitalRead(pin) ^ invers; taskBegin(); taskStepName(WarteAufTaster); taskWaitFor(taster); for(i=0;i<20;i++) { taskPause(5); if(!taster) taskJumpTo(WarteAufTaster); } set(); // setze den OneShot Merker
in „Pause im Interrupt“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Klassentest.ino
#include "Teensy.h" TeensyClass Teensy; void setup() { Serial.begin(9600); pinMode(Teensy.LED13_PIN, OUTPUT); } void loop() { Ohne_Classe_LED13_BLINK(); delay(1000); Teensy.Mit_Classe_LED13_BLINK(); delay(1000); } void Ohne_Classe_LED13_BLINK() { digitalWrite(Teensy.LED13_PIN, LOW); delay(200); digitalWrite(Teensy.LED13_PIN, HIGH); delay(200); }
in „Funktion in Classe einbauen !“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Wetterstation.ino
/*-------------------------------------------------- Mobile WLAN Wetterstation --------------------------------------------------*/ #include <ESP8266WiFi.h> #include <Wire.h> #include <Adafruit_Sensor.h> #include <Adafruit_BME280.h> // WLAN definitions const char* ssid = "Wetterstation"; const char* password = ""; // set to "" for open access point w/o passwortd // Create an instance of the server on Port 80 WiFiServer server(80); IPAddress apIP(1, 1, 1, 1); // BME280 definitions Adafruit_BME280 bme; // I2C #define BME280_ADDRESS 0x76 #define SDA 12 #define SCL 14 // Pulse input pin for windspeed
in „ESP8266 arduino maximale String grösse ?“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Wetterstation.ino
/*-------------------------------------------------- Mobile WLAN Wetterstation --------------------------------------------------*/ #include <ESP8266WiFi.h> #include <Wire.h> #include <Adafruit_Sensor.h> #include <Adafruit_BME280.h> #include "FS.h" // WLAN definitions const char* ssid = "Wetterstation"; const char* password = ""; // set to "" for open access point w/o passwortd // Create an instance of the server on Port 80 WiFiServer server(80); IPAddress apIP(1, 1, 1, 1); // BME280 definitions Adafruit_BME280 bme; // I2C #define BME280_ADDRESS 0x76 #define SDA 12 #define SCL 14 // Pulse input
in „ESP8266 arduino maximale String grösse ?“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Blink.ino
#include "Pin.h" #define LED PINDEF(B,5) void setup() { setOutput(LED); } void loop() { togglePin(LED); delay(500); }
in „Pin vom Mikrocontroller in Funktion mit variablen initialisieren“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Monitorhalterung.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 = 8; //Wand 1=eingefahren DI const int Achse_A_1 = 9; //Wand 1=ausgefahren DI const int Achse_B_0 = 10; //Scharnier 1=eingefahren DI const int Achse_B_1 = 11; //Scharnier 1=ausgefahren DI const int Achse_C_0 = 12; //Monitor 1=eingefahren DI const int Achse_C_1 = 13; //Monitor 1=
in „Arduino Steuerung für drei Achsige Halterung“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Entprellung.ino
/* * Entprellung von bis zu 8 Tastern nach Methode Peter Dannegger * */ #include "entprell.h" #define LED_DDR DDRC #define LED_PORT PORTC #define LED0 0 #define LED1 1 #define LED2 2 void setup() { LED_PORT = 0; // LED outputs LED_DDR = 0xFF; init_entprell(); } void loop() { if ( get_key_short( 1<<KEY0 )) LED_PORT ^= 1<<LED0; // reaction on key release if ( get_key_long( 1<<KEY1 )) LED_PORT ^= 1<<LED1; // reaction after REPEAT_START ms // single press and repeat, running light if( get_key_press( 1<<KEY2 )){ // reaction on key press uint8_t i = LED_PORT; i = (i & 0x03) | ((i & ~0x03) << 1); if( (i
in „Tasterverarbeitung mit ARDUINO-C“ · Mikrocontroller und Digitale Elektronik ·