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.
Diff: PositionSensor/PositionSensor.cpp
- Revision:
- 1:b8bceb4daed5
- Parent:
- 0:4e1c4df6aabd
- Child:
- 3:6a0015d88d06
diff -r 4e1c4df6aabd -r b8bceb4daed5 PositionSensor/PositionSensor.cpp
--- a/PositionSensor/PositionSensor.cpp Fri Feb 05 00:52:53 2016 +0000
+++ b/PositionSensor/PositionSensor.cpp Fri Feb 05 01:04:57 2016 +0000
@@ -25,7 +25,7 @@
TIM3->CR1 = 0x0001; // CEN(Counter ENable)='1' < TIM control register 1
TIM3->SMCR = TIM_ENCODERMODE_TI12; // SMS='011' (Encoder mode 3) < TIM slave mode control register
- TIM3->CCMR1 = 0xf1f1; // CC1S='01' CC2S='01' < TIM capture/compare mode register 1
+ TIM3->CCMR1 = 0xf1f1; // CC1S='01' CC2S='01' < TIM capture/compare mode register 1, maximum digital filtering
TIM3->CCMR2 = 0x0000; // < TIM capture/compare mode register 2
TIM3->CCER = 0x0011; // CC1P CC2P < TIM capture/compare enable register
TIM3->PSC = 0x0000; // Prescaler = (0+1) < TIM prescaler
@@ -38,12 +38,10 @@
ZPulse->enable_irq();
ZPulse->rise(this, &PositionSensorEncoder::ZeroEncoderCount);
ZPulse->mode(PullDown);
- //TIM5->CCMR1 = 0xf1f1; // CC1S='01' CC2S='01' < TIM capture/compare mode register 1
- ZTest = new DigitalOut(PC_2);
- ZTest->write(1);
- //int state = 0;
+ //ZTest = new DigitalOut(PC_2);
+ //ZTest->write(1);
}
@@ -73,8 +71,8 @@
if (ZSense->read() == 1){
if (ZSense->read() == 1){
TIM3->CNT=0x8000;
- state = !state;
- ZTest->write(state);
+ //state = !state;
+ //ZTest->write(state);
}
}
}
\ No newline at end of file