Anyone speak Arduino?


+ Reply to Thread
Results 1 to 5 of 5

Thread: Anyone speak Arduino?250 days old

  1. #1
    Prolific Poster See_Mos's Avatar
    Join Date
    Feb 2004
    Posts
    1,280
    Thumbs Up
    Received: 16
    Given: 0
    Total Downloaded
    872.27 MB

    0 Not allowed!

    Default Anyone speak Arduino?

    Dirty word I know (Arduino)

    I am trying to convert some code to Proton, at one time when I was using C as well as Proton I may have been able to do it but now I am struggling. Can anyone enlighten me please?

    T = U2 > U1 ? U2 - U1 : U1 - U2
    My RAM is failing

Attention

This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

The advertisements we display are relevant to this web site and your browsing history

Please consider supporting us by disabling your ad blocker.


Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

If you can, please report issues in the forum area WebSite / Forum Issues


Thank you for your attention.

  • #2
    Prolific Poster See_Mos's Avatar
    Join Date
    Feb 2004
    Posts
    1,280
    Thumbs Up
    Received: 16
    Given: 0
    Total Downloaded
    872.27 MB

    0 Not allowed!

    Default Re: Anyone speak Arduino?

    OK, I think I worked that out as

    Code:
            If U2 > U1 Then
                T = U2 - U1
            Else
                T = U1 - U2
            EndIf
    Now for the next bit which is

    Float C = -(Float)T / Rx / Log(1.0 - (Float)Val / (Float)MAX_ADC_VALUE);

    T = variable time
    Rx = constant 50,000
    Val = variable ADC value
    Max_ADC_VALUE constant 1023
    Last edited by See_Mos; 12th February 2019 at 16:09.
    My RAM is failing

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #3
    Fanatical Contributor top204's Avatar
    Join Date
    Feb 2002
    Posts
    3,341
    Thumbs Up
    Received: 289
    Given: 139
    Total Downloaded
    1.60 GB

    0 Not allowed!

    Default Re: Anyone speak Arduino?

    It's not Arduino, it's GCC C++, but the vast majority of Arduino users have absolutely no idea of that, because they only know the buzz word. :-)

    That initial expression, come comparison, come assignment, got me many years ago, when I first saw it. :-) I still think it is a truly stupid syntax for a simple comparison and variable loading, but sometimes C and C++ are written by geeks of a major league. LOL I've seen code that is beyond belief with C++, and has obviously been written by someone with a "look at me aren't I really clever!" type of Ego attitude, not knowing that the asm code underneath is an absolute mess and would be a lot smaller and faster if the C++ code was written more inline.

    Compilers aren't magicians and they do not possess AI, so they have to make worse case scenarios in a lot of situations, which increases the asm code size.

    This below should do the same as the calculation, and seems to be the smaller of several ways:

    Code:
        Symbol Max_ADC_VALUE = 1023.0
        Symbol Rx = 50000.0
        
        Dim C As Float
        Dim T As Word = 1000
        Dim wVal As Word = 512
        Dim fTemp As Float
          
        fTemp = Log(1.0 - (wVal / Max_ADC_VALUE))
        C = (-T / Rx) / fTemp
        
    ' Float C = (-(Float)T / Rx) / Log(1.0 - (Float)Val / (Float)MAX_ADC_VALUE));
    I'm not sure if Log in the Avr C++ is the equivalent of Log or Log10, so try both. The fTemp looks like a quantasisation calculation.
    Last edited by top204; 12th February 2019 at 18:25.

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #4
    Prolific Poster See_Mos's Avatar
    Join Date
    Feb 2004
    Posts
    1,280
    Thumbs Up
    Received: 16
    Given: 0
    Total Downloaded
    872.27 MB

    0 Not allowed!

    Default Re: Anyone speak Arduino?

    It's not Arduino, it's GCC C++, but the vast majority of Arduino users have absolutely no idea of that, because they only know the buzz word. :-)
    Yes, I know, I was being flippant.

    Thanks for the code, I will give it a try later today
    My RAM is failing

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #5
    Prolific Poster See_Mos's Avatar
    Join Date
    Feb 2004
    Posts
    1,280
    Thumbs Up
    Received: 16
    Given: 0
    Total Downloaded
    872.27 MB

    0 Not allowed!

    Default Re: Anyone speak Arduino?

    I have put this to one side for now.

    My original idea was too simplified and I think I have found an alternative and better approach.
    My RAM is failing

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

    Thread Information

    Users Browsing this Thread

    There are currently 1 users browsing this thread. (0 members and 1 guests)

       

    Similar Threads

    1. Anybody speak Microchip?
      By towlerg in forum The Lounge
      Replies: 2
      Last Post: 14th August 2018, 12:48
    2. What is the fuss about arduino
      By yvesmazzon in forum The Lounge
      Replies: 29
      Last Post: 1st November 2017, 14:25
    3. TFT Display with PIC....NOT ARDUINO..!
      By BariRaul in forum Proton Plus Compiler v3
      Replies: 2
      Last Post: 23rd November 2015, 16:12
    4. StickyBUG for Firewing/Arduino
      By tumbleweed in forum The Lounge
      Replies: 1
      Last Post: 18th January 2015, 17:18
    5. arduino or dsPIC board???
      By Zain in forum Proton Plus Compiler v3
      Replies: 2
      Last Post: 25th June 2013, 09:11

    Members who have read this thread : 42

    Actions :  (Set Date)

    You do not have permission to view the list of names.

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts