@mfalkvidd many thanks for coming back. I think I'll keep more complex things seperate, however will explore multiple binary sensors and relays on the same node.
Thanks
@mfalkvidd many thanks for coming back. I think I'll keep more complex things seperate, however will explore multiple binary sensors and relays on the same node.
Thanks
No way - found it. Large comment at the top of sketch (not copied to this forum) had a line of *********s across the top.
Removed and all ok. Thanks for your help anyway @mfalkvidd
Does this need a resistor between the Arduino digital pin and the Gate of the MOSFET? To limit current draw?
No way - found it. Large comment at the top of sketch (not copied to this forum) had a line of *********s across the top.
Removed and all ok. Thanks for your help anyway @mfalkvidd
@mfalkvidd I had it running on a nano.
Now trying to put it in a mini pro.
However, cant get it to compile on either or an uno.
I'll re-install the IDE now and report back
@mfalkvidd just removed from the operating directory and installed via the Library Manager in the IDE - still same error.
Interestingly my RS485 Gateway sketch (Using the same library) compiles fine!
RS485GW (compiles fine)
// Enable debug prints to serial monitor
#define MY_DEBUG
// Enable RS485 transport layer
#define MY_RS485
// Define this to enables DE-pin management on defined pin
#define MY_RS485_DE_PIN 2
// Set RS485 baud rate to use
#define MY_RS485_BAUD_RATE 9600
// Enable this if RS485 is connected to a hardware serial port
//#define MY_RS485_HWSERIAL Serial1
// Enable serial gateway
#define MY_GATEWAY_SERIAL
// Enable inclusion mode
//#define MY_INCLUSION_MODE_FEATURE
// Enable Inclusion mode button on gateway
//#define MY_INCLUSION_BUTTON_FEATURE
// Set inclusion mode duration (in seconds)
//#define MY_INCLUSION_MODE_DURATION 60
// Digital pin used for inclusion mode button
//#define MY_INCLUSION_MODE_BUTTON_PIN 3
// Set blinking period
#define MY_DEFAULT_LED_BLINK_PERIOD 300
// Flash leds on rx/tx/err
#define MY_DEFAULT_ERR_LED_PIN 4 // Error led pin
#define MY_DEFAULT_RX_LED_PIN 5 // Receive led pin
#define MY_DEFAULT_TX_LED_PIN 6 // the PCB, on board LED
#include <MySensors.h>
void setup()
{
// Setup locally attached sensors
}
void presentation()
{
// Present locally attached sensors
}
void loop()
{
// Send locally attached sensor data here
}
RS485_WS2812_actuator (does not compile)
// Enable debug prints to serial monitor
#define MY_DEBUG
// Activate one of these
//#define MY_RADIO_NRF24
//#define MY_RADIO_RFM69
#define MY_RS485
#define MY_RS485_DE_PIN 2
// Set RS485 baud rate to use
#define MY_RS485_BAUD_RATE 9600
#include <MySensors.h>
#include <SPI.h>
#include <Adafruit_NeoPixel.h>
#define NUMPIXELS 58 // FIXME Number of connected pixels on a single datapin - Must be less than 500 due to RAM issues
#define PIN 4 // Digital output pin
#define MY_NODE_ID 1 // FIXME this needs to be decided and updated for this exact WS2812 node
#define CHILD_ID 0
Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
long RGB_values[3] = {0,0,0};
void presentation()
{
sendSketchInfo("RS485_WS2812_Actuator", "1.0");
present(CHILD_ID, S_RGB_LIGHT);
}
void setup()
{
Serial.begin(9600);
Serial.println("Starting");
strip.begin();
strip.show(); // Update the strip, to start they are all 'off'
}
void loop()
{
}
void receive(const MyMessage &message) {
if (message.type==V_RGB) {
// starting to process the hex code
String hexstring = message.getString(); //here goes the hex color code coming from through MySensors (like FF9A00)
long number = (long) strtol( &hexstring[0], NULL, 16);
RGB_values[0] = number >> 16;
RGB_values[1] = number >> 8 & 0xFF;
RGB_values[2] = number & 0xFF;
colorWipe(Color(RGB_values[0],RGB_values[1],RGB_values[2]), 30);
}
if (message.type==V_DIMMER) {
strip.setBrightness(round((2.55*message.getInt())));
strip.show();
}
if (message.type==V_LIGHT) {
if (message.getInt() == 0) {
strip.clear();
strip.show();
}
}
}
void colorWipe(uint32_t c, uint8_t wait) {
int i;
for (i=0; i < strip.numPixels(); i++) {
strip.setPixelColor(i, c);
strip.show();
delay(wait);
}
}
/* Helper functions */
// Create a 15 bit color value from R,G,B
uint32_t Color(byte r, byte g, byte b)
{
uint32_t c;
c = r;
c <<= 8;
c |= g;
c <<= 8;
c |= b;
return c;
}
Good morning @mfalkvidd
I've not made amendements, I've tried to upload here, however received an error message with a 100% uploading. The library is 2.3.2 downlaoded from github.
[0_1608024751465_MyConfig.h](Uploading 100%)
@mfalkvidd many thanks for coming back. I think I'll keep more complex things seperate, however will explore multiple binary sensors and relays on the same node.
Thanks
Hi, So I had this 'WS2812 actuator' sketch running on a Nano with a nrf24 radio and I'm not converting it to run in a rs485 network. However I encounter the following when I try and compile it. I've uninstalled and re-installed the library, both via the IDE and directly downloading from github - to no avail
Arduino: 1.8.13 (Windows 10), Board: "Arduino Pro or Pro Mini, ATmega328P (5V, 16 MHz)"
C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\z003rtbs\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\z003rtbs\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\UserData\z003rtbs\OneDrive - Siemens AG\Documents\Arduino\libraries -fqbn=arduino:avr:pro:cpu=16MHzatmega328 -ide-version=10813 -build-path C:\Users\z003rtbs\AppData\Local\Temp\arduino_build_449327 -warnings=none -build-cache C:\Users\z003rtbs\AppData\Local\Temp\arduino_cache_80315 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=C:\Users\z003rtbs\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.3.0 -prefs=runtime.tools.arduinoOTA-1.3.0.path=C:\Users\z003rtbs\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.3.0 -prefs=runtime.tools.avr-gcc.path=C:\Users\z003rtbs\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=C:\Users\z003rtbs\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -prefs=runtime.tools.avrdude.path=C:\Users\z003rtbs\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17 -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=C:\Users\z003rtbs\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17 -verbose C:\Users\z003rtbs\Nextcloud\Projects\Van\OpenHab\MySensors\RS485_WS2812_Actuator\RS485_WS2812_Actuator.ino
C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\z003rtbs\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\z003rtbs\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\UserData\z003rtbs\OneDrive - Siemens AG\Documents\Arduino\libraries -fqbn=arduino:avr:pro:cpu=16MHzatmega328 -ide-version=10813 -build-path C:\Users\z003rtbs\AppData\Local\Temp\arduino_build_449327 -warnings=none -build-cache C:\Users\z003rtbs\AppData\Local\Temp\arduino_cache_80315 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=C:\Users\z003rtbs\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.3.0 -prefs=runtime.tools.arduinoOTA-1.3.0.path=C:\Users\z003rtbs\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.3.0 -prefs=runtime.tools.avr-gcc.path=C:\Users\z003rtbs\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=C:\Users\z003rtbs\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -prefs=runtime.tools.avrdude.path=C:\Users\z003rtbs\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17 -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=C:\Users\z003rtbs\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17 -verbose C:\Users\z003rtbs\Nextcloud\Projects\Van\OpenHab\MySensors\RS485_WS2812_Actuator\RS485_WS2812_Actuator.ino
Using board 'pro' from platform in folder: C:\Users\z003rtbs\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.3
Using core 'arduino' from platform in folder: C:\Users\z003rtbs\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.3
Detecting libraries used...
"C:\\Users\\z003rtbs\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_PRO -DARDUINO_ARCH_AVR "-IC:\\Users\\z003rtbs\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.3\\cores\\arduino" "-IC:\\Users\\z003rtbs\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.3\\variants\\eightanaloginputs" "C:\\Users\\z003rtbs\\AppData\\Local\\Temp\\arduino_build_449327\\sketch\\RS485_WS2812_Actuator.ino.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE
Alternatives for MySensors.h: [MySensors-master@2.3.2]
ResolveLibrary(MySensors.h)
-> candidates: [MySensors-master@2.3.2]
"C:\\Users\\z003rtbs\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_PRO -DARDUINO_ARCH_AVR "-IC:\\Users\\z003rtbs\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.3\\cores\\arduino" "-IC:\\Users\\z003rtbs\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.3\\variants\\eightanaloginputs" "-IC:\\UserData\\z003rtbs\\OneDrive - Siemens AG\\Documents\\Arduino\\libraries\\MySensors-master" "C:\\Users\\z003rtbs\\AppData\\Local\\Temp\\arduino_build_449327\\sketch\\RS485_WS2812_Actuator.ino.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE
Alternatives for SPI.h: [SPI@1.0]
ResolveLibrary(SPI.h)
-> candidates: [SPI@1.0]
"C:\\Users\\z003rtbs\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_PRO -DARDUINO_ARCH_AVR "-IC:\\Users\\z003rtbs\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.3\\cores\\arduino" "-IC:\\Users\\z003rtbs\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.3\\variants\\eightanaloginputs" "-IC:\\UserData\\z003rtbs\\OneDrive - Siemens AG\\Documents\\Arduino\\libraries\\MySensors-master" "-IC:\\Users\\z003rtbs\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.3\\libraries\\SPI\\src" "C:\\Users\\z003rtbs\\AppData\\Local\\Temp\\arduino_build_449327\\sketch\\RS485_WS2812_Actuator.ino.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE
Alternatives for Adafruit_NeoPixel.h: [Adafruit_NeoPixel@1.7.0]
ResolveLibrary(Adafruit_NeoPixel.h)
-> candidates: [Adafruit_NeoPixel@1.7.0]
"C:\\Users\\z003rtbs\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_PRO -DARDUINO_ARCH_AVR "-IC:\\Users\\z003rtbs\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.3\\cores\\arduino" "-IC:\\Users\\z003rtbs\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.3\\variants\\eightanaloginputs" "-IC:\\UserData\\z003rtbs\\OneDrive - Siemens AG\\Documents\\Arduino\\libraries\\MySensors-master" "-IC:\\Users\\z003rtbs\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.3\\libraries\\SPI\\src" "-IC:\\UserData\\z003rtbs\\OneDrive - Siemens AG\\Documents\\Arduino\\libraries\\Adafruit_NeoPixel" "C:\\Users\\z003rtbs\\AppData\\Local\\Temp\\arduino_build_449327\\sketch\\RS485_WS2812_Actuator.ino.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE
"C:\\Users\\z003rtbs\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_PRO -DARDUINO_ARCH_AVR "-IC:\\Users\\z003rtbs\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.3\\cores\\arduino" "-IC:\\Users\\z003rtbs\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.3\\variants\\eightanaloginputs" "-IC:\\UserData\\z003rtbs\\OneDrive - Siemens AG\\Documents\\Arduino\\libraries\\MySensors-master" "-IC:\\Users\\z003rtbs\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.3\\libraries\\SPI\\src" "-IC:\\UserData\\z003rtbs\\OneDrive - Siemens AG\\Documents\\Arduino\\libraries\\Adafruit_NeoPixel" "C:\\UserData\\z003rtbs\\OneDrive - Siemens AG\\Documents\\Arduino\\libraries\\MySensors-master\\MyASM.S" -o nul -DARDUINO_LIB_DISCOVERY_PHASE
"C:\\Users\\z003rtbs\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_PRO -DARDUINO_ARCH_AVR "-IC:\\Users\\z003rtbs\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.3\\cores\\arduino" "-IC:\\Users\\z003rtbs\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.3\\variants\\eightanaloginputs" "-IC:\\UserData\\z003rtbs\\OneDrive - Siemens AG\\Documents\\Arduino\\libraries\\MySensors-master" "-IC:\\Users\\z003rtbs\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.3\\libraries\\SPI\\src" "-IC:\\UserData\\z003rtbs\\OneDrive - Siemens AG\\Documents\\Arduino\\libraries\\Adafruit_NeoPixel" "C:\\Users\\z003rtbs\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.3\\libraries\\SPI\\src\\SPI.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE
"C:\\Users\\z003rtbs\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_PRO -DARDUINO_ARCH_AVR "-IC:\\Users\\z003rtbs\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.3\\cores\\arduino" "-IC:\\Users\\z003rtbs\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.3\\variants\\eightanaloginputs" "-IC:\\UserData\\z003rtbs\\OneDrive - Siemens AG\\Documents\\Arduino\\libraries\\MySensors-master" "-IC:\\Users\\z003rtbs\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.3\\libraries\\SPI\\src" "-IC:\\UserData\\z003rtbs\\OneDrive - Siemens AG\\Documents\\Arduino\\libraries\\Adafruit_NeoPixel" "C:\\UserData\\z003rtbs\\OneDrive - Siemens AG\\Documents\\Arduino\\libraries\\Adafruit_NeoPixel\\Adafruit_NeoPixel.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE
"C:\\Users\\z003rtbs\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_PRO -DARDUINO_ARCH_AVR "-IC:\\Users\\z003rtbs\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.3\\cores\\arduino" "-IC:\\Users\\z003rtbs\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.3\\variants\\eightanaloginputs" "-IC:\\UserData\\z003rtbs\\OneDrive - Siemens AG\\Documents\\Arduino\\libraries\\MySensors-master" "-IC:\\Users\\z003rtbs\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.3\\libraries\\SPI\\src" "-IC:\\UserData\\z003rtbs\\OneDrive - Siemens AG\\Documents\\Arduino\\libraries\\Adafruit_NeoPixel" "C:\\UserData\\z003rtbs\\OneDrive - Siemens AG\\Documents\\Arduino\\libraries\\Adafruit_NeoPixel\\esp.c" -o nul -DARDUINO_LIB_DISCOVERY_PHASE
"C:\\Users\\z003rtbs\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_PRO -DARDUINO_ARCH_AVR "-IC:\\Users\\z003rtbs\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.3\\cores\\arduino" "-IC:\\Users\\z003rtbs\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.3\\variants\\eightanaloginputs" "-IC:\\UserData\\z003rtbs\\OneDrive - Siemens AG\\Documents\\Arduino\\libraries\\MySensors-master" "-IC:\\Users\\z003rtbs\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.3\\libraries\\SPI\\src" "-IC:\\UserData\\z003rtbs\\OneDrive - Siemens AG\\Documents\\Arduino\\libraries\\Adafruit_NeoPixel" "C:\\UserData\\z003rtbs\\OneDrive - Siemens AG\\Documents\\Arduino\\libraries\\Adafruit_NeoPixel\\esp8266.c" -o nul -DARDUINO_LIB_DISCOVERY_PHASE
"C:\\Users\\z003rtbs\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_PRO -DARDUINO_ARCH_AVR "-IC:\\Users\\z003rtbs\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.3\\cores\\arduino" "-IC:\\Users\\z003rtbs\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.3\\variants\\eightanaloginputs" "-IC:\\UserData\\z003rtbs\\OneDrive - Siemens AG\\Documents\\Arduino\\libraries\\MySensors-master" "-IC:\\Users\\z003rtbs\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.3\\libraries\\SPI\\src" "-IC:\\UserData\\z003rtbs\\OneDrive - Siemens AG\\Documents\\Arduino\\libraries\\Adafruit_NeoPixel" "C:\\UserData\\z003rtbs\\OneDrive - Siemens AG\\Documents\\Arduino\\libraries\\Adafruit_NeoPixel\\kendyte_k210.c" -o nul -DARDUINO_LIB_DISCOVERY_PHASE
Generating function prototypes...
"C:\\Users\\z003rtbs\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_PRO -DARDUINO_ARCH_AVR "-IC:\\Users\\z003rtbs\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.3\\cores\\arduino" "-IC:\\Users\\z003rtbs\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.3\\variants\\eightanaloginputs" "-IC:\\UserData\\z003rtbs\\OneDrive - Siemens AG\\Documents\\Arduino\\libraries\\MySensors-master" "-IC:\\Users\\z003rtbs\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.3\\libraries\\SPI\\src" "-IC:\\UserData\\z003rtbs\\OneDrive - Siemens AG\\Documents\\Arduino\\libraries\\Adafruit_NeoPixel" "C:\\Users\\z003rtbs\\AppData\\Local\\Temp\\arduino_build_449327\\sketch\\RS485_WS2812_Actuator.ino.cpp" -o "C:\\Users\\z003rtbs\\AppData\\Local\\Temp\\arduino_build_449327\\preproc\\ctags_target_for_gcc_minus_e.cpp" -DARDUINO_LIB_DISCOVERY_PHASE
"C:\\Program Files (x86)\\Arduino\\tools-builder\\ctags\\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\\Users\\z003rtbs\\AppData\\Local\\Temp\\arduino_build_449327\\preproc\\ctags_target_for_gcc_minus_e.cpp"
Compiling sketch...
"C:\\Users\\z003rtbs\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_PRO -DARDUINO_ARCH_AVR "-IC:\\Users\\z003rtbs\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.3\\cores\\arduino" "-IC:\\Users\\z003rtbs\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.3\\variants\\eightanaloginputs" "-IC:\\UserData\\z003rtbs\\OneDrive - Siemens AG\\Documents\\Arduino\\libraries\\MySensors-master" "-IC:\\Users\\z003rtbs\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.3\\libraries\\SPI\\src" "-IC:\\UserData\\z003rtbs\\OneDrive - Siemens AG\\Documents\\Arduino\\libraries\\Adafruit_NeoPixel" "C:\\Users\\z003rtbs\\AppData\\Local\\Temp\\arduino_build_449327\\sketch\\RS485_WS2812_Actuator.ino.cpp" -o "C:\\Users\\z003rtbs\\AppData\\Local\\Temp\\arduino_build_449327\\sketch\\RS485_WS2812_Actuator.ino.cpp.o"
In file included from C:\UserData\z003rtbs\OneDrive - Siemens AG\Documents\Arduino\libraries\MySensors-master/core/MyHelperFunctions.cpp:20:0,
from C:\UserData\z003rtbs\OneDrive - Siemens AG\Documents\Arduino\libraries\MySensors-master/MySensors.h:44,
from C:\Users\z003rtbs\Nextcloud\Projects\Van\OpenHab\MySensors\RS485_WS2812_Actuator\RS485_WS2812_Actuator.ino:45:
C:\UserData\z003rtbs\OneDrive - Siemens AG\Documents\Arduino\libraries\MySensors-master/core/MyHelperFunctions.h:28:1: error: expected unqualified-id before 'static'
static uint8_t convertH2I(const char c) __attribute__((unused));
^~~~~~
C:\UserData\z003rtbs\OneDrive - Siemens AG\Documents\Arduino\libraries\MySensors-master/core/MyHelperFunctions.h:28:1: error: expected constructor, destructor, or type conversion before 'static'
Using library MySensors-master at version 2.3.2 in folder: C:\UserData\z003rtbs\OneDrive - Siemens AG\Documents\Arduino\libraries\MySensors-master
Using library SPI at version 1.0 in folder: C:\Users\z003rtbs\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.3\libraries\SPI
Using library Adafruit_NeoPixel at version 1.7.0 in folder: C:\UserData\z003rtbs\OneDrive - Siemens AG\Documents\Arduino\libraries\Adafruit_NeoPixel
exit status 1
Error compiling for board Arduino Pro or Pro Mini.
Any and all help is appreciated.
Adam
I'm looking to use the examples from https://www.mysensors.org/build and combine them together in one arduino sketch so that one node can communicate a number of pieces of information back to the controller via a MAX485 module and network
I understand this is quite simple and possible with multiple, one time actions. Simply double up on the items in the code
For instance an arduino Mega:
Reading 10 button states https://www.mysensors.org/build/binary
Controlling 4 relay outputs https://www.mysensors.org/build/binary
And maybe even when a function is called periodically with a "sleep time" between reads, such as:
However, it's not clear to me if this can be done with sensors/actuators that are constantly 'working' for instance:
Controlling the brightness (via PWM) of a LED https://www.mysensors.org/build/dimmer
Controlling ws2812 LED data signal similar to https://www.domoticz.com/forum/viewtopic.php?f=42&t=8039&sid=71a5c0904f9a1662ff5447d264e6bb78
Can I amalgamate these .ino files? Am I only limited by the PWM / SPI outputs? Do I need to understand interrupts? Can a button press here go to the controller, run through an automation rule (I use Openhab) and then action a relay on the same node?
I'm drawing up some Gerber files for bespoke PCBs - the answer to the above will determine whether each function requires its own Arduino pro mini or whether I can simply have the functions ancilliary devices (relay, mosfet, 12v supply) on the pcb. I'll be sure to include the PCB somewhere for anyone else who would benefit from it.
Many thanks in advance, Adam
Hi @xydix , glad to hear you have the sketch working properly. Do you have the pinmode as OUTPUT or did you change to input?
And do you still have the saveStateL(closedPositionEE, closedPosition); line commented out?
If I change the pinMode to input, I get the system powered up and connected to the mysensors gateway fine - serial print repeats 'Button Release'. If I short press the button, the system does nothing. If I hold the button for 3000ms serial print reads 'Button Long Press' and the motor turns - however If I let go of the button, the motor stop and system returns to its 'button release' state.
I'm not able to get the system in to calibration mode.
@AWI Sorry for butting in to an old thread, but automating my blinds is top priority!
I've copied your sketch and have everything setup - however, I have eratic behaviour and a few questions:
void setup() {
// setup buttons
pinMode(buttonPin1, OUTPUT);
stepper1.setMaxSpeed(2000.0);
stepper1.setAcceleration(1000.0);
//saveStateL(closedPositionEE, closedPosition) ; // INIT: save closed position in EEPROM
closedPosition = loadStateL(closedPositionEE) ; // need to get last values from EEPROM and assume the current position is correct
setPosition = loadStateL(setPositionEE) ;
stepper1.setCurrentPosition(setPosition );
}//--(end setup )---
Should the pinMode on buttonPin1 actually be an INPUT?
Can you please describe how to go about calibrating the system?
Does the //saveStateL(closedPositionEE, closedPosition);
need uncommenting for one boot of the arduino and the blind closed - then the sketch re-uploading with it commented again?
Your help is greatly appreciated as I have a twitching motor and feel I'm almost there!