Programming Arduino for rf support - Vic - 2022-06-13
L.s.
I'm trying to upload the hat.ino to an arduino pro mini to have rf capabilities to my pipylot. And have some issues on that.
I've placed the RCSwitch and the 3 IRlib libraries in the library folder. And pressed compile in the Arduino IDE.
And voila, the arduino ide doesn't compile. The error messages that I have are attached below..
Could someone point me in the right direction?
Code: C:\Users\wboek\Downloads\arduino-1.8.19-windows\arduino-1.8.19\hat\hat.ino:303:39: warning: missing initializer for member 'codes_type::ltime' [-Wmissing-field-initializers]
static struct codes_type codes[4] = {0};
^
C:\Users\wboek\Downloads\arduino-1.8.19-windows\arduino-1.8.19\hat\hat.ino:303:39: warning: missing initializer for member 'codes_type::repeat_count' [-Wmissing-field-initializers]
C:\Users\wboek\Downloads\arduino-1.8.19-windows\arduino-1.8.19\libraries\IRLib2\IRLibDecodeBase.cpp: In member function 'void IRdecodeBase::dumpResults(bool)':
C:\Users\wboek\Downloads\arduino-1.8.19-windows\arduino-1.8.19\libraries\IRLib2\IRLibDecodeBase.cpp:56:8: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
if(interval>0)LowSpace=min(LowSpace, interval); HiSpace=max (HiSpace, interval);
^~
C:\Users\wboek\Downloads\arduino-1.8.19-windows\arduino-1.8.19\libraries\IRLib2\IRLibDecodeBase.cpp:56:57: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
if(interval>0)LowSpace=min(LowSpace, interval); HiSpace=max (HiSpace, interval);
^~~~~~~
C:\Users\wboek\Downloads\arduino-1.8.19-windows\arduino-1.8.19\libraries\IRLib2\IRLibDecodeBase.cpp: In member function 'bool IRdecodeBase::MATCH(int16_t, int16_t)':
C:\Users\wboek\Downloads\arduino-1.8.19-windows\arduino-1.8.19\libraries\IRLib2\IRLibDecodeBase.cpp:130:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
return (val >= (uint16_t)(expected*(1.0-PERCENT_TOLERANCE/100.0)))
~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\wboek\Downloads\arduino-1.8.19-windows\arduino-1.8.19\libraries\IRLib2\IRLibDecodeBase.cpp:131:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
&& (val <= (uint16_t)(expected*(1.0+PERCENT_TOLERANCE/100.0)));
~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\wboek\Downloads\arduino-1.8.19-windows\arduino-1.8.19\libraries\IRLib2\IRLibRecvBase.cpp: In function 'void IRLib_IRrecvComplete(uint8_t)':
C:\Users\wboek\Downloads\arduino-1.8.19-windows\arduino-1.8.19\libraries\IRLib2\IRLibRecvBase.cpp:159:35: warning: unused parameter 'Reason' [-Wunused-parameter]
void IRLib_IRrecvComplete(uint8_t Reason) {
^~~~~~
HardwareSerial0.cpp.o (symbol from plugin): In function `Serial':
(.text+0x0): multiple definition of `__vector_18'
sketch\hat.ino.cpp.o (symbol from plugin):(.text+0x0): first defined here
HardwareSerial0.cpp.o (symbol from plugin): In function `Serial':
(.text+0x0): multiple definition of `__vector_19'
sketch\hat.ino.cpp.o (symbol from plugin):(.text+0x0): first defined here
C:\Users\wboek\Downloads\arduino-1.8.19-windows\arduino-1.8.19\hat\hat.ino: In function 'set_buzzer':
C:\Users\wboek\Downloads\arduino-1.8.19-windows\arduino-1.8.19\hat\hat.ino:207:17: warning: 'freq' may be used uninitialized in this function [-Wmaybe-uninitialized]
OCR2B = freq/2;
^
C:\Users\wboek\Downloads\arduino-1.8.19-windows\arduino-1.8.19\hat\hat.ino:191:13: note: 'freq' was declared here
uint8_t freq;
^
collect2.exe: error: ld returned 1 exit status
exit status 1
Fout bij het compileren voor board Arduino Pro or Pro Mini
RE: Programming Arduino for rf support - seandepagnier - 2022-06-14
Can you just use the provided makefile?
RE: Programming Arduino for rf support - Vic - 2022-06-14
(2022-06-14, 02:57 AM)seandepagnier Wrote: Can you just use the provided makefile?
I don't have a linux machine nearby...
RE: Programming Arduino for rf support - Vic - 2022-06-14
Code: pi@raspberrypi:~ $ cd hat
pi@raspberrypi:~/hat $ ls
hat.ino IRLib2 Makefile RCSwitch.cpp RCSwitch.h wiring.c
pi@raspberrypi:~/hat $ make
cat: objs: No such file or directory
echo /usr/share/arduino/libraries/Wire/Wire.o /usr/share/arduino/hardware/arduino/cores/arduino/wiring_digital.o /usr/share/arduino/hardware/arduino/cores/ardui no/wiring_analog.o /usr/share/arduino/hardware/arduino/cores/arduino/WInterrupts .o /usr/share/arduino/hardware/arduino/cores/arduino/new.o /usr/share/arduino/ha rdware/arduino/cores/arduino/WString.o /usr/share/arduino/hardware/arduino/cores /arduino/Stream.o /usr/share/arduino/hardware/arduino/cores/arduino/Print.o /usr /share/arduino/hardware/arduino/cores/arduino/WMath.o /usr/share/arduino/hardwar e/arduino/cores/arduino/main.o /usr/share/arduino/libraries/SPI/SPI.o /usr/share /arduino/libraries/Wire/utility/twi.o IRLib2/IRLibRecvPCI/IRLibRecvPCI.o IRLib2/ IRLib2/IRLibRecvBase.o IRLib2/IRLib2/IRLibDecodeBase.o IRLib2/IRLibProtocols/IRL ibHardware.o RCSwitch.o wiring.o | sed s,^,obj/,g | sed 's, , obj/,g' | sed s,// ,/,g > objs
make /usr/share/arduino/libraries/Wire/Wire.o /usr/share/arduino/hardware/arduino/cores/arduino/wiring_digital.o /usr/share/arduino/hardware/arduino/cores/ardui no/wiring_analog.o /usr/share/arduino/hardware/arduino/cores/arduino/WInterrupts .o /usr/share/arduino/hardware/arduino/cores/arduino/new.o /usr/share/arduino/ha rdware/arduino/cores/arduino/WString.o /usr/share/arduino/hardware/arduino/cores /arduino/Stream.o /usr/share/arduino/hardware/arduino/cores/arduino/Print.o /usr /share/arduino/hardware/arduino/cores/arduino/WMath.o /usr/share/arduino/hardwar e/arduino/cores/arduino/main.o /usr/share/arduino/libraries/SPI/SPI.o /usr/share /arduino/libraries/Wire/utility/twi.o IRLib2/IRLibRecvPCI/IRLibRecvPCI.o IRLib2/ IRLib2/IRLibRecvBase.o IRLib2/IRLib2/IRLibDecodeBase.o IRLib2/IRLibProtocols/IRL ibHardware.o RCSwitch.o wiring.o
make[1]: Entering directory '/home/pi/hat'
make[1]: *** No rule to make target '/usr/share/arduino/libraries/Wire/Wire.o'. Stop.
make[1]: Leaving directory '/home/pi/hat'
make: *** [Makefile:57: objs] Error 2
I got the above error. The got a rpi up and running. After installing arduino-mk (by using: sudo apt-get install arduino-mk). Put the hat-folder from github on the pi and rebooted the device. After that i got the above error!?
RE: Programming Arduino for rf support - seandepagnier - 2022-06-15
Can you find Wire.cpp path and adjust the makefile to point to the arduino path if it is not /usr/share/arduino?
I also just install "arduino" I was unaware of the arduino-mk package, but not sure if that has changed the path
RE: Programming Arduino for rf support - stelian - 2022-06-19
No, there is no need for arduino-mk with the stock Makefiles.
As a matter of fact I do use arduino-mk privately because I like it, but this requires modifying the Makefile.
If anyone is interested in this I can make these changes public somehow.
RE: Programming Arduino for rf support - Vic - 2022-06-21
I did a reinstall of the raspberry pi. And with that, installed the plain arduino package now.
This evening I'll try to compile the package again. But now with the arduino (instead of th arduino-mk)
RE: Programming Arduino for rf support - Vic - 2022-06-21
no, still no dice...
I am getting cray here...
Is there an option to share a hex file of this code? So I can upload that one?
RE: Programming Arduino for rf support - stelian - 2022-06-21
Try http://popies.net/pypilot/hat.hex
RE: Programming Arduino for rf support - Vic - 2022-06-21
(2022-06-21, 08:00 PM)stelian Wrote: Try http://popies.net/pypilot/hat.hex
ah, great!
i've just uploaded the file to the pro mini. Only have to solder the headers to it..
Keep you posted
Victory!!!!
great, this works. I have now both lcd backlit and rf-remote control.
The hex file works great!
I used xloader for this
|