New onewire compile error

Status
Not open for further replies.

Buzz

Well-known member
I am using a Teensy 3.5 with the MAX31850k thermcouple board , I downloaded both NEW onewire and DallasTempurature libraries from PJRC site link on github.

I get errors -

( 'IO_REG_TYPE' does not name a type' Compiling 'Smart oven' for 'Teensy 3.5'

Smart oven.ino:9: In file included from

OneWire.h: 130:2: error: #error "Please define I\O register types here"
#error "Please define I\O register types here"

OneWire.h: 137:5: error: 'IO_REG_TYPE' does not name a type
IO_REG_TYPE bitmask

OneWire.h: 138:14: error: 'IO_REG_TYPE' does not name a type
volatile IO_REG_TYPE *baseReg
Error compiling project sources
Build failed for project 'Smart oven' )


any idea how to fix this problem ? I did a search already PAUL S. ??
i am using Visual Studio BTW with the Visual Micro plugin
 
Hard to know what is going on without seeing the code or the real messages...
Example Smart oven.ino?

Looking at Paul's github for Onewire... https://github.com/PaulStoffregen/OneWire/blob/master/OneWire.h#L137
At line 137 is a comment so unlikely would produce that message...

Did it pick up a different version of that file from some other source?

My guess and again only a guess is maybe a different version was included?

Does it build properly if you use the Arduino IDE?
 
The code is massive , we run a Nextion touch screen ++ , I updated the onewire and dallstemp libraries that is IT , these are needed for the MAX31850 temp IC using the onewire bus , I did not purge my library files of the old files BUT in the VS IDE they are in the folder and do not refer to Arduino folders for the files. I have a guy that works on this for me but he has been unavailable so I am trying to fix it / learn at the same time.

Those are the only errors I get , when I switch back to the older versions it compiles fine.
 
Do you get this error when compiling any of the 3 examples that come with OneWire?

I tried just now with the DS18x20_Temperature example. Verifies fine with Arduino 1.8.5 & Teensyduino 1.42 on Macintosh.
 
Yes , I tried this simple code from ? forgot lol I think PJRC , with the max31850k board and new libraries and it compiled and worked ( I had one issue because of old libraries but cleaned it up ).
I have the ds18b20 also and had run it on the older libraries with no issues , I can run the MAX with the old libraries and it works BUT the accuracy is about .45 degC instead of .25 degC

I tried removing Onewire ( NEW Dallas refers to onewire in it ) I saw this as a possible issue in a forum you replied to but no help.
Have you seen this before Paul ?

remember I am using VS with Visual Micro plugin

Code:
#include <OneWire.h>
#include <DallasTemperature.h>

// Data wire is plugged into port 2 on the Arduino
#define ONE_WIRE_BUS 2

// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
OneWire oneWire(ONE_WIRE_BUS);

// Pass our oneWire reference to Dallas Temperature. 
DallasTemperature sensors(&oneWire);
DeviceAddress addr;

void setup(void)
{
  // start serial port
  Serial.begin(9600);
  Serial.println("Dallas Temperature IC Control Library Demo");

  // Start up the library
  sensors.begin();
}

void loop(void)
{ 
  // call sensors.requestTemperatures() to issue a global temperature 
  // request to all devices on the bus
  Serial.print("Requesting temperatures...");
  sensors.requestTemperatures(); // Send the command to get temperatures
  Serial.println("DONE");
  
  for (uint8_t s=0; s < sensors.getDeviceCount(); s++) {
    // get the unique address 
    sensors.getAddress(addr, s);
    // just look at bottom two bytes, which is pretty likely to be unique
    int smalladdr = (addr[6] << 8) | addr[7];
    
    Serial.print("Temperature for the device #"); Serial.print(s); 
    Serial.print(" with ID #"); Serial.print(smalladdr);
    Serial.print(" is: ");
    Serial.println(sensors.getTempCByIndex(s));  
  }
}
 
I compiled the code from msg #5 without any errors.

I did have to install the DallasTemperature library, version 3.8.0, using Arduino's library manager. I used the OneWire that comes with Teensyduino 1.42.

Since the program compiles correctly in Arduino, this is the time to ask for help on the Visual Micro forum.
 
Status
Not open for further replies.
Back
Top