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.
Fork of scoreLight_Advanced by
Diff: hardwareIO/hardwareIO.h
- Revision:
- 42:c4e9c1116af4
- Parent:
- 35:35af5086ab4f
- Child:
- 44:46e25fa1669b
diff -r 32c80fc09b59 -r c4e9c1116af4 hardwareIO/hardwareIO.h
--- a/hardwareIO/hardwareIO.h Wed Mar 26 10:04:01 2014 +0000
+++ b/hardwareIO/hardwareIO.h Fri Mar 28 10:18:38 2014 +0000
@@ -4,18 +4,22 @@
#include "mbed.h"
#include "lockin.h"
+#include "CRotaryEncoder.h"
-// potentiometer to change sensitivity by hand, or other things.
+// potentiometer to change sensitivity by hand, or other things... ACTUALLY THIS IS NOT WORKING because I cannot switch back and forth from
+// burst mode of analog conversion and "normal" one. Better use a rotary encoder!!
#define POT_ANALOG_INPUT p15 // note: analog inputs in the mbed are from 15 to 20
-// switches triggering interrupt functions:
+// Momentary switches triggering INTERRUPT functions:
// (Any of the numbered mbed pins can be used as an InterruptIn, except p19 and p20)
// NOTE: do not use pins from p21 to p26 because they are all set as pwm output (see lockin.h)
#define LED_SWITCH_ONE p9 // digital output pin
#define SWITCH_ONE p10 // interrupt pin
#define SWITCH_TWO p11 // interrupt pin
+// Two state switch:
+#define TWO_STATE_SWITCH p24
// NOTE: the SPI library uses the following pins, but we don't have to set them and inputs or outputs (this is done when the library is initialized, which is done by pre-instantiation.
#define SCK_PIN p7 //SPI Clock
@@ -148,18 +152,25 @@
*/
//float refFreq; // could be private
+
+ // Interrupt "momentary" switches:
+ bool switchOneState, switchTwoState;
bool switchOneChange, switchTwoChange;
void switchOneInterrupt();
void switchTwoInterrupt();
bool switchOneCheck(bool& state);
bool switchTwoCheck(bool& state);
void setSwitchOneState(bool newstate);
+
+ // two state switch:
+ bool twoStateSwitchState;
+ bool twoStateSwitchChange;
+ bool twoStateSwitchCheck(bool& stateswitch);
+ // Potentiometer (does not work!!)
unsigned char updatePotValue(); // the value will be ajusted in the range 0-255
unsigned char potValue;
- bool switchOneState, switchTwoState;
-
private:
//DigitalOut Laser_Red, Laser_Green, Laser_Blue;
