|
Forum Index : Microcontroller and PC projects : AS5600 Magnetic Rotary Encoder Module
| Author | Message | ||||
| DaveJacko Regular Member Joined: 25/07/2019 Location: United KingdomPosts: 86 |
Hi MMBasic friends, I recently bought an AS5600 rotary magnetic encoder. Very pleased with it, easy to use (see my code) As a man who's fitted an accelerometer to the catflap, I'm always looking for like-minded souls. ( haha!.. think I've found a few in this shed ! ) Can we think of a good application for this module, maybe a weathervane, or an inverted pendulum.. '--------------------------------------------- ' AS5600 magnetic rotary encoder DPJ ' 3v3 4096 steps/360 deg ' agc ideally returning about 64 '--------------------------------------------- addr=&h36 'I2C address Dim agc,rah,ral,ang As integer 'ie auto gain control, angle high byte,low byte,result angle Pause 50 'power-up delay I2C open 100,100,PU 'set up I2C.. 'this is speed kHz,timeout ms, pullup rdlp: Pause 100 I2C write addr,0,1,&h1A 'select agc reg I2C read addr,0,1,agc I2C write addr,0,1,&h0C 'select raw ang reg I2C read addr,0,1,rah I2C read addr,0,1,ral ang=(rah<<8)+ral Print ang;" ";agc;" ";Chr$(13); GoTo rdlp Try swapping 2 and 3 over |
||||
| CaptainBoing Guru Joined: 07/09/2016 Location: United KingdomPosts: 2171 |
Hello and welcome... I am dying here |
||||
| Mixtel90 Guru Joined: 05/10/2019 Location: United KingdomPosts: 8298 |
You just gotta love someone with such dedication! ![]() Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
| Tinine Guru Joined: 30/03/2016 Location: United KingdomPosts: 1646 |
Neat device For multi-turn, the MCU would need to keep track though, right? |
||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |