-
Datei
BruteForcePreview.ino
/* BurteForcePreview */ int Z1; int Z2; int Z3; int Z4; int irda[] = {0000, 1111, 2222, 3333, 4444, 5555, 6666, 7777, 8888, 9999}; void setup() { Serial.begin(9600); Serial.println("GO"); } void loop() { for (Z1 = 0; Z1 < 10; Z1 = Z1 + 1) { Serial.print(Z4); Serial.print(Z3); Serial.print(Z2); Serial.print(Z1); delay(1000); Serial.println(); } Z1 = 9; if (Z1 == 9) { for (Z2 = 0; Z2 < 10; Z2 = Z2 + 1) { Serial.print(Z4); Serial.print(Z3); Serial.print(Z2); Serial.print(Z1); delay(1000); Serial.println(); Z1 = 0; } Z2 = 9; if (Z2 == 9) { for (Z3 = 0; Z3 < 10; Z3 = Z3 + 1) { Serial.print(Z4); Serial.print
in „Brute Force mit dem Arduino“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
DecoderPFR-130.ino
/* * Decoder for Pollin PFR-130 Temerature/Rain Gauge * (c)27.05.2016 W.Kracht * * The external unit is sending at 433,92 MHz with ASK modulation * recommended receiver: Geeetech 433Mhz Superheterodyne 3400RF @5V (data at pin 8 of Arduino Uno) * * 36 bit protocol send every 45 seconds with 7 repeats * * Sync: 435us high 8100us low * 0: 435us high 2130us low * 1: 435us high 3840us low * * S0000 0000 0011 1111 1111 2222 2222 2233 3333 * S0123 4567 8901 2345 6789 0123 4567 8901 2345 * |----|----|----|----|----|----|----|----|---- * S0000 hhhh bsRR tttt tttt tttt rrrr rrrr xxxx * * S: Sync * 0: 4
in „Pollin PFR-130 Regenmesser mit Arduino decodieren“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
sip_klingel_ND.ino
/* ==================================================================== * * Copyright (c) 2018 Juerge Liegner All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided
-
Datei
pwm2freq.ino
#include "TimerOne.h" #include <Arduino.h> //#define EMULATE_PWM_SOURCE 1 #ifdef EMULATE_PWM_SOURCE #define PWM_EMULATION_ON_TIME (10) // 1..19 #define PWM_EMULATION_OFF_TIME (20 - PWM_EMULATION_ON_TIME) #endif int input_pin[2] = { 8, 9 }; int output_pin[2] = { 12, 13 }; int output_pin_pwm_emulation = 3; uint8_t input_state[2] = { 0, 0 }; uint8_t input_state_last[2] = { 0, 0 }; uint16_t input_duration[2] = { 1, 1 }; uint16_t input_cnt[2] = { 0, 0 }; uint8_t pwm_step[2] = { 0, 0 }; uint8_t output_state[2] = { 0, 0 }; int16_t output_pwm_cnt[2] = { 0, 0 }; int16_t duration_table[101] = // 0..255
in „PWM Signal in Hz Umwandeln“ · Digitale Signalverarbeitung / DSP / Machine Learning ·
-
Datei
FlipDot_02.ino
/******************************************************** ** Projekt Flipdot ** ********************************************************/ #include <Wire.h> #include "Adafruit_MCP23017.h" Adafruit_MCP23017 mcp; // die Zeichenkodierung uint8_t hex2dot[][5] = { {0x7, 0x5, 0x5, 0x5, 0x7}, // 0 {0x2, 0x2, 0x2, 0x2, 0x2}, // 1 {0x7, 0x1, 0x7, 0x4, 0x7}, // 2 {0x7, 0x1, 0x3, 0x1, 0x7}, // 3 {0x5, 0x5, 0x7, 0x1, 0x1}, // 4 {0x7, 0x5, 0x7, 0x1, 0x7}, // 5 {0x4, 0x4, 0x7, 0x5, 0x7}, // 6 {0x7, 0x5, 0x1, 0x1, 0x1}, // 7 {0x7, 0x5, 0x7, 0x5, 0x7}, // 8 {0x7, 0x5, 0x7, 0x1, 0x1}, // 9 {0x0, 0x7, 0x0, 0x7,
in „Flipdot Display Projekt (Hilfe Logik Erbeten)“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
KarusoBTsteuerung_03.ino
//Pins wo die Motoren angeschlossen sind const int PWM1 = 9; const int PWM2 = 10; //Werte für den Duty-Cycle der PWM-Functions int motorleftspeed = 0; int motorrightspeed = 0; int motorleftspeedr = 0; int motorrightspeedr = 0; //der von der App ankommende String String state; void setup() { //Start einer seriellen Kommunikation vom Arduino UNO zum HC-05 Bluetooth Modul mit 38400 Baud //PS: Baudrate wurde im AT-Modus vom BT-Modul geändert mit AT+UART=38400,0,0 //Default vom BT-Modul habe ich vorher ausgelesen mit AT+UART? und die Response war: +UART=9600,0,0 //Der Name wurde über AT+NAME=Caruso
in „Operation "Caruso"“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
KarusoBTsteuerung_06.ino
//Werte für den Duty-Cycle der PWM-Functions int motorleftspeed = 0; int motorrightspeed = 0; int LPWM_Output = 9; int RPWM_Output = 10; int R_EN = 8; int L_EN = 12; int LPWM_Output2 = 6; int RPWM_Output2 = 5; int R_EN2 = 7; int L_EN2 = 4; //der von der App ankommende String String state; String antwort; bool auswerten = false; bool lruck = false; bool rruck = false; bool anhalten = false; String anfangsendung = "X"; String endesendung = "E"; void setup() { //Start einer seriellen Kommunikation vom Arduino UNO zum HC-05 Bluetooth Modul mit 38400 Baud //PS: Baudrate wurde im AT-Modus vom BT-Modul geändert
in „Operation "Caruso"“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Cam_Viewer-test.ino
#define SSID_NAME "ESP32-CAM" #define SSID_PASSWORD "" #define URL "http://192.168.4.1/jpg" //#define SSID_NAME "xxxxxxxx" //#define SSID_PASSWORD "xxxxxxxx" //#define URL "http://192.168.0.136/jpg" // IP der Kamera anpassen als Sta #include <WiFi.h> #include <HTTPClient.h> #include "TFT_eSPI.h" #include <JPEGDecoder.h> #define SD_CS 16 #define TFT_BL 13 // LED back-light #define TOUCH_BUSY 27 #define TOUCH_IRQ 25 // Return the minimum of two values a and b #define minimum(a,b) (((a) < (b)) ? (a) : (b)) const int picBufferSize = 80*1024; void *picBuffer = NULL; TFT_eSPI tft = TFT_eSPI(); void setup
in „M5StackFire und M5Stack“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Weihnachtskerze_IRsendDemo.ino
/* Brute Force IR-Weihnachtskerzentest */ #include <IRremote.h> IRsend irsend; void setup() { Serial.begin(115200); } void sender(uint8_t address, uint8_t data) { uint32_t bits = 0; uint8_t notData=~data; uint8_t notAddress=~address; bits=address; bits=bits<<8; bits|=notAddress; bits=bits<<8; bits|=data; bits=bits<<8; bits|=notData; //Serial.println(bits,HEX); //delay(2000); for (int i = 0; i < 3; i++) { irsend.sendNEC(bits, 32); delay(40); } } // could be the candle has the following commands: #define ON 0 #define LIGHT 0xa0 #define NUMBEROFCOMMANDS 2 uint8_t commands[]={ON,LIGHT}; uint8_t index
in „Weihnachtskerzen IR-Protokoll“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
led_blink_olli.ino
#define LED_PIN_1 7 #define LED_PIN_2 8 #define LED_PIN_3 4 #define BUTTON_PIN 2 /******************************************************************************/ static unsigned long last_ms; static bool start_new_ms; /******************************************************************************/ void my_led_sequence(void); /******************************************************************************/ void setup() { pinMode(LED_PIN_1, OUTPUT); pinMode(LED_PIN_2, OUTPUT); pinMode(LED_PIN_3, OUTPUT); pinMode(BUTTON_PIN, INPUT); } /*****************************************************************
in „millis() mit if aufrufen“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
MPU6050_calibration.ino
// Arduino sketch that returns calibration offsets for MPU6050 // Version 1.1 (31th January 2014) // Done by Luis Ródenas <luisrodenaslorda@gmail.com> // Based on the I2Cdev library and previous work by Jeff Rowberg <jeff@rowberg.net> // Updates (of the library) should (hopefully) always be available at https://github.com/jrowberg/i2cdevlib // These offsets were meant to calibrate MPU6050's internal DMP, but can be also useful for reading sensors. // The effect of temperature has not been taken into account so I can't promise that it will work if you // calibrate indoors and then use it outdoors
in „MPU-6050 Auslesen Prblem“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
ResetCounterKomplexer.ino
#include <EEPROM.h> #include <Streaming.h> /** * Etwas komplexeres Beispiel mit Reset Counter * * setup() zeigt wie ein ganzer Datensatz gelesen und geschrieben wird * serialEvent() verändert nur einen Teilbereich * * EEPROM.put() ruft intern EEPROM.update() auf, schreibt also nur die * wirklich veraenderten Daten * * Die "ADC Referenz Spannung" wird erst beim schreiben der *.eep mit * gueltigem Wert besetzt. */ struct EepromData { float adcReferenzSpannung; // Volt uint16_t resetCounter; }; // Struktur vorbesetzen, mit Eintag in *.eep Datei EepromData datenSatz EEMEM {1.08,0}; void serialEvent() { if(
in „AVR: EEPROM-Inhalt beim Flashen behalten?“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Wifi_Relais_Test.ino
// #include <ESP8266WiFi.h> const char* ssid = "TEST"; // Setzt den Netzwerknamen, der später sichtbar ist const char* password = ""; // Setzt das Passwort, das später verwendet wird. Sollte kein Passwort gewünscht sein nur " " unsigned long ulReqcount; WiFiServer server(80); // Erzeugt eine Insatanz auf dem Server. In dem Fall auf Port 80 IPAddress apIP(192, 168, 1, 1); // Hiermit lässt sich die IP einstellen für die Website void setup() // Einstellungen und Parameter setzen { ulReqcount = 0; // Globale Variable setzen pinMode(2, OUTPUT); // Schutz des Pins GPIO2, der für die Schaltung des Relais
in „Frage zur Ansteuerung des ESP Relais“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
mqtt_esp8266.ino
/* Basic ESP8266 MQTT example This sketch demonstrates the capabilities of the pubsub library in combination with the ESP8266 board/library. It connects to an MQTT server then: - publishes "hello world" to the topic "outTopic" every two seconds - subscribes to the topic "inTopic", printing out any messages it receives. NB - it assumes the received payloads are strings not binary - If the first character of the topic "inTopic" is an 1, switch ON the ESP Led, else switch it off It will reconnect to the server if the connection is lost using a blocking reconnect function. See the 'mqtt_reconnect_nonblocking
in „LED-Matrix mit ESP8266 und MAX7219 Modulen“ · Projekte & Code ·
-
Datei
15erAccelTest.ino
#include <Adafruit_GFX.h> #include <Adafruit_ST7735.h> #include <SPI.h> #include <Wire.h> Adafruit_ST7735 tft = Adafruit_ST7735(7,5, 6); #define sda 13 #define scl 15 #define cs 14 #define intpin 11 #define cspin 16 float accX, accY, accZ; byte adress= 0x0c; void setup() { Wire.setPins(sda,scl); Wire.begin(); pinMode(sda, INPUT_PULLUP); pinMode(scl, INPUT_PULLUP); pinMode(cs, OUTPUT); pinMode(cspin, OUTPUT); pinMode(intpin, INPUT); digitalWrite(cs,HIGH); digitalWrite(cspin,HIGH); tft.initR(INITR_MINI160x80); tft.fillScreen(ST77XX_BLACK); tft.setTextWrap(false); tft.setTextColor(ST77XX_WHITE, ST77XX_BLACK
in „Arduino Custom Firmware für Fitness Armband mit NRF52“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
wifi-serial-1.ino
// from // https://atadiat.com/en/e-esp8266-esp32-wifi-serial-bridge-converter/ /**** This version is ported by Atadiat to work on ESP8266 (tested on NodeMCU 1.0) ****/ /**** Porting was done by Yahya Tawil****/ // ESP32 WiFi <-> 3x UART Bridge // by AlphaLima // www.LK8000.com // Disclaimer: Don't use for life support systems // or any other situations where system failure may affect // user or environmental safety. #include <ESP8266WiFi.h> // config: //////////////////////////////////////////////////////////// #define MODE_AP // phone connects directly to ESP //#define MODE_STA // ESP connects
in „serielle Funkbrücke“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Hauptcode_mit_Testcode_2.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
Hauptcode_mit_Testcode_2.ino
// Einbinden der Bibliotheken //**************************************************************************************************************************************************************** #include <SIM900.h> #include <SoftwareSerial.h> #include <GSM.h> #include <call.h> #define MIT //**************************************************************************************************************************************************************** //Festlegen der Variablen //*************************************************************************************************************************
in „Arduino Uno : "Selstsames" Verhalten von 2 Codes“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
max31865Hani.ino
/******************************************************************************* * Copyright (C) 2013 Maxim Integrated Products, Inc., All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: *
in „MAX31865 + PT100 kommuniziert nicht mit Arduino“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
I_C_Versuch.ino
//Arduino 1.0+ Only //Arduino 1.0+ Only #include "Wire.h" #define DS1307_ADDRESS 0x68 byte zero = 0x00; //workaround for issue #527 void setup(){ pinMode(10, OUTPUT); Wire.begin(); Serial.begin(9600); setDateTime(); } void loop(){ printDate(); delay(3000); } void setDateTime(){ byte second = 0; //0-59 byte minute = 31; //0-59 byte hour = 21; //0-23 byte weekDay = 2; //1-7 byte monthDay = 3; //1-31 byte month = 6; //1-12 byte year = 14; //0-99 Wire.beginTransmission(DS1307_ADDRESS); Wire.write(zero); //stop Oscillator Wire.write(decToBcd(second)); Wire.write(decToBcd(minute)); Wire.write(decToBcd
in „Arduino und DS1307“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
ultraschall3.5.ino
// Sensor Links long laengelinks; long cm2; // Sensor Vorne long laengevorne; long cm; // Sensor Rechts long laengerechts; long cm3; // Motor Rechts const int Motor1Pin1 = 1; const int Motor1Pin2 = 0; //Motor Links const int Motor2Pin1 = 2; const int Motor2Pin2 = 3; //int Abstand = 10; void setup() { // Sensor PINS // Serial.begin (9600); pinMode(11,OUTPUT); pinMode(10,INPUT); pinMode(12,OUTPUT); pinMode(8,OUTPUT); pinMode(9,INPUT); pinMode(7,OUTPUT); pinMode(5,OUTPUT); pinMode(6,INPUT); pinMode(4,OUTPUT); // Motor PINS pinMode(Motor1Pin1, OUTPUT); pinMode(Motor1Pin2, OUTPUT); pinMode(Motor2Pin1
in „Sensorgesteuertes Auto mit Arduino Uno (R3)“ · PC Hard- und Software ·
-
Datei
RS232_Test.ino
#include <SoftwareSerial.h> #include "Arduino.h" // software serial #1: TX = digital pin 1, RX = digital pin 0 SoftwareSerial portOne(1,0); // software serial #2: TX = digital pin 8, RX = digital pin 9 // on the Mega, use other pins instead, since 8 and 9 don't work on the Mega SoftwareSerial portTwo(8,9); void sendCmd () { portOne.write("A"); } void setup() { // Open serial communications and wait for port to open: Serial.begin(9600); while (!Serial) { ; // wait for serial port to connect. Needed for Leonardo only } // Start each software serial port portOne.begin(9600); // portTwo.begin(9600)
in „RS232 Arduino“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Motortest3Array.ino
// Arrays to save our results in //unsigned long stop_times[5000]; unsigned long currentvalues[500] ; unsigned long IniB13values[500]; unsigned long Hall1values[500]; unsigned long Hall2values[500]; const int analogInPin = A0; // Analog input pin that the LEM LTS 15-NP is attached to int IniB13 = 2; //Grundstellung int Hall1 = 3; //Hallspur 1 int Hall2 = 4; //Hallspur 2 // Setup the serial port void setup() { Serial.begin(9600); pinMode (IniB13, INPUT); pinMode (Hall1, INPUT); pinMode (Hall2, INPUT); } void loop() { unsigned int i; // capture the values to memory for(i=0;i<500;i++) { //start_times
in „mit Arduino Due, DC-Motorstrom positionsabhängig erfassen und seriell ausgeben“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
i2c.ino
#include <Wire.h> const int Slave_Adress = 0x28; byte myarray[16] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,255}; void setup() { Wire.begin(); // join i2c bus (address optional for master) } int x = 0; byte b = 0x12; void loop() { Serial.println("Sending..."); Wire.beginTransmission(Slave_Adress); // transmit to device #50 Wire.write(myarray,5); // sends one byte /* Wire.write(myarray[1]); Wire.write(myarray[2]); Wire.write(myarray[3]); Wire.write(myarray[4]); Wire.write(myarray[5]); Wire.write(myarray[2]); Wire.write(myarray[6]); Wire.write(myarray[7]); Wire.write(myarray[8]); Wire.write(myarray[9]); Wire.write
in „Attiny - Arduino I2C Problem“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
LS_328_ARD.ino
/* Beispielprogramm fuer Zeitmessung mit Arduino UNO mit ATmega328. Zwischen zwei Eingangsimpulsen wird die Zeit gemessen und daraus die Geschwindigkeit in m/s errechnet. Dabei wird von einer Messstrecke von 0,1m ausgegangen; der Wert kann angepasst werden: SENSORABSTAND. Das Startsignal wird an IO2 (INT0) erwartet und das Stoppsignal an IO3 (INT1). Ohne weitere Beschaltung werden jeweils die negativen Flanken verwendet. Wird ein Signal an beide Eingaenge angelegt, wird mit der Flanke an IO2 die Messung gestartet und danach der Eingang IO3 freigegeben, der erst die nachfolgende Flanke wertet.
in „Stoppuhr – Geschwindigkeit – Pulsweite mit Atmega88“ · Projekte & Code ·
-
Datei
Bewegungsmelder_Flur_Fade.ino
//Flur int flurdimmzeit = 4;//ms //alle ...millisekunden einen hoch/runter von max255 dimmstufen. int flurlaufzeit = 30;//sek //wielange das licht abbleiben soll. immer 4 sekunden weniger angeben da die int lichtflur = 175;//0-255 // die helligkeit auf die bei bewegungserkennung gedimmt wird. //Speise int speisedimmzeit = 4;//ms int speiselaufzeit = 15;//sek int lichtspeise = 255;//0-255 //Bade int badedimmzeit = 1;//ms int badelaufzeit = 45;//sek int lichtbade = 255;//0-255 //Reserve //int resdimmzeit = 10;//ms //int reslaufzeit = 10;//sek //int lichtres = 255;//0-255 //Flur int zfflur = 1; //zf
in „Komisches Phänomen bei PWM ansteuerung.“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
WS2812_Glediator.ino
//############################################################################## //############################################################################## // # // Glediator to WS2812 pixel converter # // by R. Heller # // V 1.0 - 07.01.2014 # // wwww.SolderLab.de # // # // Receives serial data in Glediator protocol format @ 1 MBit/s # // and distributes it to a connectect chain of WS2812 pixels # // # // Adjust the correct DATA PIN and the correct NUMBER OF PIXELS you are using # // in the definitions section below before uploading this sketch to your # // Arduino device. # // # // Maxiumim
in „Auswahl zweier Arduino Sketches“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
decoder11n.ino
/////////////////////////////////////////////////////////////////////// // CW Decoder made by Hjalmar Skovholm Hansen OZ1JHM VER 1.01 // // Feel free to change, copy or what ever you like but respect // // that license is http://www.gnu.org/copyleft/gpl.html // // Discuss and give great ideas on // // https://groups.yahoo.com/neo/groups/oz1jhm/conversations/messages // /////////////////////////////////////////////////////////////////////// /* Überarbeitet von W.Kiefer (DH1AKF) Okt. 2014 */ /////////////////////////////////////////////////////////////////////////// // Read more here http://en.wikipedia.org
-
Datei
_7segment_Test.ino
byte PA = 8; byte PB = 9; byte PC = 10; byte PD = 11; void setup() { /* pin 8 = E3 40511 pin 9 = E2 40511 pin 10 = E1 40511 pin 11 = E0 40511 */ { pinMode(PA,OUTPUT); pinMode(PB,OUTPUT); pinMode(PC,OUTPUT); pinMode(PD,OUTPUT); } } /* im Lpoo angegebene Kommentare entsprechen der ausgegebenen Zahl */ void loop() { digitalWrite(PA, LOW); //0 digitalWrite(PB, LOW); digitalWrite(PC, LOW); digitalWrite(PD, LOW); delay (500); digitalWrite(PA,LOW); //1 digitalWrite(PB,LOW); digitalWrite(PC,LOW); digitalWrite(PD,HIGH); delay (500); digitalWrite(PA,LOW); //2 digitalWrite(PB,LOW); digitalWrite(PC,HIGH);
in „Bit und Bytemanipulation mit Arduino“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
PT1000_500.ino
/* Beispielprogramm fuer einfache PT1000-Messung im Bereich -100 -> +850 °C mit einem Arduino Uno (ATmega328). Zunächst die Schaltungsbeschreibung: Der zu messende PT1000-Widerstand liegt mit einem Ende an GND und mit dem anderen Anschluss am Eingang A0 (PT_IN_0). PortB.0 des Arduino-Boards dient als geschalteter Ausgang für die Referenzspannung und geht zum einen an den Anschluss AREF und zum anderen ueber einen Widerstand R_REF 1000 Ohm 0,1% an den Eingang A0. Der PT1000-Widerstand und der 1000 Ohm Widerstand bilden somit einen Spannungsteiler, der bei 0 Grad C die Spannung an AREF genau 1:2
in „PT1000, einfache Auswertung mit AVR (ATmega328)“ · Projekte & Code ·
-
Datei
lightTomographLibrary.ino
#ifndef LightTomograph_h #define LightTomograph_h #if ARDUINO >= 100 #include "Arduino.h" #else #include "WProgram.h" #include "pins_arduino.h" #include <Stepper.h> #include "WConstants.h" #endif class LightTomograph{ #endif public: LightTomograph(); int AngleByStep(double MotorAngle, int Translation); int Steps(int MustHaveAngle, int AngleByStep); int PicByStep(int Steps, int HowManyPICs); boolean PicReady(int HowManyPics, boolean Funktion); void SetMotorLinksoderRechts(int pinPWM_A,int pinPWM_B,int pinDir_A ,int pinDir_B ,int schritte_def,boolean PicReady()); void init(float initial); }; void
in „Library für Maturaprojekt“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
UTouch_Calibration1111.ino
// UTouch_Calibration (C)2013-2014 Henning Karlsen // web: http://www.henningkarlsen.com/electronics // // This program can be used to calibrate the touchscreen // of the display modules. // This program requires the UTFT library and a touch // screen module that is compatible with UTFT. // // It is assumed that the display module is connected to an // appropriate shield or that you know how to change the pin // numbers in the setup. // // Instructions will be given on the display. // #include <UTFT.h> #include <UTouch.h> // Define the orientation of the touch screen. Further // information can
in „2.8 TFT von egeloo“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Abwurfsteuerung_Nano_5.ino
#include <TinyGPS++.h> // Tiny GPS Plus Library #include <SoftwareSerial.h> // Software Serial Library so we can use other Pins for communication with the GPS module #include <SPI.h> #include <SD.h> #include <Wire.h> #include <LiquidCrystal_I2C.h> #include<stdlib.h> static const uint32_t GPSBaud = 9600; const int chipSelect = 10; const byte interruptPin = 2; const byte relaisPin = 6; static const int RXPin = 4, TXPin = 5; LiquidCrystal_I2C lcd(0x3F, 16, 2); int buttonIncreaseDistance = 7; int buttonDecreaseDistance = 8; volatile boolean drop = LOW; TinyGPSPlus gps; // Create an Instance of the TinyGPS
in „variabel 12-24V für Arduino Interrupt verwenden“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
HX711_dzt.ino
#include <LiquidCrystal.h> LiquidCrystal lcd(12,11,5,4,3,2); #include "HX711.h" const byte hx711_data_pin = A5; const byte hx711_clock_pin = A6; HX711 scale(A5, A6); float calibration_factor = 21500; //-7050 worked for my 440lb max scale setup float units; float ounces; void setup() { Serial.begin(9600); // set up the LCD's number of columns and rows: lcd.begin(16, 2); lcd.setCursor(0, 0); lcd.print("Calibration"); Serial.println("HX711 calibration sketch"); Serial.println("Remove all weight from scale"); Serial.println("After readings begin, place known weight on scale"); Serial.println("Press +
in „Zwei Sensoren auslesen; Wägezelle“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
flight_neuer_enc.ino
#include <LiquidCrystal.h> #include <ClickEncoder.h> #include <TimerOne.h> LiquidCrystal lcd(11, 12, 13, 6, 5, 4, 3); ClickEncoder *hdg_encoder; long last, hdg_pos, spd_pos, alt_pos; void timerIsr() { hdg_encoder->service(); } void setup() { hdg_encoder = new ClickEncoder(2, 22, 26); Timer1.initialize(1000); Timer1.attachInterrupt(timerIsr); last = -1; lcd.begin(20, 4); Serial.begin(9600); } void loop() { hdg_pos += hdg_encoder->getValue(); if (hdg_pos != last){ last = hdg_pos; Serial.println(hdg_pos);} lcd.setCursor(0, 0); lcd.print("Autopilot"); lcd.setCursor(0, 2); lcd.print("HDG"); lcd.setCursor
in „Rotary Encoder macht immer 4 Schritte“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Raspi_temp_Sender.ino
//-------------------------------------------------------------------------------------- // TempTX-tiny ATtiny84 Based Wireless Temperature Sensor Node // By Nathan Chantrell http://nathan.chantrell.net // Updated by Martin Harizanov (harizanov.com) to work with DS18B20 // To use with DS18B20 instead of TMP36, a 4K7 resistor is needed between the Digital 9 and Digital 10 of the ATTiny (Vdd and DQ) // To get this to compile follow carefully the discussion here: http://arduino.cc/forum/index.php?topic=91491.0 // GNU GPL V3 //------------------------------------------------------------------------
in „RFM 12B SP Rev.1 mit 5V oder nicht ?“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Arduino_Ultraschall_Anemometer.ino
// Programm zur Bestimmung der Schallgeschwindigkeit // ================================================= // Gemessen wird die Laufzeit des Ultraschalls vom Sender zum Objekt und wieder zurück zum Empfänger // ------------------------------------------------------------------------------------------------- #include <LiquidCrystal_I2C.h> #include <Wire.h> LiquidCrystal_I2C lcd(0x3F,16,2); // set the LCD address to 0x27 for a 16 chars and 2 line display. ACHTUNG: Adresse kann auch 0x3F sein !!! // Anschlüsse: // GND - GND // VCC - 5V // SDA - ANALOG Pin 4 // SCL - ANALOG pin 5 int VoutPin_x_f =
in „Experimente mit Arduino und Ultraschall“ · Projekte & Code ·
-
Datei
Webserver_Test_Download.ino
/********************************************************************** Arduino Ethernet Webserver nach: https://werner.rothschopf.net/202001_arduino_webserver_post.htm This version: - don't uses Arduino String class - read parameters POST - care about non defined pages - keeps the loop tidy - handle favicon.ico - don't use F-Makro in client.print **********************************************************************/ #define CS 53 // Pin 53 für CS Ethernet-Shield OKY3487 #include <SPI.h> #include <Ethernet.h> #include <StreamLib.h> // https://github.com/jandrassy/StreamLibdownload byte mac[] {
in „Leichte Probleme mit Arduino Webserver und HTML-Implementierung“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
stm32_ino.txt
#include <assert.h> #define DEBUG 0 /* Symbolic names for bit rate of CAN message */ typedef enum {CAN_50KBPS, CAN_100KBPS, CAN_125KBPS, CAN_250KBPS, CAN_500KBPS, CAN_1000KBPS} BITRATE; /* Real speed for bit rate of CAN message */ uint32_t SPEED[6] = {50*1000, 100*1000, 125*1000, 250*1000, 500*1000, 1000*1000}; /* Symbolic names for formats of CAN message */ typedef enum {STANDARD_FORMAT = 0, EXTENDED_FORMAT} CAN_FORMAT; /* Symbolic names for type of CAN message */ typedef enum {DATA_FRAME = 0, REMOTE_FRAME} CAN_FRAME; typedef struct { uint32_t id; /* 29 bit identifier */ uint8_t data[8]; /* Data
in „Arduino Blue Pill & CAN mit SN65HVD230“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
VOID_Loop_CAN.ino
void loop() { CAN_msg_t CAN_TX_msg; CAN_msg_t CAN_RX_msg; CAN_TX_msg.data[0] = 0x00; CAN_TX_msg.data[1] = 0x01; CAN_TX_msg.data[2] = 0x02; CAN_TX_msg.data[3] = 0x03; CAN_TX_msg.data[4] = 0x04; CAN_TX_msg.data[5] = 0x05; CAN_TX_msg.data[6] = 0x06; CAN_TX_msg.data[7] = 0x07; CAN_TX_msg.len = frameLength; unsigned long currentMillis = millis(); if (currentMillis - previousMillis >= interval) { previousMillis = currentMillis; if ( ( counter % 2) == 0) { CAN_TX_msg.type = DATA_FRAME; if (CAN_TX_msg.len == 0) CAN_TX_msg.type = REMOTE_FRAME; CAN_TX_msg.format = EXTENDED_FORMAT; CAN_TX_msg.id = 0x32F103
in „Arduino Blue Pill & CAN mit SN65HVD230“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Arduino_IN9_clock.ino
#include <Wire.h> #define DS3231_I2C_ADDRESS 104 // SCL - pin A5 // SDA - pin A4 // To set the clock, run the sketch and use the serial monitor. // Enter T1124154091014; the code will read this and set the clock. See the code for full details. // byte seconds, minutes, hours, day, date, month, year; char weekDay[4]; byte tMSB, tLSB; float temp3231; const byte Pin_hour_up = 2; const byte Pin_minute_up = 3; // For Arduino Nano or Arduino UNO the PWM pins are 3,5,6,9,10 and 11. // The pins 3, 9, 10 and 11 generates PWM frequency of 490Hz and pins 5 and 6 generates PWM frequency of 980Hz. // The value
in „Physikprojekte“ · Offtopic ·
-
Datei
danceswithferrets4n.ino
/* ROM Reader. Quick Arduino program to read a parallel-accessed ROM and dump it to the serial port in hex. Oddbloke. 16th Feb 2014. */ // How I've wired the digital pins on my Arduino to the address and data pins on // the ROM. static const int kPin_A0 = 40; static const int kPin_A1 = 41; static const int kPin_A2 = 42; static const int kPin_A3 = 43; static const int kPin_A4 = 44; static const int kPin_A5 = 45; static const int kPin_A6 = 46; static const int kPin_A7 = 47; static const int kPin_A8 = 25; static const int kPin_D0 = 39; static const int kPin_D1 = 38; static const int kPin_D2 = 37; static
in „Altes EPROM auslesen Intersil 6654A (2xCE) mit Arduino“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
sketch_eprom_lesen.ino
// ---------------------------------- // EPROM auslesen // von Wastl (hartundweichware) uint16_t addressCounter = 0; uint8_t byte_read = 0; uint8_t pin39_CS, pin40_CE2, pin41_CE1; char prbuff[64]; #define DATA_IN_PORT PINL void setup() { DDRA = B11111111; // A0-A7 1= output DDRL = B00000000; // Q0-Q7 DDRC = B00000001; // A8 pinMode(LED_BUILTIN, OUTPUT); // --> hier einmal korrekt zuweisen <-- pin39_CS = 39; // CS pin41_CE1 = 41; // CE1 pin40_CE2 = 40; // CE2 pinMode(pin41_CE1, OUTPUT); // CE1 pinMode(pin40_CE2, OUTPUT); // CE2 pinMode(pin39_CS, OUTPUT); // CS digitalWrite(pin40_CE2, HIGH); digitalWrite
in „Altes EPROM auslesen Intersil 6654A (2xCE) mit Arduino“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
PWM_Arduino-Leonardo.ino
#define pulsPin 10 // OC1B bzw. PB6 #define IN1 0 #define IN2 1 #define IN3 2 #define IN4 3 uint8_t taste, taste_alt; void setup() { pinMode(pulsPin, OUTPUT); digitalWrite(pulsPin, HIGH); // OC1B bzw. PB6 pinMode(IN1, INPUT_PULLUP); pinMode(IN2, INPUT_PULLUP); pinMode(IN3, INPUT_PULLUP); pinMode(IN4, INPUT_PULLUP); pinMode(13, OUTPUT); digitalWrite(13, HIGH); // VCC close to pulsPin for indicator LED active LOW } void loop() { taste = 0; if(!digitalRead(IN1)) taste = 1; // niedrigste Priorität if(!digitalRead(IN2)) taste = 2; if(!digitalRead(IN3)) taste = 3; if(!digitalRead(IN4)) taste = 4; //
in „Präzise Pulse aus Arduino Leonardo“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
PWM_Arduino-Leonardo.ino
#define pulsPin 10 // OC1B bzw. PB6 #define IN1 0 #define IN2 1 #define IN3 2 #define IN4 3 uint8_t taste, taste_alt; void setup() { pinMode(pulsPin, OUTPUT); digitalWrite(pulsPin, HIGH); // OC1B bzw. PB6 pinMode(IN1, INPUT_PULLUP); pinMode(IN2, INPUT_PULLUP); pinMode(IN3, INPUT_PULLUP); pinMode(IN4, INPUT_PULLUP); pinMode(13, OUTPUT); digitalWrite(13, HIGH); // VCC close to pulsPin for indicator LED active LOW } void loop() { taste = 0; if(!digitalRead(IN1)) taste = 1; // niedrigste Priorität if(!digitalRead(IN2)) taste = 2; if(!digitalRead(IN3)) taste = 3; if(!digitalRead(IN4)) taste = 4; //
in „Präzise Pulse aus Arduino Leonardo“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
20230501b-solarinverter.ino
// Solarwechselrichter de dd3et // https://www.etechnophiles.com/how-to-change-the-pwm-frequency-of-arduino-nano/ // TCCR2B = TCCR2B & B11111000 | B00000001; // for PWM frequency of 31372.55 Hz on D3 & D11 // https://www.arduino.cc/reference/de/language/functions/external-interrupts/attachinterrupt/ // https://www.mikrocontroller.net/topic/542674?page=3#7218665 // Widerstand int widerstandspin = 12; bool widerstand; int pvspgpin = A0; int pvspg; // Nulldurchgang int analogscheitelmonofloppin = A1; int interruptPin = 2; volatile unsigned long startzeit; // Scheitelpunkt bool scheitelmonoflop; bool
in „Eigenbau Solarwechselrichter (diy grid tie inverter)“ · Haus & Smart Home ·
-
Datei
20230502-d-chatgpt.ino
// Pin-Definitionen const int zeroCrossingPin = 2; // Pin für Nulldurchgang const int outputPin = 7; // Pin für Ausgabe // Variablen für die Einstellungen int FLANKENKORREKTUR = 300; // Korrekturwert in Mikrosekunden int pulseWidth = 8000; // Länge des HIGH-Pulses in Mikrosekunden int pulsePosition = 1000; // Position des HIGH-Pulses in Prozent der Halbwelle // Variablen für den Interrupt volatile boolean zeroCrossing = false; volatile unsigned long zeroCrossingTime = 0; void setup() { // Flankenkorrektur pulsePosition = pulsePosition + FLANKENKORREKTUR, // Pin-Modi setzen pinMode(zeroCrossingPin
in „Eigenbau Solarwechselrichter (diy grid tie inverter)“ · Haus & Smart Home ·
-
Datei
20230502a-solarinverter.ino
// Solarwechselrichter de dd3et // https://www.etechnophiles.com/how-to-change-the-pwm-frequency-of-arduino-nano/ // TCCR2B = TCCR2B & B11111000 | B00000001; // for PWM frequency of 31372.55 Hz on D3 & D11 // https://www.arduino.cc/reference/de/language/functions/external-interrupts/attachinterrupt/ // https://www.mikrocontroller.net/topic/542674?page=3#7218665 // Widerstand int widerstandspin = 12; bool widerstand; int pvspgpin = A0; int pvspg; // Nulldurchgang // Variablen für die Einstellungen int flankenkorrektur = 300; // Korrekturwert in Mikrosekunden mit Oszilloskop ermitteln int pulslaenge
in „Eigenbau Solarwechselrichter (diy grid tie inverter)“ · Haus & Smart Home ·
-
Datei
test3.2.ino
#include <WiFi.h> #include <FirebaseESP32.h> //#include <DHT.h> #include <NTPClient.h> #include <WiFiUdp.h> #include <IRremoteESP8266.h> #include <IRrecv.h> #include <IRutils.h> #define WIFI_SSID "Herech" #define WIFI_PASSWORD "here" #define FIREBASE_HOST "http://here.firebasedatabase.app/" #define FIREBASE_AUTH "AIherelM" const int RECV_PIN = 14; IRrecv irrecv(RECV_PIN); decode_results results; int digit; int debounceDelay = 100; // Debounce delay in milliseconds int Timeout = 2000; // Number entry timeout in milliseconds unsigned long lastKeyTime = 0; const String channelsName[50] = {"BBC",
in „ESP32 Automatic Reset after one cycle“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Arduino_Drehzahlmesser_01.ino
#include <LiquidCrystal_I2C.h> #include <Wire.h> LiquidCrystal_I2C lcd(0x27,16,2); // set the LCD address to 0x27 for a 16 chars and 2 line display. ACHTUNG: Adresse kann auch 0x3F sein !!! // Anschlüsse: // GND - GND // VCC - 5V // SDA - ANALOG Pin 4 // SCL - ANALOG pin 5 int sensor = 2; unsigned long currentTime; unsigned long lastTime; //unsigned long pulse_freq; unsigned long period; float pulse_freq; // =========================== // ======= SETUP ========= // =========================== void setup() { pinMode(sensor, INPUT); Serial.begin(9600); attachInterrupt(0, pulse, FALLING); // Setup Interrupt
in „Physikprojekte“ · Offtopic ·