IDE Version/Library Migration

I have been attempting to use the HOPE RFM01 and 02 modules. The only library available for this (along with Sketches) appears to be from http://www.contrechoc.com/fablab/RF01-02.zip. These were written to use Arduino V0018. I am using Arduino 1.0.1. With this latest version of Arduino the sketch will not compile and gives the following error “d:\Arduino-1.0.1\hardware\arduino\variants\standrd/pins_arduino.h:43 error: expected unqualified-id before numeric constant”.
If I comment out the #define SCK line - it will compile. I have installed Arduino 18 and the program compiles OK BUT I am unable to upload it to either an UNO R3 or a duomileanuevo.
The problem I am sure is an incompatibility in Libraries and structure between the 2 versions and I have tried all the suggestion I can find reference including additional libraries or removing libraries but to no avail.

My code is as follow and based on the above contrechoc link.

/*connections arduino RF01 and RF02

in arduino version 018
(not yet tested in more recent arduino versions)

tested with ATmega 328
on frequency 433
*/

//connections RF02: (sending)
#define SDI 8 // SDI, → RF02 Atmega PB0 Arduino 8 cannot be changed
#define SCK 9 // SCK, → RF02 Atmega PB1 Arduino 9 cannot be changed
#define CS 10 // nSEL, → RF02 Atmega PB2 Arduino 10 cannot be changed
#define IRQ 12 // nIRQ, ← RF02 Atmega PB4 Arduino 12 cannot be changed
//------------------// FSK: Pullupto VCC

//arduino scripts:

//--------------------------------------------------------------------------------------//

// RF02 sending words
// tested with lib, november 2010

#include <RF02.h>
#include <stdint.h>
#include <SPI.h>

int wissel = 0;//wissel means change in dutch

void setup() {

Serial.begin(57600);
Serial.print(“hello” );
Serial.println(“init” );

rf02_prepAll434();
Serial.println(“done” );

pinMode(4, OUTPUT); //testing leds
pinMode(5, OUTPUT);
ledBlink(4);
ledBlink(5);
}

void ledBlink(int num){
digitalWrite(num, HIGH);
delay(100);
digitalWrite(num, LOW);
delay(100);
}

void loop() {

ledBlink(4);

delay(1550);
Serial.print(wissel );
Serial.println(" send: ");

switch ( wissel)
{
case 0:
{
unsigned char buf = { “hello World! \n” };
rf02_changeText( buf, sizeof buf);
Serial.println(“hello World! \n”);
rf02_sendData();
wissel = 1;
break;
}
case 1:
{
unsigned char buf = { “Goodbye Life! \n” };
Serial.println(“Goodbye Life! \n”);
rf02_changeText( buf, sizeof buf);
rf02_sendData();
wissel = 2;
break;
}
case 2:
{
unsigned char buf = { “Bless all! \n” };
Serial.println(“Bless all! \n”);
rf02_changeText( buf, sizeof buf);
rf02_sendData();
wissel = 0;
break;
}
}
}

//----------------------------

I will apologise now if I am being stupid but my C++ expertise is very poor

Don

The problem here is this library of yours defines SCK to be 9, and the arduino core uses SCK as a const int.

[code path=variants/standard/pins_arduino.h]
static const uint8_t SCK  = 13;

So, with replacement, you end up with:

static const uint8_t 9  = 13;

Which obviously makes no sense...

The core defines the SPI pins - your library should never need to.

Thank you for your response, I apologise for my late response but I have been away. I am not sure I completely understand what to do now. The original code in the original sketch read:

connections RF01: (receiving)
#define SDI 5 // RF01 SDI, arduino 13 cannot be changed
#define SCK 4 // RF01 SCK, arduino 12 cannot be changed
#define CS 3 // RF01 nSEL, arduino 11 cannot be changed
#define SDO 2 // RF01 SDO, arduino 10 cannot be changed
//--------------------- // RF01 niRQ, arduino 02 cannot be changed
//----------------------// RF01 nFFS: 1-10k Pullup too Vcc

connections RF02: (sending)
#define SDI 0 // SDI, → RF02 Atmega PB0 Arduino 8 cannot be changed
#define SCK 1 // SCK, → RF02 Atmega PB1 Arduino 9 cannot be changed
#define CS 2 // nSEL, → RF02 Atmega PB2 Arduino 10 cannot be changed
#define IRQ 4 // nIRQ, ← RF02 Atmega PB4 Arduino 12 cannot be changed
//------------------// FSK: Pullupto VCC

As I was fairly sure that SCK was NOT = 1 I (wrongly?) changed this to 9. Would you be able to tell me what this code should look like (both for the RF01 module and the RF02.
The original write up said it used “bit banging” rather than the SPI library - does this mean I should not have included the SPI?

Any clarification you can give would be appreciated.

Regards