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.
Dependencies: EthernetInterface LM75B mbed-rtos mbed
Setup.cpp
- Committer:
- RobinMechele
- Date:
- 2018-03-16
- Revision:
- 2:ecc0c5c14bc1
- Parent:
- 1:db9b9bec0133
- Child:
- 3:fbf3c92f10ee
File content as of revision 2:ecc0c5c14bc1:
#include "setup.h" #include "lcdcontrol.h" BusIn joy(p15,p12,p13,p16); DigitalIn fire(p14); LcdControl lcd; char tester[] = "192.168.0."; Setup::Setup() :tempID("100") { //Constructor } int Setup::chooseID() { int setID = 100; lcd.lcdReset(); lcd.printID(setID); while(fire==0) { if(joy.read() == 1) { lcd.lcdReset(); if(setID == 110){ setID = 100; } else{ setID++; } lcd.printID(setID); wait(0.3); } if(joy.read() == 2) { lcd.lcdReset(); if(setID == 100){ setID = 110; } else{ setID--; } lcd.printID(setID); wait(0.3); } } while(fire != 0){} return setID; } int Setup::chooseMode() { lcd.printMode(); lcd.printSlave(); while(fire != 0){} while(fire == 0){ if(joy.read() == 8) { if(mode == 1){ mode=0; lcd.printMode(); lcd.printSlave(); } } else if(joy.read() == 4) { if(mode == 0){ mode=1; lcd.printMode(); lcd.printMaster(); } } } return mode; } char* Setup::convertToIP(int ID) { sprintf(tempID,"%ld",ID); return strcat(tester,tempID); }