Firstly: Welcome!
I was hoping I can handle this project by my own, but U'm stuck for too long now.
I need to send a trigger signal to HC-SR04 ultrasonic sensor via radio with FS100A at a distance of 30-300cm.
I intend to use two ATmega328P. I know, that FS100A is not a great idea, but I'm not really able to quickly buy something else now. Also I believe that it will work on such a short range.
I'm working in Eclipse, I've got the very basics like writing a simple program and sending it to AVR covered.
In every solution I've found that would fit my situation people use manchester.h library.
https://www.instructables.com/id...
I've downloaded and added it to the project. I've tried adding them to the most simple code:
#include <avr/io.h>
#include <util/delay.h>
#include <Manchester.h>
int main(void) {
//Set the Data Direction Register to output
DDRB |= (1<<PB1);
while (1) {
//Set the signal to vary
PORTB ^= (1<<PB1);
//wait 0.5 sec
_delay_ms(1000);
}
}
But compiler returned an error:
fatal error: WProgram.h: No such file or directory
Quick google, added Arduino library and installed arduino platform. Also #include <Arduino.h> at the beggining of the code. But then:
fatal error: pins_arduino.h: No such file or directory
That's where I'm out.
Please tell me either how to make this manchester library to work or if there are any pure C libraries that I could use?
Also, just to be sure, I will be able to do both this AND send data to putty on computer using UART? Or can I get those seperated somehow?