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: AverageAnalogIn PinDetect RotaryEncoder Sequence SequencerDisplay mbed-rtos mbed st7567LCD BaseMachineComon
Fork of BaseMachine_Sequencer by
Diff: main.cpp
- Revision:
- 7:ed01846ee0a5
- Parent:
- 6:fc10eac60b91
- Child:
- 8:de409197ff95
diff -r fc10eac60b91 -r ed01846ee0a5 main.cpp
--- a/main.cpp Thu Jun 23 09:41:18 2016 +0000
+++ b/main.cpp Thu Jun 23 10:20:49 2016 +0000
@@ -11,15 +11,19 @@
SPI spiMaster(SPI_MOSI, SPI_MISO, SPI_SCK);
Sequence sequence[SEQUENCE_N];
-SpiSequenceSender sequenceSender(&spiMaster, D9, sequence, SEQUENCE_N, 5);
+SpiSequenceSender sequenceSender(&spiMaster, D9, sequence, SEQUENCE_N, 10);
-Envelope envelope(4095, 25, 20, 10, 2047);
+Envelope envelope(4095, 10, 8, 4, 2047);
class TestClass {
public:
void callbackFunction(int ticks)
{
- printf("%d\r\n", ticks);
+ if (ticks == 0) {
+ envelope.init();
+ }
+ uint16_t level = envelope.update();
+ printf("%d\r\n", level);
}
} testClass;
@@ -43,8 +47,9 @@
sequence[11].setOctave(0);
sequence[15].setOctave(1);
+ envelope.init();
+
sequenceSender.attach(&testClass, &TestClass::callbackFunction);
-
sequenceSender.run(0);
for (;;) {
