Tag: Arduino Nano

Sending struct via SPI between Arduino Nano and Arduino Mega 2560

In this experiment, Arduino Nano is SPI Master, sending structured data (struct customMessage) via SPI link to Arduino Mega 2560, which is SPI Slave. The struct is wrapped into union allowing byte level access, used both to read and to write data used in SPI transfer. typedef struct customMessage { unsigned int parameterA; unsigned int…

Controlling 8 digital potentiometers using shift register to save pins

digPotCluster class is part of imbAVR.SynthControl library, in imbAVR.ArduinoSynth GitHub repository. It controls 8 digpots (MPC410-10) using shift register (74CH595N). Purpose of shift register is to reduce number of pins used for CS (chip selection): Normally, you would use 2 (SCLK, MOSI) + 8 (CS for each MPC410-10) = 10 pins Like this, you use…