- This topic is empty.
October 2, 2013 at 1:51 am #22658
Dan in CAParticipant
The October 1 2013 update to the Python Interval Program is now available on GitHub.
This update will not affect most users.
If you have added hardware or made changes to the program code that reference the GPIO pins on the Raspberry Pi Please take note.
The pin numbering option in the RPi.GPIO Python module has been changed from BCM to BOARD. This means that references to pins on the P1 pin header now use the simpler numbering system based on physical pin locations rather than references to the pins on the processor chip.
Here’s what the RPi.GPIO documentation has to say:
There are two ways of numbering the IO pins on a Raspberry Pi within RPi.GPIO. The first is using the BOARD numbering system. This refers to the pin numbers on the P1 header of the Raspberry Pi board. The advantage of using this numbering system is that your hardware will always work, regardless of the board revision of the RPi. You will not need to rewire your connector or change your code.
The second numbering system is the BCM numbers. This is a lower level way of working – it refers to the channel numbers on the Broadcom SOC. You have to always work with a diagram of which channel number goes to which pin on the RPi board. Your script could break between revisions of Raspberry Pi boards.
I don’t like to make changes like this so far along in the project but the advantages going forward include more reliable program code, elimination of hardware differences between board revs, and simplification of the code. It eliminates the need for the board rev checking function which I added to keep users from having to edit the code in order to use a rev 1 board.
I have made a pin numbering diagram to hopefully ease the transition for anyone who has added connections to the GPIO pins or modified the code.
[attachment=0:1gk19wjt]P1 pin numbers.jpg[/attachment:1gk19wjt]
To make your modifications work, you just need to change the pin numbers in the program code.
From the README:
1. Changed the pin numbering option in the RPi.GPIO module from BCM to BOARD.
Files that were changed in this update:
See the Wiki for update instructions:
DanOctober 3, 2013 at 10:10 pm #25628
Did a git pull, then fixed up the conflict with my pin number additions for the rain sensing, door sensing, and door control. Merged my changes.
Git status says
# On branch master
# Your branch is ahead of ‘origin/master’ by 5 commits.
nothing to commit (working directory clean)
Everything seems to be running fine. Rain is being sensed (it’s been raining here), and I can toggle the door up and down.
Thanks for the update.
DennyOctober 4, 2013 at 12:04 am #25629
Dan in CAParticipant
I’m glad the update went OK for you.
There are some cool changes in the pipeline and you will be set to take advantage of them.
- You must be logged in to reply to this topic.