Show Posts
Pages: [1] 2 3 ... 16
1  Using Arduino / Project Guidance / Re: Using attachInterrupt in library with non-static class member on: July 03, 2014, 03:01:28 pm
How?

Write the code for that method and put it in your source file, or another file within your project.

Please enlight me.
2  Using Arduino / Project Guidance / Re: Using attachInterrupt in library with non-static class member on: July 02, 2014, 11:59:20 am
My example looks like this:

.ino
Code:
#include .h

todo todo(10);

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:
  
}

.h
Code:

void first(void);

class todo {
  public:
    todo (uint8_t pin);
    static void second();
    void third();  //could be bool or int as well with some parameter or only an flying step to go ahead
}

.cpp
Code:
todo::todo(uint8_t){
  attachInterrupt(pin, first, CHANGE);
}

void first(void) {
  todo::second();
}

void todo::second() {
  question how to call the non static function, calling from second not needed but there is I stuck
}
3  Using Arduino / Project Guidance / Re: Using attachInterrupt in library with non-static class member on: July 02, 2014, 11:56:22 am
Is there an solution for this problem, to call an class member from attachInterrupt?

Your code is incomplete - it does not provide an implementation for the method void Foo::bar().

To fix the problem, provide an implementation.

How?
4  Using Arduino / Project Guidance / Using attachInterrupt in library with non-static class member on: July 02, 2014, 08:39:38 am
Hello guys I found this:

Code:
class Foo{
  public:
    void bar();
};

Foo foo;

void setup(){
  attachInterrupt(0,fooBar,RISING);
}

void loop(){}

void fooBar(){
  foo.bar();
}

there: http://forum.arduino.cc/index.php?topic=41713.0

As minimum Sample, but this did not work,
Code:
undefined reference to `Foo::bar()'

Is there an solution for this problem, to call an class member from attachInterrupt?
5  Using Arduino / Networking, Protocols, and Devices / Re: OneWire library with overdrive support on: June 17, 2014, 10:00:44 am
Hi final,

I study the lib from you. I think at this Part there is something wrong.
Quote
uint8_t OneWire::reset(bool overdrive)
{
   IO_REG_TYPE mask = bitmask;
   volatile IO_REG_TYPE *reg IO_REG_ASM = baseReg;
   uint8_t r;
   uint8_t retries = 125;

   noInterrupts();
   DIRECT_MODE_INPUT(reg, mask);
   interrupts();
   // wait until the wire is high... just in case
   do {
      if (--retries == 0) return 0;
      //delayMicroseconds(2);
      delayNanoseconds<2000>();
   } while ( !DIRECT_READ(reg, mask));

   noInterrupts();
   DIRECT_WRITE_LOW(reg, mask);
   DIRECT_MODE_OUTPUT(reg, mask);   // drive output low
   interrupts();
   //delayMicroseconds(480);
   if(overdrive)
      delayNanoseconds<overdrive_timings::t_rstl>();
   else
      delayNanoseconds<normal_timings::t_rstl>();
   noInterrupts();
   DIRECT_MODE_INPUT(reg, mask);   // allow it to float
   //delayMicroseconds(70);
   if(overdrive)
      delayNanoseconds<overdrive_timings::t_msp>();
   else
      delayNanoseconds<normal_timings::t_msp>();
   r = !DIRECT_READ(reg, mask);
   interrupts();
   if(overdrive)
      delayNanoseconds<overdrive_timings::t_pdh+
             overdrive_timings::t_pdl+
             overdrive_timings::t_rec-
             overdrive_timings::t_msp>();

   else
      //delayMicroseconds(410);
      delayNanoseconds<normal_timings::t_pdh+ // 60000
             normal_timings::t_pdl+             //240000
             normal_timings::t_rec-             //  5000
             normal_timings::t_msp>();          // 70000

   return r;
}
In the red part here is the wrong timing for delay there must stand ::t_rsth - ::msp not the parts from ::t_pdh + ::t_pdl - ::t_msp. Also wrong in the library from Patrik Jonsson.

Based on APP126 from Maxim/Dalllas t_rsth takes 480us and after 70us in this range the master takes a sample

So this musst be the correct version.

Quote
....
      delayNanoseconds<normal_timings::t_msp>();
   r = !DIRECT_READ(reg, mask);
   interrupts();
   if(overdrive)
      delayNanoseconds<overdrive_timings::t_rsth-
             overdrive_timings::t_msp>();

   else
      //delayMicroseconds(410);
      delayNanoseconds<normal_timings::t_rsth- //  480000
             normal_timings::t_msp>();           //   70000

   return r;
}
6  Using Arduino / Networking, Protocols, and Devices / Re: OneWire library with overdrive support on: June 16, 2014, 01:52:10 pm
So the overdrive implementation  is in progress...
7  Development / Other Software Development / Re: 1-Wire Slave on: June 11, 2014, 07:56:49 am
soo...update:

i wired my nano like Markus as shown in Post #36.
But my nano istn listet on my 1wire-Bus.

I set Pin2 as dsslavepin - but it seems that this doesnt work.

Markus: you got your Nano running as 1wire slave - what can i do to get mine working?  smiley-red
Can you give me e litte hint?

Damn it really don't work on the Arduino Nano...

ATM. I will give the external ceramic resonator from the Nano the guiltiness, the ceramic resonator isn't as accurate as the crystal resonator who is used on the Leonardo or Uno. Following this
http://jorisvr.nl/arduino_frequency.html


But this means the ATtiny85 with the internal RC would be more accurate than the ceramic resonator

So far so good, my Trinket response as 1-wire device with some drops on the line but works. For the next step an self calibration for the Nano and Trinket would be nice to solve the timing problems. I will try to include overdrive support

Did someone run 2 Nano's against another?
8  Development / Other Software Development / Re: 1-Wire Slave on: June 10, 2014, 01:13:46 pm
thanks for the hint.

so far i connected only the data pin (connected to digital2) and ground pin to the Arduino.
At the moment the Arduino is powered via the usb connector.

however if i tested the simple code for simulating the DS1990A - the Arduino (simulated DS1990A) is not listed in the bus list. smiley-cry
somehow i have no idea what i can do to get this setup work - but i know that it must work.
Markus got this running on an Arduino nano if i am not wrong...  smiley-roll
Looks like I have some work to do!
9  Products / Arduino Due / Re: Arduino DUE Booard Model DUE R3-E on: May 21, 2014, 04:45:52 pm
Good morning!

I bought recently a DUE board Model DUE R3-E. I there any difference to the preceding boards. I cant't find no hint at the arduino hompage.

Thanks for the Anwser.

Wopo

Can you pop out some more infos where did you buy it, can you post a piture?
10  Development / Other Software Development / Re: 1-Wire Slave on: April 11, 2014, 11:11:17 am
UPDATE:
Current GitHub files compile correctly for Teensy 3.1. Must have been picking up old version of onewireslave.h.  I put the current onewireslave.h file in sketch folder and referenced it there and successfully compiled.  Thanks for making changes for 3.1.
Richard
No Thanks needed at all, have fun with it.

Looks like the Slave works more proper with the Teensy 3 and above may its an idea to port the timer and interrupt driven version to the Arduino to get better work with the Megas.
11  Development / Other Software Development / Re: 1-Wire Slave on: March 31, 2014, 06:31:45 am
Strange, I used the files directly from git and tested it, compiled without errors can, test if it compile for other boards from the list? What verion of teensyduino did you use?
12  Development / Other Software Development / Re: 1-Wire Slave on: March 30, 2014, 06:00:15 pm
A okey I see, the version on github did not contain support for the Teensy 3.1, please reload the new from github it should work now.
13  Development / Other Software Development / Re: 1-Wire Slave on: March 30, 2014, 01:27:26 pm
Hello
I have been looking for information for onewire slave. This thread looks interesting but I am not sure I understand how to implement this.  If the code is .ino file does that mean I can compile and load from Arduino GUI ??  I also looked at the code on GitHub (from Markus https://github.com/MarkusLange/OneWireSlave ) that has .ino files for what appears to be Teensy devices.  I have not been able to get that compile with Arduino.  I currently have Arduino Mega 2560 and a Teensy 3.1.  I would really appreciate someone explaining how to use the various versions listed here and at GitHub https://github.com/MarkusLange/OneWireSlave.

Thanks

Hi ringram,

can you explain or show what for errors you get? This one should work on all
Quote
DS18B20_Slave_Interrupt_universal_analogread_fulllib.ino
Some are spezific for the Teensy 3.

BR
Markus
14  Products / Arduino Due / Re: Comunicating ADC+ Arduino DUE with the protocol 1-wire on: March 17, 2014, 12:10:06 pm
Hmm, ok.

it would be make with DS18B20 the OneWireProtocol would work over this distance
http://www.maximintegrated.com/app-notes/index.mvp/id/148

Range is -55 to +125 Degree.

But if you want realy big distances and high precision so do something like this.

Temp-Sensor->ADC->uC->live-zero-Signal(DIN IEC 60381-1) [4..20mA]->ADC(near DUE)->Some Protocol->DUE

The current Signal is really unaffected by distance and EM-fields in the near.

So you can use any Sensor you want and go to long distances as well but you need to set up an DAC and an OP-circuit, or an IC for the Signal.
15  Products / Arduino Due / Re: Comunicating ADC+ Arduino DUE with the protocol 1-wire on: March 17, 2014, 03:20:02 am
Now that you mention it I can only remember ever seeing MAXIM/DS chips with 1-wire, but that's not to say there aren't other manufacturers.

Quote
Can I use other maker for use ADC with 1-wire protocol?
Sure, if you can find one.

Why are you so fixed on 1-wire? There are a lot more options with I2C and it's only one more wire.

______
Rob

Yes Graynomad is right there are so many options, I2C, SPI, Serial and Parallel and I'm sure Graynomad knows some more. Btw. and faster as OneWire are they too.

Start at the beginning what do you want with an external ADC? The DUE has some inside itself 12bit if I'm right, goes from 0 to 3.3Volt.
Pages: [1] 2 3 ... 16