Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

BoostC Pointer Help, Please?

Status
Not open for further replies.

Mike - K8LH

Well-Known Member
Greetings guys and gals,

Could I impose on someone to help me figure out how to use a pointer to a array as a parameter for a function in a program I'm working on please? Here's what I have now;

Code:
    unsigned char owbuff[8];     // one-wire rom id buffer
Code:
   /*
    *  One-Wire "Match Rom" function
    */
    void owmatch()               //
    { unsigned char i = 0;       //
      owrw(OwMatchRom);          // send "match rom" command
      do                         //
      { owrw(owbuff[i++]);       // send 64-bit ROM ID
      } while(i < 8);            //
    }                            //

So currently I'm not using a parameter for the function and I'm just using the owbuff[] array inside the function. How do I use a pointer as a parameter for the function so that I can specify which array to use? I'd like to be able to use function calls that look something like this - owmatch(owbuff) to send data from the owbuff[] array or perhaps owmatch(probe2id) to send data from a probe2id[] array.

TIA... Regards, Mike
 
Last edited:
Pointer Help [solved]

Sorry for the dumb question. I figured it out...


Cheerful regards, Mike
 
Last edited:
would you mind shareing the answer please mr mike? i like one wire stuff and it was a realy interesting question
thank you lg
 
Hi LG,

I'm up at our local airport right now but if I remember correctly, it was something like this;

Code:
   /*
    *  One-Wire "Match Rom" function
    */
    void owmatch(char *pbuff)    //
    { unsigned char i = 0;       //
      owrw(OwMatchRom);          // send "match rom" command
      do                         //
      { owrw(pbuff[i++]);        // send 64-bit ROM ID
      } while(i < 8);            //
    }                            //

Then I could call the function with an array name as a parameter;

Code:
    owmatch(owbuff);             //

Cheerful regards, Mike
 
Last edited:
thank you mr mike!!! realy helpful information
lg
 
You're welcome. I think 1-Wire stuff is fun too. Here's what I'm using to test my One-Wire software on at the moment...

**broken link removed**



I finished up a little C demo program, similar in function to Jake's Temperature Monitor program, that supports a single DS1820, DS18S20, or a DS18B20 with selectable Celsius or Fahrenheit (one decimal place) display. Currently I'm working on a 1-Wire "SearchROM" routine so that I can select and monitor multiple DS18x20 sensors all on the same 1-Wire I/O pin. I've done this in assembly language before but not in C.

Regards, Mike
 
Last edited:
the board looks realy good what did you use for the writing on the top of the pcb?

That's a plastic laminated paper silkscreen (picture below) on a Radio Shack prototype board (sku 276-149). Wiring on the copper side of the board is point-to-point using #30 Kynar wire (picture below).

also dont know if this is any help to you but i wanted to help dad ages ago with this thread https://www.electro-tech-online.com/threads/please-could-you-help-me.114991/ it has the search thing in it maybe it might help you...

Thank you. At first glance it looks like there are good examples for some of the higher level functions in both libraries in that thread. Right now I just have simple low level drivers and functions working.

Cheerful regards, Mike
 
Last edited:
i use vario board sometimes but havnt used the board you used before the laminated silk screen is a brill idea!! we have a laminator so nesxt time i use vario i will give it a go! what do you use to stick the screen to the board? and what program did you use for the layout as i didnt know you could get software to do boards like that. orrrrrrrr did you use something like eagle in a fancy way???? sorry for all the questions :D
 
i use vario board sometimes but havnt used the board you used before the laminated silk screen is a brill idea!! we have a laminator so nesxt time i use vario i will give it a go! what do you use to stick the screen to the board?

It's plastic shipping tape so I guess I probably shouldn't have said 'laminated'. Sorry!

... and what program did you use for the layout as i didnt know you could get software to do boards like that. orrrrrrrr did you use something like eagle in a fancy way????

I created a board in DipTrace (a PCB program) using the exact dimensions of that Radio Shack board. Then I printed the silk screen layer as an XPS file which retains precise dimensions when printed on a Laser Printer in one of the computer labs at school. Then I put the plastic tape on both sides and cut it out with a paper sheer. I've only tried this technique on a few boards so far...

Regards, Mike
 

Attachments

  • Proto LCD.jpg
    Proto LCD.jpg
    122.1 KB · Views: 161
  • Sequencer #1.JPG
    0 bytes · Views: 7
guess i got to track down some shipping tape :D thanks for the tip with the xps file thats gone in my workshop book ;) i showed dad the pic of the board he thinks it looks great as well has also solved the problem of how i am going to screen my controller :D i love it on here you can get some great info you just dont get in books :D
thanks again mr mike!
LG
 
Status
Not open for further replies.

Latest threads

Back
Top