Fatal error: aux_regs.h: No such file or directory

Im working with an Elegoo MEGA 2560 Arduino trying to test PWM Signal via CurieTimerOne and Im getting an error saying Im missing something but I am unable to figure out how to get it. there is nothing that comes up when searching aux_regs in the Arduino Cloud library.

Here is the code I am working with.

//#include <aux_regs.h>
#include <CurieTimerOne.h>



int LimitSwitchPin = A1
int LED_PIN = 13

void Signal() {
  if (analogRead(LimitSwitchPin)) {
    CurieTimerOne.pwmStart(13, 25.0, 1000000)
  }
  else {
    CurieTimerOne.pwmStop()
  }
}

void setup() {
  pinMode(LED_PIN, OUTPUT);    // sets the digital pin 13 as output
  CurieTimerOne.pwmStart(13, 25.0, 1000000)
}

void loop() {
  //Signal()
  
}

Here is the full debug output:

/usr/local/bin/arduino-cli compile --fqbn arduino:avr:mega:cpu=atmega2560 --build-cache-path /tmp --output-dir /tmp/312549462/build --build-path /tmp/arduino-build-C2EC1C811CF52F480B57F0622636B3F7 --library /mnt/create-efs/webide/e2/3f/e23f7927769d37b1d7966c098ffc5a02:ant_inthecircuits/libraries_v2/CurieTimerOne /tmp/312549462/LimitSwitch_PWM_Test

In file included from /tmp/312549462/LimitSwitch_PWM_Test/LimitSwitch_PWM_Test.ino:2:0:

/mnt/create-efs/webide/e2/3f/e23f7927769d37b1d7966c098ffc5a02:ant_inthecircuits/libraries_v2/CurieTimerOne/src/CurieTimerOne.h:45:10: fatal error: aux_regs.h: No such file or directory

#include <aux_regs.h>

^~~~~~~~~~~~

compilation terminated.

Error during build: exit status 1

including auxregs is commented out because it led to a different error saying it doesnt know what aux_regs is.

It looks like the CurieTimerOne library is for 32 bit MCUs. Your Mega 2560 does not qualify. You should try the TimerOne library instead. According the to docs, CurieTimerOne is based on the TimerOne library and should be very similar.

1 Like

I will be trying this in about an hour cause Im currently away from my laptop and the arduino itself. When I got into the TimerOne reference page and checked its docs, it links me to the arduino playground which doesnt seem right? If youre able to link me to the proper TimerOne docs that'd be great too. Thanks!

1 Like

Thank you! Switching to TimerOne and also switching to Arduino IDE instead of using the browser version helped to get it working. Although I'm now having issues related to TimerOne but they are not longer relevant to this topic so I will create a new one if issues continue :slight_smile:

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