johnwasser:
/Users/john/Documents/Arduino/sketch_jun07a/sketch_jun07a.ino: In function 'void setup()':
/Users/john/Documents/Arduino/sketch_jun07a/sketch_jun07a.ino:64:30: warning: invalid conversion from 'void ()()' to 'void ()(int)' [-fpermissive]
Wire.onReceive(receiveEvent);
^
In file included from /Users/john/Documents/Arduino/sketch_jun07a/sketch_jun07a.ino:1:0:
/Users/john/Library/Arduino15/packages/arduino/hardware/avr/1.8.2/libraries/Wire/src/Wire.h:72:10: note: initializing argument 1 of 'void TwoWire::onReceive(void ()(int))'
void onReceive( void ()(int) );
^~~~~~~~~
Looks like your onReceive function is supposed to take an integer argument.
yes, I looked it up in the example sketch (code below), I now got it in but didn't change anything.
#include <Wire.h>
void setup() {
Wire.begin(8); // join i2c bus with address #8
Wire.onReceive(receiveEvent); // register event
Serial.begin(9600); // start serial for output
}
void loop() {
delay(100);
}
// function that executes whenever data is received from master
// this function is registered as an event, see setup()
void receiveEvent(int howMany) {
while (1 < Wire.available()) { // loop through all but the last
char c = Wire.read(); // receive byte as a character
Serial.print(c); // print the character
}
int x = Wire.read(); // receive byte as an integer
Serial.println(x); // print the integer
}
johnwasser:
/Users/john/Documents/Arduino/sketch_jun07a/sketch_jun07a.ino: In function 'void shoot()':
/Users/john/Documents/Arduino/sketch_jun07a/sketch_jun07a.ino:272:40: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if ((lastchangetime[0] + shootdelay) < millis() && lastchangetime[0] < (millis() + DEBOUNCETIME)
~~~~~~~~~~~~~~~~~^~
/Users/john/Documents/Arduino/sketch_jun07a/sketch_jun07a.ino:272:72: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if ((lastchangetime[0] + shootdelay) < millis() && lastchangetime[0] < (millis() + DEBOUNCETIME)
^
/Users/john/Documents/Arduino/sketch_jun07a/sketch_jun07a.ino: In function 'void burstshotreset()':
/Users/john/Documents/Arduino/sketch_jun07a/sketch_jun07a.ino:316:42: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if ((lastchangetime[1] + DEBOUNCETIME) < millis()) // Debounce for not resetting the Burstshots too fast
~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
/Users/john/Documents/Arduino/sketch_jun07a/sketch_jun07a.ino: In function 'void muzzleFlashOut()':
/Users/john/Documents/Arduino/sketch_jun07a/sketch_jun07a.ino:362:48: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if ((lastchangetime[0] + FLASHLIGHTBURNTIME) < millis())
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
Variables containing millis() values (like lastchangetime[]) should be 'unsigned long' and not just 'long'.
/Users/john/Documents/Arduino/sketch_jun07a/sketch_jun07a.ino: In function 'void bulletAcceleration()':
/Users/john/Documents/Arduino/sketch_jun07a/sketch_jun07a.ino:329:65: warning: invalid conversion from 'int*' to 'const unsigned int*' [-fpermissive]
irsend.sendRaw(bullet, sizeof(bullet) / sizeof(bullet[0]), KHZ);
^
In file included from /Users/john/Documents/Arduino/sketch_jun07a/sketch_jun07a.ino:4:0:
/Users/john/Documents/Arduino/libraries/IRremote/IRremote.h:279:9: note: initializing argument 1 of 'void IRsend::sendRaw(const unsigned int*, unsigned int, unsigned int)'
void sendRaw (const unsigned int buf[], unsigned int len, unsigned int hz) ;
^~~~~~~
Similarly, bullet[] should be 'unsigned int' and not just 'int'.
Thanks, I changed it, but bullet[] only has 3 different values anyways: 0, 300, 550.
johnwasser:
/Users/john/Documents/Arduino/sketch_jun07a/sketch_jun07a.ino: In function 'void readnewMag()':
/Users/john/Documents/Arduino/sketch_jun07a/sketch_jun07a.ino:424:52: warning: statement has no effect [-Wunused-value]
MagazinArsenal[currentListRow][UIDANDMUNI - 1];
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
Was that line supposed to do something? It isn't doing anything.
seems like I forgot to remove it