EXAMPLE Rhythmic delay

@giovanni Thanks for making a more 'proper' version of the program. 99% of the coding I have done in the past has been in python, so my C code doesn't utilize a lot of the more C specific things like pointers and references since I don't know a lot about them.

Do you have a full version of a working program after your refactoring posted somewhere? I tried to combine the code parts you posted with appropriate #include/#define headers but could not get things to work after messing with it a bit.
 

giovanni

Well-known member
Do you have a full version of a working program after your refactoring posted somewhere? I tried to combine the code parts you posted with appropriate #include/#define headers but could not get things to work after messing with it a bit.
Hey still haven’t had time (having some laptop issues). Did you try just pasting all the code I posted in the main file? That worked for me when I tested it the first time.
 

giovanni

Well-known member
OK sorry for the delay. I wasn't able to setup my laptop yet, so I decided to at least make sure the code I wrote compiles in a repl. Here's my repl code. Also find the same code attached, just in case. Now, one massive disclaimer: I have not tested the delay code yet. I also haven't compiled it against the Daisy APIs yet, but I made some quick mocks for them (I used the Daisy docs to match the API) so that the code would compile. The only things you need to do to use my example is to comment the mocks (see code comments); add the appropriate #includes for Terrarium, Daisy, DelayLine, etc.; uncomment the while loop in main. Once I get my laptop setup for Daisy dev, I will revisit this, but let me know if it works as is.
 
Top