Jump to content
ELFORUM - Forumul electronistilor
Gilbert Sparios

SoftwareSerial + Encoder rotative

Recommended Posts

Am pe un arduino uno, mai bine zis un ESR T3, libraria 8glib2 cu un ecran pe HW SPI, SoftwareSerial pentru RS485 si un buton cu push si encoder. 

 

eu de regula citeam encoder-ul cu vector compa cu variabile volatile si procesam in loop. numai ca acum SoftwareSerial deja folosește compa_vect pe toate ISR. 

 

Pinii 2 si 3 sunt luați de display.. ca de altfel si pinul zero deci fără hardware serial.. 

 

Ce posibilitate as mai avea sa citesc si encoder-ul? Eu ca soluție am modificat librăria SoftwareSerial, am transformat-o in alta clasa plus am adaugat  o clasa pentru encoder.. si merge dar.. nu sunt prea mulțumit ca fac citiri acolo cu digitalRead.. 

 

In afara de asta, ce soluție ar mai fi? 

Link to post
Share on other sites

Daca nu mai ai disponibil nimic cu hardware ISR nu prea ai cum sa-l legi, din software nu vei putea procesa destul de rapid. Singura solutie e cu modul extern, fie iti faci singur cu un PIC12F un slave I2C care sa monitorizeze encoder-ul sau gasesti placute gata facute: https://www.ebay.com/itm/I2C-Encoder-Mini-connect-rotary-encoders-on-i2c-bus/174208386412?hash=item288fa1056c:g:CoQAAOSwPlFeXVTT 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.Terms of Use si Guidelines