-
Datei
solar_light_tracker_Armin3.ino
/*************************************************************************** * Solar light tracker project with Mega 2560 R3 Board microcontroller, * * Solar panel, LDR resistors, 0.96 inch OLED 128X64 pixels display, * * 2 TB6600 modules and 2 NEMA17 step by step motors. * * * * Armin Rolfes / Wilfried Meyer * * Last revisión 04.10.2024 * ***************************************************************************/ #include <AccelStepper.h> /************** OLED display library and configuration *************/ #include <Wire.h> // I2C communication library. #include <Adafruit_GFX.h> // Core graphics
in „Compilation error: exit status 1“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
solar_light_tracker_Armin3.ino
/*************************************************************************** * Solar light tracker project with Mega 2560 R3 Board microcontroller, * * Solar panel, LDR resistors, 0.96 inch OLED 128X64 pixels display, * * 2 TB6600 modules and 2 NEMA17 step by step motors. * * Armin Rolfes/Wilfried Meyer * * * Last revisión 09.10.2024 * ***************************************************************************/ #include <Arduino.h> #include <Wire.h> // I2C communication library. #include <Adafruit_GFX.h> // Core graphics library for screen. #include <Adafruit_SSD1306.h> // SSD1306 oled driver library
in „Solartracker mit Anemometer und Windalarm“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
read_rotary_encoder_alps_502.ino
#include <TimerOne.h> volatile int8_t enc_delta; // -128 ... 127 static int8_t last; int encoderPinA=2; int encoderPinB=3; uint8_t lastA; uint8_t lastB; void timer_read_encoder(void) { int8_t newv, diff; int A = digitalRead(encoderPinA); int B = digitalRead(encoderPinB); //Serial.print(A,BIN); //Serial.print(" "); //Serial.println(B,BIN); //Serial.print(lastA,BIN); //Serial.print(" "); //Serial.println(lastB,BIN); if ( A != (lastA & 1) || B != (lastB & 1) ) { // we have movement lastA = ((lastA << 1) | A) & 0x7; lastB = ((lastB << 1) | B) & 0x7; //Serial.println("*"); //Serial.print(lastA,BIN); //Serial.print
in „Pollin Encoder Alps 502 auslesen“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
WIFI-Kit-8-Test3.ino
#include <ESP8266WiFi.h> #include "oled.h" #define SSID "Muschikatze" #define PASSWORD "Geheim" #define SERVER "ptb.de" // There are 2 different versions of the board // OLED display=OLED(2,14,4); OLED display=OLED(4,5,16); char buffer[200]; volatile int bla=0; void setup() { display.init(); display.set_contrast(16); display.draw_string_P(0,0,PSTR("Connecting to the AP")); display.display(); // Configure WIFI WiFi.mode(WIFI_STA); WiFi.begin(SSID, PASSWORD); // Wait for connection to the AP while (WiFi.status() != WL_CONNECTED) { delay(1); } // Show the own IP address display.draw_string(0,8,"IP="); display.draw_string
in „Display was auf Knopfdruck Datum anzeigt“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
i2c_BMP280.ino
#include <Wire.h> #include "i2c.h" #include "i2c_BMP280.h" BMP280 bmp280; void setup() { Serial.begin(115200); Serial.print("Probe BMP280: "); if (bmp280.initialize()) Serial.println("Sensor found"); else { Serial.println("Sensor missing"); while (1) {} } // onetime-measure: bmp280.setEnabled(0); bmp280.triggerMeasurement(); } void loop() { bmp280.awaitMeasurement(); float temperature; bmp280.getTemperature(temperature); float pascal; bmp280.getPressure(pascal); static float meters, metersold; bmp280.getAltitude(meters); metersold = (metersold * 10 + meters)/11; bmp280.triggerMeasurement(); Serial.print
in „Arduino iLib und BMP280“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Node2_2017-11-02.ino
#define RF69_COMPAT 1 // JeeLib: RFM69 Funkmodul #define TINY 1 // JeeLib: ATtiny84 Mikrokontroller #include <JeeLib.h> int LED = 8; // LED PIN 8 bzw. Nummerierung 11 bzw. PA2, am ATtiny84 int LDRout = 1; // Digital-PIN für Fotowiderstand (Strom) int LDRin = 3; // Analog-PIN für Fotowiderstand (Messung) char trennzeichen[] = ";"; char lux_text[] = "lux="; char test[] = "undnochwas="; MilliTimer sendTimer; void setup () { pinMode(LDRin,INPUT); pinMode(LDRout,OUTPUT); pinMode(LED,OUTPUT); // PIN als Ausgabe (Strom) definieren digitalWrite(LED,HIGH); delay(1000); // LED ein Serial.begin(38400); rf12
in „Kombination von ATtiny84A, RFM69CW, BME280 - möglich?“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
FWPGANSIDC6NW3L.ino
/* LiquidCrystal Library - Stopwatch Demonstrates the use a 16x2 LCD display. The LiquidCrystal library works with all LCD displays that are compatible with the Hitachi HD44780 driver. There are many of them out there, and you can usually tell them by the 16-pin interface. This can be used with any 16x2 LCD display. This sketch shows the stopwatch to the LCD with baccklit. The circuit: LCD RS pin to digital pin 12 LCD Enable pin to digital pin 11 LCD D4 pin to digital pin 5 LCD D5 pin to digital pin 4 LCD D6 pin to digital pin 3 LCD D7 pin to digital pin 2 LCD R/W pin to ground LCD VSS pin to
in „Stoppuhr TASTER“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
PS2X_TEST6.ino
#include <PS2X_lib.h> //for v1.6 #include <Servo.h> //Die Servobibliothek wird aufgerufen. Sie wird benötigt, damit die Ansteuerung des Servos vereinfacht wird. Servo servoblau; //Erstellt für das Programm ein Servo mit dem Namen „servoblau“ PS2X ps2x; // create PS2 Controller Class //right now, the library does NOT support hot pluggable controllers, meaning //you must always either restart your Arduino after you conect the controller, //or call config_gamepad(pins) again after connecting the controller. int error = 0; byte type = 0; byte vibrate = 0; void setup(){ Serial.begin(57600); servoblau.attach
in „Servo mit Millis anstatt delay steuern.“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
zwei_taster_dimmen_korrekte_Portzuordnung.ino
// Zwei Taster dimmen die LED 6 kontinuierlich int LED=4, taster1=2, taster2=3, helligkeit=7; // 4 = PB4/Pin 3, 2 = PB3/Pin 2, 3 = PB2/Pin 7 void setup() { pinMode(taster1,INPUT_PULLUP); pinMode(taster2,INPUT_PULLUP); analogWrite(LED,mapHelligkeit()); } void loop() { while(!digitalRead(taster1)) { helligkeit--; if(helligkeit<1) helligkeit=1; analogWrite(LED,mapHelligkeit()); delay(1250); } while(!digitalRead(taster2)) { helligkeit++; if(helligkeit>10) helligkeit=10; analogWrite(LED,mapHelligkeit()); delay(1250); } } int mapHelligkeit() { // optische Helligkeit in 10 Schritten anpassen return (int) helligkeit
in „Arduino as ISP“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
PinTemplateVirtual.ino.elf.txt
C:\Users\Worker\AppData\Local\Temp\arduino_build_209462\PinTemplateVirtual.ino.elf: file format elf32-avr Disassembly of section .text: 00000000 <__vectors>: 0: 0c 94 51 00 jmp 0xa2 ; 0xa2 <__ctors_end> 4: 0c 94 79 00 jmp 0xf2 ; 0xf2 <__bad_interrupt> 8: 0c 94 79 00 jmp 0xf2 ;
in „Buchempfehlung C++ und MCUs“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
esp32_BL_Master_00.ino
//@@ -0,0 +1,39 @@ //This example code is in the Public Domain (or CC0 licensed, at your option.) //By Evandro Copercini - 2018 // //This example creates a bridge between Serial and Classical Bluetooth (SPP) //and also demonstrate that SerialBT have the same functionalities of a normal Serial #include "BluetoothSerial.h" #if !defined(CONFIG_BT_ENABLED) || !defined(CONFIG_BLUEDROID_ENABLED) #error Bluetooth is not enabled! Please run `make menuconfig` to and enable it #endif BluetoothSerial SerialBT; uint8_t address[6] = {0xAA, 0xBB, 0xCC, 0x11, 0x22, 0x33}; String MACadd = "AA:BB:CC:11:22:33"; /
in „ESP32 D1 MINI als Bluetooth Master“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
74HC165_neu1.ino
#include <ShiftIn.h> #include <Adafruit_NeoPixel.h> #ifdef __AVR__ #include <avr/power.h> // Required for 16 MHz Adafruit Trinket #endif #define PIN 6 #define NUMPIXELS 18 Adafruit_NeoPixel Pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800); int LED_Ausgabe[8][4] = //Belegung Feld - LED { {0, 1, 6, 7}, //A3 {1, 2, 7, 8}, //A4 {2, 3, 8, 9}, //A5 {4, 5, 12, 13}, //B1 {5, 6, 13, 14}, //B2 {6, 7, 14, 15}, //B3 {7, 8, 15, 16}, //B4 {8, 9, 16, 17} //B5; }; // Init ShiftIn instance with a single chip ShiftIn<1> shift; int x = 0; int b = 0; int j = 0; int i = 0; int lang = 0; char Belegung
in „Switch-Case Anweisung - Frage“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Arduino_Galaxy_vs_blackhole_fast.ino
#include <UTFT.h> // Declare which fonts we will be using extern uint8_t SmallFont[]; UTFT myGLCD(ILI9486,38,39,40,41); extern unsigned short M51[0xE350]; float vx_vorher[82], vy_vorher[82], vz_vorher[82]; // Geschwindigkeiten vor dem Zeitschritt in x-, y- und z-Richtung float vx_nachher[82], vy_nachher[82], vz_nachher[82]; // Geschwindigkeiten nach dem Zeitschritt in x-, y- und z-Richtung float sx_vorher[82], sy_vorher[82], sz_vorher[82]; // Orte vor dem Zeitschritt in x-, y- und z-Richtung float sx_nachher[82], sy_nachher[82], sz_nachher[82]; // Orte nach dem Zeitschritt in x-, y- und z-Richtung
in „Astrosimulationen/Galaxienkollision mit Arduino“ · Projekte & Code ·
-
Datei
Arduino_Galaxy_vs_Galaxy_fast.ino
#include <UTFT.h> // Declare which fonts we will be using extern uint8_t SmallFont[]; UTFT myGLCD(ILI9486,38,39,40,41); extern unsigned short M51[0xE350]; float vx_vorher[102], vy_vorher[102]; // Geschwindigkeiten vor dem Zeitschritt in x- und y-Richtung float vx_nachher[102], vy_nachher[102]; // Geschwindigkeiten nach dem Zeitschritt in x- und y-Richtung float sx_vorher[102], sy_vorher[102]; // Orte vor dem Zeitschritt in x- und y-Richtung float sx_nachher[102], sy_nachher[102]; // Orte nach dem Zeitschritt in x- und y-Richtung float Kraft_x[102] [102]; // Kraftmatrix für alle Wechselwirkungen zwischen allen
in „Astrosimulationen/Galaxienkollision mit Arduino“ · Projekte & Code ·
-
Datei
MCNET_NeoPixelSender3.ino
/* Send data throuhg a NeoPixel stripe at the end of the neopix stript you can connect the Arduino Nano as a receiver for the data string. 21.11.2021 chris_ */ #include <Adafruit_NeoPixel.h> #ifdef __AVR__ #include <avr/power.h> #endif #define PIN 6 #define NUMPIXELS 12 // NUMPIXEL increase by 1 because last pixel is the data transmission message Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS + 1, PIN, NEO_GRB + NEO_KHZ800); void setup() { pixels.begin(); } char Message[]="c-hater ist der Beste ! \n"; void sendBit(uint8_t bitValue) { const uint8_t dataPos = NUMPIXELS; uint32_t data; boolean
in „Arduino->WS2812B-> Arduino“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
29_jan_BME280_Forum.ino
/*************************************************************************** This is a library for the BME280 humidity, temperature & pressure sensor Designed specifically to work with the Adafruit BME280 Breakout ----> http://www.adafruit.com/products/2650 These sensors use I2C or SPI to communicate, 2 or 4 pins are required to interface. The device's I2C address is either 0x76 or 0x77. Adafruit invests time and resources providing this open source code, please support Adafruit andopen-source hardware by purchasing products from Adafruit! Written by Limor Fried & Kevin Townsend for Adafruit Industries
in „Arduino SD und BME280“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
0001_Datalogger_mit_BME280_test.ino
/* SD card datalogger This example shows how to log data from three analog sensors to an SD card using the SD library. The circuit: analog sensors on analog ins 0, 1, and 2 SD card attached to SPI bus as follows: ** MOSI - pin 11 ** MISO - pin 12 ** CLK - pin 13 ** CS - pin 4 (for MKRZero SD: SDCARD_SS_PIN) created 24 Nov 2010 modified 9 Apr 2012 by Tom Igoe This example code is in the public domain. */ #include <SPI.h> #include <SD.h> #include <Wire.h> // eingefügt #include"cactus_io_BME280_I2C.h" // "" BME280_I2C bme(0x76); // "" I2C adr 0x76 const int chipSelect = 5; void setup() { // Open serial
in „Arduino SD und BME280“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
0001_Datalogger_mit_BME280_test.ino
#include <SPI.h> #include <SD.h> #include <Wire.h> // eingefügt #include"cactus_io_BME280_I2C.h" // "" BME280_I2C bme(0x76); // "" I2C adr 0x76 const int chipSelect = 5; void setup() { Serial.begin(9600); } void loop() { bme.readSensor(); // eingefügt Serial.println("Luftdruck "); Serial.print(bme.getPressure_MB()); // Serial.print(bme.readPressure_MB()); delay(1000); // eingefügt }
in „Arduino SD und BME280“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
retriggerbares_monoflop_basis_blinkwithoutdelay_001.ino
/* Der Scetch blinkwithoutdelay ist so umgebaut, dass die LED * mit einem Schalter ein- und ausgeschaltet werden kann. * Dabei lassen sich die Einschaltverzögerung intervalb, * und die Ausschaltverzögerung intervala, separat einstellen. * Der Schalter schaltet Pin2 über 2K2_Ohm nach GND. * Die gelbe LED zeigt die Stellung des Schalters an. * Sie liegt über 1K2_Ohm zwischen Pin11 und GND. * Die grüne LED liegt über 1K2_Ohm zwischen Pin10 und GND. * Sie schaltet 500ms verzögert ein und 4s verzögert aus. */ int schalter = 2; // Schalter liegt an Pin2 int s; // Schalterstellung, int weil es ein HIGH
in „Arduino UNO retriggerbares Monoflop if while“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
sketch_jan22a1.ino
// sketch_jan22a1 // http://www.mikrocontroller.net/topic/387132#new // Arduino DS18S20 geziehlt auslesen! // // Weil mich das auch interessiert hat, habe ich es, so gelöst. // Nur die Temperatur Auswertung. Soweit wie moeglich deine Code gelassen. // #include <OneWire.h> #include <DallasTemperature.h> #define ONE_WIRE_BUS 2 #define RESOLUTION 10 OneWire oneWire(ONE_WIRE_BUS); DallasTemperature sensors(&oneWire); // Meine Sensoren DeviceAddress sensor1 = { 0x28, 0xFF, 0x1C, 0xFC, 0x4C, 0x04, 0x00, 0xC7 }; DeviceAddress sensor2 = { 0x28, 0xFF, 0x25, 0xE9, 0x4E, 0x04, 0x00, 0x46 }; /* Die Sensoren
in „Arduino DS18S20 geziehlt auslesen!“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
sketch_jan22a11.ino
// sketch_jan22a1 // http://www.mikrocontroller.net/topic/387132#new // Arduino DS18S20 geziehlt auslesen! // // Weil mich das auch interessiert hat, habe ich es, so gelöst. // Nur die Temperatur Auswertung. Soweit wie moeglich deine Code gelassen. // #include <OneWire.h> #include <DallasTemperature.h> #define ONE_WIRE_BUS 2 #define RESOLUTION 10 OneWire oneWire(ONE_WIRE_BUS); DallasTemperature sensors(&oneWire); // Meine Sensoren DeviceAddress sensor1 = { 0x28, 0xFF, 0x1C, 0xFC, 0x4C, 0x04, 0x00, 0xC7 }; DeviceAddress sensor2 = { 0x28, 0xFF, 0x25, 0xE9, 0x4E, 0x04, 0x00, 0x46 }; /* Die Sensoren
in „Arduino DS18S20 geziehlt auslesen!“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Temperatur5_2Sensoren3.ino
#include <OneWire.h> #include <DallasTemperature.h> #include <SPI.h> #include <SD.h> File myFile; #define ONE_WIRE_BUS 3 OneWire oneWire(ONE_WIRE_BUS); DallasTemperature sensors(&oneWire); #include <LiquidCrystal.h> LiquidCrystal lcd(4, 5, 6, 7, 8, 9); #define Pumpe_AN 0 #define Pumpe_LED 10 #define Einstellung 1 /********************************************************************************/ //DeviceAdressen der einzelnen ds1820 Temperatursensoren angeben. (loop anpassen) //DeviceAddress sensorA = { 0x28, 0xF8, 0x1F, 0xD0, 0x5, 0x0, 0x0, 0xEA }; //DeviceAddress sensorI = { 0x28, 0x6B, 0x8E,
in „Input gibt high aus obwohl nicht geschaltet“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
p12_KnockLockRhy_Zwischen.ino
/* Detects patterns of knocks and triggers a motor to unlock it if the pattern is correct. Drei Probleme: - Kriechstrom am Servo? er ruckelt stndig, was der Piezo als Klopfzeichen missdeutet - Piezo/Servo funktinieren nur, wenn ich 5V verwende, nicht bei 3.3 V, nicht bei V in - Nur noch Durcheinander, wenn ich externe Stromversorgung verwende 12.0V 1500mA. - > Ohne Widerstand (zZt 1.1 KOhm) vor dem ServoPIN ist nur Geflacker. By Steve Hoefer http://grathio.com Version 0.1.10.20.10 Licensed under Creative Commons Attribution-Noncommercial-Share Alike 3.0 http://creativecommons.org/licenses/by-nc-sa
in „Arduino UNO - Klopfzeichen-Schaltung funktioniert nicht“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
ESP8266_WiFiClient.ino
#include <ESP8266WiFi.h> #include <lwip/icmp.h> #include <lwip/raw.h> const char* ssid = "x"; const char* password = "y"; u8_t packedReceived(NULL, raw_pcb * pcb, pbuf * packetBuffer, const ip_addr_t * addr) { Serial.println("packedReceived Funktionsaufruf"); return 0; } void setup() { Serial.begin(115200); delay(10); // We start by connecting to a WiFi network Serial.println(); Serial.println(); Serial.print("Connecting to "); Serial.println(ssid); /* Explicitly set the ESP8266 to be a WiFi-client, otherwise, it by default, would try to act as both a client and an access-point and could cause
in „Wie kann man mit ESP8266/ArduinoIDE auf IP-Pakete zugreifen?“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
ESP8266_WiFiClient.ino
#include <ESP8266WiFi.h> #include <lwip/icmp.h> #include <lwip/raw.h> const char* ssid = "x"; const char* password = "y"; u8_t packedReceived(void* arg, raw_pcb * pcb, pbuf * packetBuffer, const ip_addr_t * addr){ Serial.println("packedReceived Funktionsaufruf"); return 0; } void setup() { Serial.begin(115200); delay(10); // We start by connecting to a WiFi network Serial.println(); Serial.println(); Serial.print("Connecting to "); Serial.println(ssid); /* Explicitly set the ESP8266 to be a WiFi-client, otherwise, it by default, would try to act as both a client and an access-point and could cause
in „Wie kann man mit ESP8266/ArduinoIDE auf IP-Pakete zugreifen?“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
FlankenErkennenUndZaehlenPortD.ino
#include <CombiePin.h> #include <CombieTimer.h> #include <CombieTools.h> using Combie::Tools::FlankenErkennung; using Combie::Timer::EntprellTimer; // DDRB &= ~(1<<taster); PB1 ist Arduino Uno Pin 9 using EingabeTaster = Combie::Pin::TasterGND<9>; // Taster zwischen Pin und GND(invertierend) using Counter = Combie::Tools::Counter<uint8_t>; EingabeTaster taster; EntprellTimer entprellen(20); FlankenErkennung flankenerkennung; Counter counter; void setup() { Serial.begin(9600); taster.initPullup(); DDRD = 0xff; } void loop() { PORTD = counter = flankenerkennung = entprellen = taster; }
in „delay Funktion mit IRS ersetzen“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
DS18x20_Temperature.ino
#include <OneWire.h> // OneWire DS18S20, DS18B20, DS1822 Temperature Example // // http://www.pjrc.com/teensy/td_libs_OneWire.html // // The DallasTemperature library can do all this work for you! // https://github.com/milesburton/Arduino-Temperature-Control-Library OneWire ds(10); // on pin 10 (a 4.7K resistor is necessary) void setup(void) { Serial.begin(9600); } void loop(void) { byte i; byte present = 0; byte type_s; byte data[12]; byte addr[8]; float celsius, fahrenheit; if ( !ds.search(addr)) { Serial.println("No more addresses."); Serial.println(); ds.reset_search(); delay(250); return; }
in „DS18B20 Verkabelungs od Software Problem“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
I2C_Array_Test.ino
#include <Wire.h> int red, green, blue; void setup(){ Serial.begin(112500); Wire.begin(); } int Array[10] = { 255, 0, 0, 0, 255, 0, 0, 0, 0, 255 }; int start = -1; void Update(){ Wire.beginTransmission(8); Wire.write(reinterpret_cast<byte*>(Array),sizeof(Array)); Wire.endTransmission(); } void loop(){ Update(); delay(500); }
in „Wie kann ich ein Array über I2C übertragen?“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
I2C_Array_Test.ino
#include <Wire.h> int red, green, blue; void setup(){ Serial.begin(112500); Wire.begin(); } byte Array[20] = { 255, 0, 0, 0, 255, 0, 0, 0, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0 }; void Update(){ Wire.beginTransmission(8); Wire.write(reinterpret_cast<byte*>(Array),sizeof(Array)); Wire.endTransmission(); } void loop(){ Update(); delay(500); }
in „Wie kann ich ein Array über I2C übertragen?“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
AquaDosierung_V1_2.ino
/*----------[ Dosierpumpe Version 4.12 )---------- Softwareversion 9.12 | Copyright 2016 By Stefan Schepperle stefan@schepperle.info -----------[ ATMega 328 [Arduino] )----------*/ /*-----[ Bibliotheken einlesen )-----*/ #include <DS3232RTC.h> #include <Time.h> #include <EEPROM.h> #include <Wire.h> #define ADDR_RTCDS3231 0x68 #include <LCD.h> #include <LiquidCrystal.h> #include <LiquidCrystal_I2C.h> //LiquidCrystal_I2C lcd(0x3f, 20, 4); // set the LCD address to 0x27 for a 20 chars and 4 line display LiquidCrystal_I2C lcd(0x3f, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); // Set the LCD I2C address byte
in „Arduino LCD Backlight auto off“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
EmonLib_Cpp_comment.txt.ino
/* Emon.cpp - Library for openenergymonitor Created by Trystan Lea, April 27 2010 GNU GPL modified to use up to 12 bits ADC resolution (ex. Arduino Due) by boredman@boredomprojects.net 26.12.2013 Low Pass filter for offset removal replaces HP filter 1/1/2015 - RW */ // Proboscide99 10/08/2016 - Added ADMUX settings for ATmega1284 e 1284P (644 / 644P also, but not tested) in readVcc function //#include "WProgram.h" un-comment for use on older versions of Arduino IDE #include "EmonLib.h" #if defined(ARDUINO) && ARDUINO >= 100 #include "Arduino.h" #else #include "WProgram.h" #endif //-------------
in „ESP32: Konstante Abtastrate / Timing des ADC“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
AVR-ENC-MQTT-FOST02.ino
#include <UIPEthernet.h> #include <PubSubClient.h> #include <SHT1x.h> //#define DEBUG // Specify data and clock connections and instantiate SHT1x object #define dataPin A4 #define clockPin A5 long starttime = 0; long waittime = 120000; // Update these with values suitable for your network. byte mac[] = { 0xDE, 0xED, 0xBA, 0xFE, 0xFE, 0xED }; byte server[] = { 192, 168, 0, 99 }; byte ip[] = { 192, 168, 0, 200 }; void callback(char* topic, byte* payload, unsigned int length); #define dataPin A4 #define clockPin A5 SHT1x sht1x(dataPin, clockPin); EthernetClient ethClient; PubSubClient mqtt_client
in „AVR-LAN-Sensor“ · Projekte & Code ·
-
Datei
ArduinoUno_nrf_testSender.ino
// library used: // https://github.com/maniacbug/RF24 #include <SPI.h> #include "RF24.h" #define NRF_CE 7 #define NRF_CSN 8 RF24 radio(NRF_CE, NRF_CSN); /**********************************************************/ byte addresses[][6] = {"1Node", "2Node"}; void setup() { Serial.begin(115200); Serial.println("start up"); radio.begin(); if (radio.isChipConnected())Serial.println("nRF chip found, very good!"); else { while (1) { Serial.println("chip not found"); delay(1000); } } // Set the PA Level low to prevent power supply related issues since this is a // getting_started sketch, and the likelihood of
in „nRf24 Analyse“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
SerialParserWithoutSavingInput.ino
#define DEF_COMMAND( x ) void command_ ## x (void) #define COMMAND( x ) {#x,sizeof(#x)-1,&command_ ## x} #define COMMAND_COUNT ( sizeof(commands) / sizeof(const struct cmd) ) struct cmd { const char* name; const unsigned length; void(*func)(void); }; DEF_COMMAND(xyz); DEF_COMMAND(abcdef); DEF_COMMAND(abc); /* !!! Die Liste muss nach ascii wert sortiert sein, also Alphabetisch !!! */ const struct cmd commands[] = { COMMAND(abc), COMMAND(abcdef), COMMAND(xyz) }; void invalidInputFunc(){ Serial.print("garbage recived, do something useful...\n"); } void interpretCommand(const char c){ static unsigned
in „Arduino Serial ganze wörter abfragen“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
stepper_oneStepAtATime.ino
/* Stepper Motor Control - one step at a time This program drives a unipolar or bipolar stepper motor. The motor is attached to digital pins 8 - 11 of the Arduino. The motor will step one step at a time, very slowly. You can use this to test that you've got the four wires of your stepper wired to the correct pins. If wired correctly, all steps should be in the same direction. Use this also to count the number of steps per revolution of your motor, if you don't know it. Then plug that number into the oneRevolution example to see if you got it right. Created 30 Nov. 2009 by Tom Igoe */ #include <
in „Frage zu Arduino Library?“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
pt2322ExampleWithControls.ino
#include <Wire.h> #include <PT2322.h> #include <LiquidCrystal.h> #define FUNCTIONPIN 6 #define UPPIN 7 #define DOWNPIN 8 #define MUTEPIN 9 #define DISPLAYMODE 0 #define EDITINGMODE 1 PT2322 audio; // initialize the library with the numbers of the interface pins LiquidCrystal lcd(12, 11, 5, 4, 3, 2); // enumerate PT2322 functions enum function {FMasterVolume, FFrontLeftVolume, FFrontRightVolume, FCenterVolume, FRearLeftVolume, FRearRightVolume, FSubVolume, FBass, FMiddle, FTreble, F3D, FToneDefeat, FEnd}; // default values as initialized by PT3222 library - order as per above enum int functionValues
in „Library übersetzen, wie?“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
ILI9341_template_BluePill.ino
/************************************************************************ ILI9341 TFT example template Required libraries: GFX, Adafruit Installation Instructions: 1. Import the Adadruit library in the menue Sketch=>Include Libraries=>Manage Libraries => Adafruit ILI9341 2. Import the Adadruit GFX-Library Sketch=>Include Libraries=>Manage Libraries => Adafruit GFX Library May 2017, ChrisMicro ************************************************************************/ /* STM32F103 BluePill */ #include "SPI.h" #include "Adafruit_GFX.h" #include "Adafruit_ILI9341.h" // TFT 9341 // 2.4" SPI TFT LCD Display
in „TFT mit ILI9341“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
ILI9340C_analogGraph.ino
/************************************************************************ 2.2' TFT Demonstration Mini-Oszi: Display analog input like a oscilloscope TFT used ILI9340C libraries used ============== Arduino Due library for interfacing with ILI9341 SPI TFTs ( ultra fast DMA ) http://marekburiak.github.io/ILI9341_due/ Written by a MC-Net User 2016 license: free beer license ************************************************************************/ #include <SPI.h> #include "ILI9341_due_config.h" #include "ILI9341_due.h" #include "SystemFont5x7.h" // For the Adafruit shield, these are the default. #define
in „2.2'TFT ILI9340 und Arduino“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
PixelPipe_v0.5.ino
/* PixelPipe v0.5 * 07.09.2016 * Arduino UNO */ /* * OLED 128x32 * 5V->5V, GND->GND, SDA->A4(SDA), SCL->A5(SCL) * Joysick 4duino (2 Potentiometer, 1 Button) * 5V->5V, GND->GND, VRX->A0, VRY->A1, SW->2 mit PULL-UP */ #include <Adafruit_SSD1306.h> #include <Adafruit_GFX.h> #include <SPI.h> #include <Wire.h> #define OLED_RESET 4 //Settings // actual pipe speed = PIPESPEED * REFRESH_MS #define PIPESPEED 2 #define REFRESH_MS 50 #define STATE_START 0 #define STATE_START_PRESS_BUTTON 1 #define STATE_PLAY 2 #define STATE_LOOSE 3 #define STATE_RESET_PRESS_BUTTON 4 Adafruit_SSD1306 display(OLED_RESET); int x_in
in „PixelPipe_Game Arduino UNO mit OLED Display und Joystick“ · Projekte & Code ·
-
Datei
IL9340C_matrixRain.ino
/************************************************************************ 2.2' TFT Demonstration: The Matrix Rain Screen Saver QBasic Code from http://codegolf.stackexchange.com/questions/17285/make-the-matrix-digital-rain-using-the-shortest-amount-of-code TFT used: ILI9340C libraries used: https://github.com/adafruit/Adafruit_ILI9340 https://github.com/adafruit/Adafruit-GFX-Library Written by a MC-Net User 2016 license: free beer license recomended music while programming: https://www.youtube.com/watch?v=iCBL33NKvPA ************************************************************************/ #include
in „2.2'TFT ILI9340 und Arduino“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
ESP_Webserver_HTTP11_Original_.ino
/*-------------------------------------------------- HTTP 1.1 Webserver for ESP8266 for ESP8266 adapted Arduino IDE Stefan Thesen 04/2015 Running stable for days (in difference to all samples I tried) Does HTTP 1.1 with defined connection closing. Reconnects in case of lost WiFi. Handles empty requests in a defined manner. Handle requests for non-exisiting pages correctly. This demo allows to switch two functions: Function 1 creates serial output and toggels GPIO2 Function 2 just creates serial output. Serial output can e.g. be used to steer an attached Arduino, Raspberry etc. -------------------
in „esp8266 - Farbdarstellung“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
DS18x20_Temperature.ino
#include <OneWire.h> // OneWire DS18S20, DS18B20, DS1822 Temperature Example // // http://www.pjrc.com/teensy/td_libs_OneWire.html // // The DallasTemperature library can do all this work for you! // http://milesburton.com/Dallas_Temperature_Control_Library OneWire ds(10); // on pin 10 (a 4.7K resistor is necessary) void setup(void) { Serial.begin(9600); } void loop(void) { byte i; byte present = 0; byte type_s; byte data[12]; byte addr[8]; float celsius, fahrenheit; if ( !ds.search(addr)) { Serial.println("No more addresses."); Serial.println(); ds.reset_search(); delay(250); return; } Serial.print
in „DS18B20 an Arduino“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
Arduino_Ultraschall_3D_Scan.ino
// ========================================================================= // ====== Programm zur Erstellung eines 3D-Scans mittels Ultraschall ======= // ========================================================================= #include <Servo.h> // Inkludiert die Servodateien #include <i2cmaster.h> // Inkludiert die i2c-Bus-Dateien #define TRIGPIN 3 // Pin to send trigger pulse #define ECHOPIN 4 // Pin to receive echo pulse Servo servo_horiz; // Definiert den horizontalen servo Servo servo_verti; // Definiert den vertikalen servo int taste; // Tastaturpin für Start des Scans int winkel_horiz
in „Experimente mit Arduino und Ultraschall“ · Projekte & Code ·
-
Datei
I2C2_BME.ino
//#include <Wire.h> //TwoWire myWire1 (1, I2C_FAST_MODE); // to use the I2C 1 //TwoWire myWire2 (2, I2C_FAST_MODE); // to use the I2C 2 #include <Wire_slave.h> #include <Adafruit_Sensor.h> #include "Adafruit_BME680.h" #define SEALEVELPRESSURE_HPA (1013.25) Adafruit_BME680 bme; // I2C void setup() { Serial.begin(115200); delay(2000); Wire.begin(); delay(10); Wire1.begin(8); Wire1.onRequest(requestEvent); // register event Wire1.onReceive(receiveEvent); // register event delay(10); Serial.print("init BME280..."); if (!bme.begin(0x76)) { Serial.println("Could not find a valid BME680 sensor, check
in „STM32 I2C2 & BME680 Probleme“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
t4-audio-adc-dma.ino
#include <ADC.h> #include <AnalogBufferDMA.h> //#define DUMPCHUNK static const char SW[] = __FILE__ "," __DATE__ " " __TIME__; const uint8_t ADC_PIN = A2; const uint16_t ADC_MIDPOINT = 127; ADC adc; const uint16_t AVSIZE = 128; DMAMEM static volatile uint16_t __attribute__((aligned(32))) av1[AVSIZE], av2[AVSIZE]; AnalogBufferDMA abdma(av1,AVSIZE,av2,AVSIZE); const float GOER_FREQ = 7930.0; const float GOER_RATE = GOER_FREQ*4.0; float coef = 2.0*cos(2.0*PI*GOER_FREQ/GOER_RATE); void setup() { Serial.begin(115200); while (!Serial && millis() < 5000) continue; const char* sw = SW; for (const char
in „Bestimmtes Geräusch erkennen“ · Analoge Elektronik und Schaltungstechnik ·
-
Datei
Laufschrift_04_Test_Fehler_Reset.ino
/****************************************** * 0.96" Display (160x80px) ansteuern * Controller: ST7735S * 13pol. PFC 0.8mm Display Typ: RFA300960A-AYW-DNN * 8pol. PFC 0.5mm * * Einstellungen IDE: Board: "Arduino Pro or Pro Mini" * Processor: "ATmega328P (5V, 16MHz)" * Programmer: "AVRISP mkII" * * Einstellungen serielle Schnittstelle: 9600 Baud, 8N1 * * Anschluss: * D8: -> RS * D9: -> RST * D10: SS -> CS * D11: MOSI -> SDA * D13: SCK -> SCL * * PFC: Display Anschlüsse: * 1 SPI4W SPI4W=’0’, 3-wire SPI. SPI4W=’1’, 4-wire SPI. * 2 NC No connection * 5 3 SDA Serial interface data * 6 4 SCL Serial interface clock
in „ATmega328P resettet bei I/O Zugriff“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
SwitchBoxMotherboard_328PB.ino
#define SCLK PIN_PC1 // connected to SRCLK orange #define LATCH PIN_PB2 // connected to RCLK white #define MOSI PIN_PE3 // connected to SER green #define MISO PIN_PC0 // connected to last Q7S blue const uint8_t shiftregistercount = 4; //actual number of 8-channel shiftregisters const uint8_t channelcount = 18; //max shiftregistercount*8 const uint8_t channelassignment[channelcount] = { //starting from 0, max shiftregistercount*8-1 18, 19, 20, 21, 22, 23, 24, 25, 26, 13, 12, 11, 10, 9, 8, 7, 6, 5 }; uint8_t outputdata[shiftregistercount]; uint8_t routputdata[shiftregistercount]; uint8_t allon[shiftregistercount
in „Universeller Schieberegister-Controller“ · Projekte & Code ·
-
Datei
FastPWM-Mode_15_Code_Alles.ino
//////////////////////////////////////////////////////////////////////////////// // Ein Schrittmotor wird fortlaufend beschleunigt und abgebremst. // Es wird eine Anzahl von Schritten vorgefahren und sofort zurueck. // Danach bleibt der SM fuer ca. 1,5 Sekunde stehen und das Spiel wiederholt sich. // Im FastPWM-Mode 15 wird eine maximale Frequenz von ca. x kHz erreicht. // //#include "Define.h" #define SM_RICHTUNG_DDR DDRK #define SM_RICHTUNG_PORT PORTK #define SM_RICHTUNG_PIN PINK #define SM_RICHTUNG ( 1<<PK0 ) // 62 #define SM_DREHEN_STOP ( 1<<PK1 ) // Schrittmotor Drehen stoppen #define SM_SPEED_RANGE
in „Fragen zu schrittmotor Treiber“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
pt1000_rp2040_neu.ino
/* Alle Angaben ohne Gewaehr ! 2023-11-04 */ #define OFFSET 13 // 0-Offset des ADCs, Anpassung notwendig #define DEF_BAUDRATE 19200 #define ADC_MIN 0 #define ADC_MAX (4095 - OFFSET) // bei 12 Bit #define PT_IN_0 26 // analog Eingang A0 #define UNTERLAUF -99 // Fehler, auch bei Kurzschluss #define UEBERLAUF 999 // Fehler, auch bei offenem Eingang #define R_PT0 1000.0 // bei 0 Grad C #define R_REF 1200.0 // ext. Widerstand mit 0,1% #define R_ZULEITUNG 0 // bei laengeren Leitungen unbedingt anpassen #define PT_FAKTOR 3.85 // schon mit 1000.0 skaliert //#define IO_BANK0_BASE 0x40014000UL // ist auch schon
-
Datei
WS2812x300-Christmas.ino
#include <Adafruit_NeoPixel.h> #ifdef __AVR__ #include <avr/power.h> #endif // Which pin on the Arduino is connected to the NeoPixels? const uint8_t PIN = 6; // make sure to set this to the correct PixelPin, ignored for Esp8266 // How many NeoPixels are attached to the Arduino? const uint16_t NUMPIXELS = 300; // When we setup the NeoPixel library, we tell it how many pixels, and which pin to use to send signals. // Note that for older NeoPixel strips you might need to change the third parameter--see the strandtest // example for more information on possible values. Adafruit_NeoPixel pixels = Adafruit_NeoPixel
in „Zeigt her eure elektronischen Weihnachtsbasteleien!“ · Projekte & Code ·