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
Code Exchange
  • Technologies
  • More
Code Exchange
Forum Python 3 code Question
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Code Exchange to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Suggested Answer
  • Replies 12 replies
  • Answers 3 answers
  • Subscribers 51 subscribers
  • Views 2601 views
  • Users 0 members are here
  • Code Exchange
Related

Python 3 code Question

ellip
ellip over 8 years ago

Hi.  I am new to the Raspberry Pi.  I have a Raspberry Pi 3 and a PiFace 2.  I am trying to update a Christmas decoration made over 40 years ago by my father. It was run by a rotisserie motor and a wooden cylinder with copper strips and screws to make contact and light the stars up in sequences.

 

I have 5 stars in the following formation:

 

     1          2

 

          5

 

     4          3

 

I am trying to have the stars light up in a certain sequence with a small delay in between each function

 

1

2

3

4

5

1,2,3

2,3,4

3,4,1

4,1,2

1,2,5

2,3,5

3,4,5

4,5,1

1,2,3,4,5

then begin the sequence again.

I have tried following as many of the posts as I can and receive errors on everything from syntax to int and tuples.

I am sure that it is something that is simple to the rest of you but just eludes me.  Any help in any way will be greatly appreciated.

Elli

  • Sign in to reply
  • Cancel

Top Replies

  • jdlui
    jdlui over 8 years ago +3 suggested
    Hi Ellen, Suggestion: With any problem I think it's helpful try and break things into pieces. Share more info with us on what you've tried, what isn't working, what code you are using. I.E. Have you tested…
  • mgillett
    mgillett over 7 years ago in reply to dougw +3
    I appreciated the two of you demonstrating two solutions to this problem. Further I appreciate seeing the first examples of going line by line through the code then the "better" coding style making the…
  • urkraft
    urkraft over 8 years ago in reply to urkraft +1 suggested
    To Douglas Wong: Sorry, i see now that your post was not directed to me. Was not very focused when i read it. I did notice that there was a very important bug in my code in that it did not handle interrupts…
Parents
  • urkraft
    0 urkraft over 8 years ago

    To Douglas Wong:

     

    Strange, the code resulted in the exact sequence specified. If you had bothered to test the code that i published you would have seen that it did actually produce the specified sequence - and with much less code than the gobeltygoop you posted to "correct" me!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • dougw
    0 dougw over 8 years ago in reply to urkraft

    sorry - I didn't see your code before posting. My code was not trying to be efficient, just an easy extrapolation of the working code.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • urkraft
    0 urkraft over 8 years ago in reply to dougw

    You did nothing wrong whatsoever - it was my bad.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • mgillett
    0 mgillett over 7 years ago in reply to dougw

    I appreciated the two of you demonstrating two solutions to this problem. Further I appreciate seeing the first examples of going line by line through the code then the "better" coding style making the project much simpler. By following the first examples it helped me to understand the steps that needed to take place then writing in an array allowed to follow the same process. Thanks for helping those who are struggling to learn some of the basic functions.

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • mgillett
    0 mgillett over 7 years ago in reply to dougw

    I appreciated the two of you demonstrating two solutions to this problem. Further I appreciate seeing the first examples of going line by line through the code then the "better" coding style making the project much simpler. By following the first examples it helped me to understand the steps that needed to take place then writing in an array allowed to follow the same process. Thanks for helping those who are struggling to learn some of the basic functions.

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
No Data
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