Hi,
hab ein Programm zur Rolladensteuerung geschrieben bzw. abgeschrieben. Problem ist jetzt aber, dass der Speicher nicht ausreicht auf meinem NANO.
Könnte vielleicht mal jemand drübergucken, ob man den noch irgendwie Speichertechnisch optimieren kann.
/*
Datum: März 2019
Dieser Code soll für Wandsender sein.
Arduino soll einschlafen, durch die Wippe des Lichtschalters aufgeweckt werden,
und über Näherungstaster, welche von hinten an die Abdeckung des Schalters geklebt
sind, gesteuert werden.
Transmit sketch - RF Calibration
Written by ScottC 17 July 2014
Arduino IDE version 1.0.5
Website: http://arduinobasics.blogspot.com
Transmitter: FS1000A/XY-FST
Description: A simple sketch used to calibrate RF transmission.
------------------------------------------------------------- */
/*
Generating signals to emulate a Fernotron 2411
From the original code of ScottC (see link above), transmitCode()
has been adapted to pass a signal sequence, and it uses calibrated
signal lengths instead of calling the method repeatedly with
increasing signal lengths.
Instead of toggling two states in the receiver, three buttons
(corresponding to up/stop/down) can be controlled within the sketch.
Moreover, a method has been added for the calibration of the lengths
of the generated signals.
BR March 2015
------------------------------------------------------------- */
#include <avr/sleep.h>
#define rfTransmitPin 4 //RF Transmitter pin = digital pin 4
#define ledPin 13 //Onboard LED = digital pin 13
#define interruptPin 2
#define butDownWohnzimmer 5
//#define buttonStop 6
#define butUpWohnzimmer 6
#define butDownKamin 7
#define butUpKamin 8
#define butDownEssen 9
#define butUpEssen 10
const int codeSize = 133;
unsigned long previousMillis = 0;
unsigned long interval = 20000;
boolean downstateWohnzimmer = false;
boolean upstateWohnzimmer = false;
boolean downstateKamin = false;
boolean upstateKamin = false;
boolean downstateEssen = false;
boolean upstateEssen = false;
//unsigned long verzoegerung=500;
// in case that a different number of LOW-HIGH sequences is used, codeSize has to be adapted
int StopWohnzimmer[] = {
// example for a signal code
6,
3, 3, 3, 3, 3, 3, 1, 4, 1, 2,
6,
3, 3, 3, 3, 3, 3, 1, 2, 4, 1,
5,
2, 2, 2, 2, 4, 1, 4, 3, 3, 1,
5,
2, 2, 2, 2, 4, 1,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