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.
main.cpp
- Committer:
- M_souta
- Date:
- 2020-01-21
- Revision:
- 1:5b0303768126
- Parent:
- 0:db8d4af513c0
- Child:
- 2:32d2cd7d744b
File content as of revision 1:5b0303768126:
#include "mbed.h"
#include "Motor.h"
#include "MCP.h"
#include "XBee.h"
#define SDA PB_7
#define SCL PB_6
#define MCP_ADDRESS 0x40
MCP MCP(SDA, SCL, MCP_ADDRESS);
Serial pc(USBTX, USBRX);
XBEE::ControllerData *controller;
int main() {
for(int i = 0; i < 16; i++) {
MCP.PinMode(i, INPUT_PULLUP);
}
while(1) {
controller = XBEE::Controller::GetData();
MCP.Update();
/* write ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ */
//for(int i = 0; i < 16; i++) {
int a = MCP.Read(7);
pc.printf("%d",a);
//}
pc.printf("\n\r");
}
}