electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Articles  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links  |  Store
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
 Forum index » DIY Hardware and Software » Arduino
watch this space.
Post new topic   Reply to topic
Page 1 of 1 [3 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
bubzy



Joined: Oct 27, 2010
Posts: 558
Location: United Kingdom
Audio files: 63

PostPosted: Sun Mar 02, 2014 2:37 am    Post subject: watch this space. Reply with quote  Mark this post and the followings unread

....


photo.JPG
 Description:
 Filesize:  388.77 KB
 Viewed:  75 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

photo.JPG



_________________
_Richard_ Smile
Back to top
View user's profile Send private message
mosheen



Joined: Jun 19, 2013
Posts: 19
Location: NC

PostPosted: Mon Mar 24, 2014 1:02 pm    Post subject: Reply with quote  Mark this post and the followings unread

It's pretty rude to read someone's mind without permission. Very Happy

I had the same exact idea for my sequencer. I've got a giant bag of rotary encoders for the project. Any tips on how to multiplex that many encoders? I have ideas but was looking for more.
Back to top
View user's profile Send private message
bubzy



Joined: Oct 27, 2010
Posts: 558
Location: United Kingdom
Audio files: 63

PostPosted: Mon Mar 24, 2014 3:19 pm    Post subject: Reply with quote  Mark this post and the followings unread

Code:
// ROTARY ENCODER TEST
int lastForwards[8];
int forwards[8];
int backwards[8];
#define maxRotaries 2
#define A 2
#define B 3
#define C 4 //pins for output to mux#1
#define muxOneIn 5
int counter[8] ; //test variable
int values[8][3] = {
  { 0,0,0 },
  { 1,0,0 },
  { 0,1,0 },
  { 1,1,0 },
  { 0,0,1 },
  { 1,0,1 },
  { 0,1,1 },
  { 1,1,1 }
};
 

void setup()
{
  pinMode(A,OUTPUT);
  pinMode(B,OUTPUT);
  pinMode(C,OUTPUT);
  pinMode(muxOneIn, INPUT_PULLUP);
  Serial.begin(115200);
}

void loop()
{
  for(int i = 0 ; i <=maxRotaries; i+=2)
  {
   forwards[i] = getMuxData(i+0);
   backwards[i] = getMuxData(i+1);
  if(!forwards[i] && lastForwards[i])
  {
    if(backwards[i])
    {
      counter[i]++;
          Serial.print(i,DEC);
          Serial.print(" : ");
    Serial.println(counter[i]);
    }
    else
   {
    counter[i]--;
          Serial.print(i,DEC);
          Serial.print(" : ");
    Serial.println(counter[i]);
   }
   
  }
  lastForwards[i] = forwards[i];
 
 
  ////TEST 2
  }
}

int getMuxData(int data)
{
  digitalWrite(A,values[data][0]);
  digitalWrite(B,values[data][1]);
  digitalWrite(C,values[data][2]);
  int muxValue = digitalRead(muxOneIn);
  return muxValue;
}


kinda works, might need some tweaking Smile

_________________
_Richard_ Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic
Page 1 of 1 [3 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software » Arduino
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
e-m mkii

Please support our site. If you click through and buy from
our affiliate partners, we earn a small commission.


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use