Mozzi versus rotary encoder

225 views
Skip to first unread message

Robin Parmar

unread,
Feb 26, 2016, 7:04:32 PM2/26/16
to Mozzi-users
I am new to Mozzi and am trying to get it to work with a small library I use to handle rotary encoders. I am using an Arduino Uno and reverted to Arduino IDE 1.0.5-r2 after reading that might help compatibility. Basic Mozzi example sketches work fine. Pots and other sensors too.

My library MozziEncoder.cpp is based on Matthias Hertel's code, but I have modified it to support the push button feature of my encoders. Thus each encoder utilises a digital input pin (for the switch) as well as two analogue pins (for the encoder). In the library I have replaced millis() with mozziMicros(). The only Arduino functions in use are digitalRead() and pinMode().

I get no values out of the encoder at all. It is as though digitalRead() is broken.

Does anyone have a clue from this minimal account? My only alternative would be to post the entire library.

-- Robin

Tim Barrass

unread,
Feb 26, 2016, 11:19:25 PM2/26/16
to mozzi...@googlegroups.com
Hi Robin,
digitalRead() should work OK with Mozzi, it's in one of the examples>Mozzi>03.sensors>Piezo_Switch_Pitch.  Does your library rely on polling or waiting/counting cycles for a pin to change?  It's possible to work around it in Mozzi, if that's the problem.... though it might actually mean working around in your library to make it work in Mozzi.... let me know if that's barking up the wrong tree.

Tim

--
You received this message because you are subscribed to the Google Groups "Mozzi-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mozzi-users...@googlegroups.com.
To post to this group, send email to mozzi...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/mozzi-users/02e5b24b-e9b6-4939-9a5a-664c19dba59a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

flow in

unread,
Nov 11, 2019, 1:57:17 AM11/11/19
to Mozzi-users
did you get it fixed?

if not, post the library! 
Reply all
Reply to author
Forward
0 new messages