Nmradcc and Attiny85 disgispark

Hello everyone, I am looking at to upload the skectch for an attiny85. It s working perfectly well with an arduino and a mega but for an attiny it s a fail. I got the floowing message : (I have added the library EEPROM.h but it does not work. Thanks.

Arduino : 1.8.19 (Windows Store 1.8.57.0) (Windows 10), Carte : "Digispark (Default - 16.5mhz)"
.....C\OneDrive\Documents\Arduino\libraries\NmraDcc\NmraDcc.cpp:50:20: fatal error: EEPROM.h: No such file or directory

#include "EEPROM.h"

the code is:

[code]
#include <NmraDcc.h>
#include "EEPROM.h"

#define DCC_PIN 2
NmraDcc Dcc;

void notifyDccAccTurnoutBoard( uint16_t BoardAddr, uint8_t OutputPair, uint8_t Direction, uint8_t OutputPower ) {

  Serial.print("notifyDccAccTurnoutBoard: ") ;
  Serial.print(BoardAddr,DEC) ;
  Serial.print(',');
  Serial.print(OutputPair,DEC) ;
  Serial.print(',');
  Serial.print(Direction,DEC) ;
  Serial.print(',');
  Serial.println(OutputPower, HEX) ;
}


void setup() {
Serial.begin(115200);
 Dcc.pin(digitalPinToInterrupt(DCC_PIN),DCC_PIN, false);
Dcc.init( 13, 1,CV29_ACCESSORY_DECODER ,0);
}

void loop() {
  Dcc.process();

}

[/code]

try
#include <EEPROM.h>

Where did you store the EEPROM library ( only the EEPROM.h file is not sufficent)? Is there no EEPROM library with the Attiny core?

NmraDcc library expects the EEPROM library in one of the standard paths. Adding it to your sketch directory will not work.

I found an answer: Unable to Find EEPROM.h Include · Issue #34 · digistump/DigistumpArduino · GitHub
So I have added the library EEPROM manually. You were right the library was missing.
So now I have another error:do you know what it refers to? Thanks

Arduino : 1.8.19 (Windows Store 1.8.57.0) (Windows 10), Carte : "Digispark (Default - 16.5mhz)"
.......Desktop\nmradcc1__attiny85\nmradcc_Attiny\nmradcc_attiny.ino: In function 'void setup()':
nmradcc_attiny:22:39: error: 'digitalPinToInterrupt' was not declared in this scope
Dcc.pin(digitalPinToInterrupt(DCC_PIN),DCC_PIN, false);
exit status 1
'digitalPinToInterrupt' was not declared in this scope

Which core are you using?
I tried to compile your sketch, and it throws some warnings ( that I know from the NmraDcc lib ), but no errors.
I use the ATTinyCore.

It s working. i have taken the function gpiointerrupt off from the code and replaced by dcc.int(0,2,1)
For me the use of nmradcc is not obvious. I have somme difficulties to find out some explanations over the use of Flags.
Thankd

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.