I'm trying to run the Digital Outputs using the M4 Core but I'm having the following error in my compilation:
Arduino: 1.8.19 (Windows 10), Board: "Arduino Portenta H7 (M4 core), 1MB M7 + 1MB M4"
C:\Users\bwilliams\Documents\Arduino\libraries\ArduinoRS485\src\RS485.cpp:189:18: error: 'SERIAL_PORT_HARDWARE' was not declared in this scope
RS485Class RS485(SERIAL_PORT_HARDWARE, RS485_DEFAULT_TX_PIN, RS485_DEFAULT_DE_PIN, RS485_DEFAULT_RE_PIN);
^~~~~~~~~~~~~~~~~~~~
C:\Users\bwilliams\Documents\Arduino\libraries\ArduinoRS485\src\RS485.cpp:189:18: note: suggested alternative: 'SERIAL_PARITY_SPACE'
RS485Class RS485(SERIAL_PORT_HARDWARE, RS485_DEFAULT_TX_PIN, RS485_DEFAULT_DE_PIN, RS485_DEFAULT_RE_PIN);
^~~~~~~~~~~~~~~~~~~~
SERIAL_PARITY_SPACE
exit status 1
Error compiling for board Arduino Portenta H7 (M4 core).
Code I'm trying to run:
#include "Arduino_MachineControl.h"
#include <Wire.h>
using namespace machinecontrol;
void setup() {
Wire.begin();
digital_outputs.setLatch();
digital_outputs.setAll(0);
if(!digital_inputs.init()){
//digital_input initialization failed
errorFlash();
}
}
void loop() {
// put your main code here, to run repeatedly:
if(digital_inputs.read(0)){ //if Button press (DIN pin 0) is high then turn on lights
digital_outputs.set(0,HIGH);
delay(100);
digital_outputs.set(0,LOW);
}
}
void errorFlash(){
while(1){
digital_outputs.set(7,HIGH);
delay(500);
digital_outputs.set(7,LOW);
delay(500);
}
}
I suspect that the error is caused because the M7 core handles the Serial communication leaving the M4 core unable to be used with the Machine Control library. Any ideas on a workaround?