Jump to content

Swapping between words


thedarkshade

Recommended Posts

Hi everyone

 

I've had this project on controlling the light intensity with a microcontroller, using phase control. I've build the zero-cross detector and the circuitry to interface with the light via an optocoupler (MOC3023) and a triac (BT138), but I'm a little stuck on the software. I'm using an on-board potentiometer to control the intensity and a 12bit ADC to get the digital value, but I think I can easily complete by having an 8bit value.

So my point of concern is how do I change this 12bit value into an 8bit one?

Any help at all would be greatly appreciated :)

 

TDS

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.