I have receiver the enclosed code frmo the vendor of the module but i cant get it to compile.
#include <Wire.h>
void setup();
int num = -981;
{
Wire.begin();
}
void TwiLeDispIntAndPts(uint8_t address, uint8_t upLed, uint8_t loLed, uint8_t bright_rb, uint8_t bright_7s, int16_t number, uint8_t points)
{
uint8_t i;
uint8_t Buffer[8];
Buffer[0] = ((1 & upLed) << 7) | ((1 & loLed) << 6) | (1 << 5) | (bright_7s & 31);
Buffer[1] = bright_rb & 127;
//snprintf(&Buffer[2], 5, "%d", number); // if this line will not work, try to replace it with these:
Buffer[2] = 1;
Buffer[3] = 2;
Buffer[4] = 3;
Buffer[5] = 4;
Buffer[6] = 0b1111 & points;
Buffer[7] = address << 1;
for (i = 0; i <= 6; i++) Buffer[7] ^= Buffer[i];
//Wire.beginTransmission(address);
// try this if above will not work:
Wire.beginTransmission(address << 1);
Wire.send(&(Buffer[0]), 8);
Wire.endTransmission();
}
void loop()
{
Wire.beginTransmission(3); // transmit to device #3
Wire.send(3, 0, 1, 5, 31, num, 0b00001111);
Wire.endTransmission(); // stop transmitting
num++;
delay(5000);
}
I now get the following error :-
in the brown bar it says :-
[expected unqualified-id before '{' token
then underneath in the black note ares it says :-
sketch_nov25a.cpp: 5: error: expected unqualified-id before '{' token
sketch_nov25a.cpp: In function 'void loop()':
sketch-nov25a:33: error: no matching function for call to 'TwoWire::send(int, int, int, int, int, int, int&, int)'
C:Program files\Arduino\arduino-0021\arduino-0021\libraries\Wire/Wire/Wire.h:54: note candidates are: void TwoWire::send(unit8_t)
C:Program files\Arduino\arduino-0021\arduino-0021\libraries\Wire/Wire/Wire.h:55: note void TwoWire::send(unit8_t*, unit8_t)
C:Program files\Arduino\arduino-0021\arduino-0021\libraries\Wire/Wire/Wire.h:56: note void TwoWire::send(int)
C:Program files\Arduino\arduino-0021\arduino-0021\libraries\Wire/Wire/Wire.h:57: note void TwoWire::send(char*)
Does any one know what is wrong.
I understand the main parts of the code need to remain as they are as there is a program on the attiny2313 that takes the code in the order given so that the LED display shown the value that we have called 'num'
from this point on i am stuck so any help will be graefully received - my only final thought is that the code we need to run the ATTiny2313 is not compatable with the Arduino ???
thank you