element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum What gets in the way of your Raspberry Pi project?
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 71 replies
  • Subscribers 661 subscribers
  • Views 16977 views
  • Users 0 members are here
  • pico
  • projects
  • raspberry pi
  • zero
  • introduction
Related

What gets in the way of your Raspberry Pi project?

cstanton
cstanton over 3 years ago

For those following along, it's become a bit of a daisy chain...

It's been about 10 years since the Raspberry Pi was released to the world, and I remember everyone being excited. It was a mixture of miscommunication, promises and new technology. An affordable embedded computer that was the size of a credit card. A lot of heated debate about open source and availability, and plenty of marketing. It hit off very well, and everyone clamored to get one, and somewhat still do, and support it. With open source libraries, packages and Linux, quite the contrast to similar boards released around the same time - I think it says a lot when someone has a project and decides 'no, this is how you do it' and leads with a direction and decision and doesn't leave it open for the herd of cats.

Still, a lot of people I know have a collection of Raspberry Pi, and the meme goes 'Yes I have one, it's sat in my drawer collecting dust, I don't know what to do with it' or 'I use it for my media server... and that's about it'. While using a Raspberry Pi as a media server is not a bad thing, it's rather justified (and frankly has spun off a lot of similar products since) it's not the only thing to use a Raspberry Pi for.

Now there's a lot of accessories available, a lot of example code (like other microcontroller boards) but there still must be something about it that trips you up when creating that project. Is it limitations with the hardware? (it is mostly 3v3 after all) or is it the physical size of it? (the compute module, pico and zero start addressing this) well right now it's obviously the availability (or lack) of it, but we can't address that right now, so let's focus on what we do with it when we have one.

We're looking at expanding our content and what we ask from Raspberry Pi (Foundation/Trading) to govern our campaigns and content on the Community, and I'm interested in what you need help with, so reply and let us know, regardless of knowledge level or what you've been doing.

  • Sign in to reply
  • Cancel
Parents
  • phoenixcomm
    phoenixcomm over 3 years ago

    Python of course, I hate it! its childish.  you have to indent for levels you have to be kidding me, and NO semicolon. So where is the end of the statement. RUBBISH ! its almost as bad as BASIC! LOLJoy  I just use C with eclipse!  You Cant do this in Python:

    for(i, I < 100){ printf("i \n", %n);} return; 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • beacon_dave
    beacon_dave over 3 years ago in reply to phoenixcomm
    phoenixcomm said:

    You Cant do this in Python:

    for(i, I < 100){ printf("i \n", %n);} return;

    I'm pretty sure that you can make typo's in Python as well... Slight smile

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • michaelkellett
    michaelkellett over 3 years ago in reply to phoenixcomm

    I think you mean:

    image

    I had to embedd the code as a picture, the E14 insert code thing removed the files from the includes !

    %i would work but I used d to avoid conusion with iterator i,

    The u typing on the numeric constants is a bit of MISRA pedantry. I've got into the habit !

    It's best to initialise the iterator in the for statement, rather than the declaration, so that some time later on, when the code gets modified no one gets caught out.

    Pedantic style guides say that you should never use i or j or k as iterators but give them proper names like  line_number or self_destruct_counter.

    I still use i

    MK

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • Cancel
  • Jan Cumps
    Jan Cumps over 3 years ago in reply to michaelkellett
    michaelkellett said:

    Pedantic style guides say that you should never use i or j or k as iterators but give them proper names like  line_number or self_destruct_counter.

    I still use i

    I do the same, if the iterators are just that, a counter to loop trough a number of items. When the loop has multiple levels, I may use outer and inner. When it has an obvious meaning, I may call it pageIndex, ..

    But most of the times i, j, k Slight smile

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Cancel
  • beacon_dave
    beacon_dave over 3 years ago in reply to phoenixcomm

    image

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • cstanton
    cstanton over 3 years ago in reply to michaelkellett
    michaelkellett said:

    I had to embedd the code as a picture, the E14 insert code thing removed the files from the includes !

    #include <stdint.h>
    #include <stdio.h>
    
    uint8_t i;
    
    for (i=0u; i<100u; ++i)
    {
        printf("%d \n", i);
    }
    

    It looks like it does when you first insert it, but it does it properly when you post it Slight smile

    • Cancel
    • Vote Up +4 Vote Down
    • Sign in to reply
    • Cancel
  • Jan Cumps
    Jan Cumps over 3 years ago in reply to cstanton

    I think the difference is between Insert -> Code and Format -> Formats -> Inline -> Code

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • beacon_dave
    beacon_dave over 3 years ago in reply to scottiebabe

    I'm sure it will be fixed in 'Birdhouse v2.0' Slight smile

    No malice was ever intended. I'm interested in the whole concise vs verbose code thing and how it affects typos and code readability.

    Also interested in perceptions of different programming languages. I tend to see them as different tools for different tasks.

    More so amazed that I even spotted it given that I've mainly been reading up on VHDL/Verilog code recently and not on C. I think I've been rewiring my brain instead of the FPGA fabric... Slight smile

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • Cancel
  • michaelkellett
    michaelkellett over 3 years ago in reply to colintapp

    I'm interested in your suggestion that a Python programe (large or small) could be proven correct. I am unaware that any proven correct Python compilers or interpreters exist (enlighten me if you know of any).

    There have been claims of provably correct C compilers and other tools.

    There is dispute that any useful programme can be proven correct.

    some links:

    https://stackoverflow.com/questions/4065001/are-there-any-provable-real-world-languages-scala

    https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5597727/

    But you could spend the rest of your life on this - many will.

    MK

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • colintapp
    colintapp over 3 years ago in reply to michaelkellett

    No python compiler I know of is able to prove a program correct. What is needed is code that can be proven correct against specs and is maintainable if specs change or bugs appear. Python has a number of useful feature such as control of scope of variables, very strict type checking, inheritance to allow modules to be expanded from already proven modules, automatic memory allocation, automatic garbage collection etc... Proving code is correct is all about having a good spec and a test harness that can test against the spec - a larger job than writing the code in the first place. It can be done in any language. Some make it easier than others. I believe Ian Barron, the founder of Inmos claimed that the transputer could be proven to be correct but didn't ever do so. The only processor I know that was claimed to be mathematically proven correct was the viper ( years ago ) but that was found to have a bug. p.s. I think the first Verilog complier was a hacked C compiler. Hence the similarities with C, although system verilog and Python have a number of similar design concepts.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • michaelkellett
    michaelkellett over 3 years ago in reply to colintapp

    We haven't even got off first base with Python, a "proven correct Python compiler" isn't one which proves (or not)  other programmes to be correct. The issue is that (as far as I know) there is no Python compiler available which can be proved to correctly compile Python code.

    Testing code does not prove it to be correct. Testing may give you some (non quantifiable) confidence about the number of errors in your code.

    I'm not an expert on this but I would suggest that since high rel applications use only a subset of Ada (the whole thing being too risky) it is very unlikely to be even possible to write provably correct code in Python.

    This doesn't mean that Python can't be useful - almost no code at all (possibly none) is provably correct.

    Features like garbage collection make it very difficult to prove a compiler correct.

    Relevant discussion on Stackoverflow:

    https://stackoverflow.com/questions/69673807/python-coding-standard-for-safety-critical-applications

    MK

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • dougw
    dougw over 3 years ago in reply to michaelkellett

    I think Ada (the programming language) was developed such that the compiler caught everything, but I have never tried it to see how close they came.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • dougw
    dougw over 3 years ago in reply to michaelkellett

    I think Ada (the programming language) was developed such that the compiler caught everything, but I have never tried it to see how close they came.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
  • Jan Cumps
    Jan Cumps over 3 years ago in reply to dougw

    It's impossible. Also impossible to assess how close you are from an unachievable goal.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube