MCP1664 Click Board
MCP1664 Click Board
Regular price
£37.20
inc VAT
£31.00
exc VAT
Regular price
Sale price
Unit price
per
£37.20
inc VAT
£31.00
exc VAT
Order NOW to ship within 10 working days
The MCP1664 Click Board™ contains 4 high-power white LEDs. It carries the MCP1664, a high-voltage step-up LED driver from Microchip.
The MCP1664 Click Board™ is designed to run on either 3.3V or 5V power supply. It communicates with the target board microcontroller over the PWM pin on the MikroBUS lines.
Software Support
Code examples for the MCP1664 Click Board™, written for MikroElektronika hardware and compilers are available on Libstock.
CODE SNIPPET
This code snippet shows basic control of light brightness with PWM. The duty cycle is controlled with the potentiometer P1.
01 uint16_t current_duty; 02 uint16_t adc_rd; 03 void MCU_Init() 04 { 05 TRISC = 0; // designate PORTC pins as output 06 LATC = 0; // set PORTC to 0 07 PWM2_Init( 5000 ); // Initialize PWM2 module at 5KHz 08 } 09 void main() 10 { 11 MCU_Init(); 12 current_duty = 0; 13 PWM2_Start(); 14 PWM2_Set_Duty(current_duty); 15 while ( 1 ) // Playing with Potentiometer P1 you can control current PWM duty cycle 16 { 17 adc_rd = ADC_Read(1) & 0x0000FFFF; // Read 10 - bit ADC value and set newly acquired 8 - bit PWM duty 18 current_duty = adc_rd / 4 ; 19 PWM2_Set_Duty(current_duty ); // Set newly acquired duty 20 } 21 22 }
MCP1664 Click Board
Frequently Asked Questions
Have a Question?
Be the first to ask a question about this.