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-18
- Revision:
- 6:4f13276fd1e2
- Parent:
- 5:665ba017d54e
- Child:
- 8:556a5738c2fa
File content as of revision 6:4f13276fd1e2:
#include "setup.h" BusIn joy(p15,p12,p13,p16); DigitalIn fire(p14); LcdControl lcd; Setup::Setup() :tempID("100"), partOfIP("192.168.0.") { //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.printMasterSlave(mode); while(fire != 0){} while(fire == 0){ if(joy.read() == 8) { if(mode == 1){ mode=0; lcd.printMode(); lcd.printMasterSlave(mode); } } else if(joy.read() == 4) { if(mode == 0){ mode=1; lcd.printMode(); lcd.printMasterSlave(mode); } } } return mode; } char* Setup::convertToIP(int ID) { sprintf(tempID,"%ld",ID); return strcat(partOfIP,tempID); }