Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 1:2a346daf070f, committed 2017-10-05
- Comitter:
- kyancey
- Date:
- Thu Oct 05 15:21:03 2017 +0000
- Parent:
- 0:2af5c09cf1ee
- Commit message:
- Added some comments.
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Thu Oct 05 14:43:56 2017 +0000
+++ b/main.cpp Thu Oct 05 15:21:03 2017 +0000
@@ -22,11 +22,13 @@
waitUntilHigh(Clock);
}
+// The SNES expects unpressed buttons to have a high state.
+// 1 = unpressed, 0 = pressed
void sendButtonsPressed(int b, int y, int select, int start,
int up, int down, int left, int right,
int a, int x, int l1, int r1)
{
- Data = 1;
+ Data = 1; // Seems sensible to start with data being high
waitUntilHigh(Latch);
waitUntilLow(Latch);
@@ -47,6 +49,7 @@
int main()
{
while(1) {
+ // Repeatedly press A
sendButtonsPressed(1, 1, 1, 1, //b,y,select,start
1, 1, 1, 1, //up,down,left,right
0, 1, 1, 1); //a,x,l1,r1