I am using VS code, and have 2 Atmega2560 boards talking to each other. I am programming in pure C. Their .c and .h files are both found with in the src folder. I want to include an Uno R3 board as well. How do I set up the .h file or what do I include in the platformio.ini file? Here are the 3 snippets of code from the 3 locations. It is the UnoRobot that I am concerned with.
The .c file is
#include "UnoRobot.h"
#include "util/delay.h"
#include "avr/io.h"
int main(void){
while (1){
_delay_ms(100);
}
}
The .h file is
#ifndef CONTROLLER_H_ // double inclusion guard
#define CONTROLLER_H_
// Include standard libraries
#include "serial.h"
#include "adc.h"
#include "milliseconds.h"
#include "hd44780.h"
// Constants
#define BUILD_DATE __TIME__ " " __DATE__"\n"
// Dummy function declaration (add more later!)
void dummy_function(void);
#endif /* UNOROBOT_H_ */
And the .ini file is
[env:Controller]
platform = atmelavr
board = megaatmega2560
framework = arduino
monitor_port = COM7
monitor_speed = 115200
upload_port = com7
build_src_filter =
+<**/*.c>
-<Robot.c>
-<UnoRobot.c>
[env:Robot]
platform = atmelavr
board = megaatmega2560
framework = arduino
monitor_port = com3
monitor_speed = 115200
upload_port = com3
build_src_filter =
+<**/*.c>
-<Controller.c>
-<Robot.c>
-<UnoRobot.c>
[env:UnoRobot]
platform = atmelavr
board = uno
framework = arduino
monitor_port = com6
monitor_speed = 115200
upload_port = com6
build_src_filter =
+<**/*.c>
-<Robot.c>
-<Controller.c>