mybook4 / DigisparkSketches

Some digispark(pro) sketches
GNU General Public License v2.0
20 stars 3 forks source link

Use of GBS Control without the switch #1

Open dwardman opened 8 years ago

dwardman commented 8 years ago

Hi mybook4,

Can you assist in the use of your code without creating a switch? If i just need 240p all day, how could i implement that from your code? Can i select a default? I basically only want to wire SDA SCL and Ground to GBS.

Thanks, Dwards

flagoss commented 8 years ago

Everything is in the SETUP section of GBS_Control.ino

void setup() {

// We setup and read the value of the Resolution switch // to determine if we are initially going // to write 240p or 480i settings to the scaler chip RESOLUTION_SWITCH_DDR &= ~(1<<RESOLUTION_SWITCH_BIT); // Set the resolution switch to an input RESOLUTION_SWITCH_PORT &= ~(1<<RESOLUTION_SWITCH_BIT); // Turn off internal pullup (we already have resistors in the debounce circuit). PULL UPs MAY NEED TO BE ENABLED FOR YOUR CIRCUIT bool currentResolutionSwitchState = ((RESOLUTION_SWITCH_PIN & (1<<RESOLUTION_SWITCH_BIT)) != 0); // Read the value of the Resolution switch

// NOTE: If a resolution switch isn't wanted, simply comment out the three code lines above and uncomment one the following lines //bool currentResolutionSwitchState = true; // 240p //bool currentResolutionSwitchState = false; // 480i

Same code with 240p always active:

void setup() {

// We setup and read the value of the Resolution switch // to determine if we are initially going // to write 240p or 480i settings to the scaler chip //RESOLUTION_SWITCH_DDR &= ~(1<<RESOLUTION_SWITCH_BIT); // Set the resolution switch to an input //RESOLUTION_SWITCH_PORT &= ~(1<<RESOLUTION_SWITCH_BIT); // Turn off internal pullup (we already have resistors in the debounce circuit). PULL UPs MAY NEED TO BE ENABLED FOR YOUR CIRCUIT //bool currentResolutionSwitchState = ((RESOLUTION_SWITCH_PIN & (1<<RESOLUTION_SWITCH_BIT)) != 0); // Read the value of the Resolution switch

// NOTE: If a resolution switch isn't wanted, simply comment out the three code lines above and uncomment one the following lines bool currentResolutionSwitchState = true; // 240p //bool currentResolutionSwitchState = false; // 480i