Help with timings and interrupts

Hi guys, I am working on a project that lets you control lines on a CRT TV via ribbon potentiometers.

The lines on the screen are made from pulses from the output pins and synced with specific timings to work on a PAL CRT.

in my code, i want to be able to change the value of the delay that the pins are working on screen 1, however i think i need a const to use '_delay_us' and fro mthere i cant figure out any way to really change the value with the potentiometer? here is my code, hope you can help.

//Incorporate the delay library
#include <util/delay.h> 
// Set and define the synchronization signal and three-color output 
#define SYNC (PORTB = B00000000) 
#define WHITE (PORTB = B00000011) 
#define BLACK (PORTB = B00000001) 
#define GRAY (PORTB = B00000010) 

int readValue = 0;
volatile int value = 3025;
int potselect = A5;

void setup () { 
  // Set pins 8, 9 and 10 to digital output 
  // It is also possible to write DDRB = B00000011; 
  pinMode (8, OUTPUT); 
  pinMode (9, OUTPUT); 
  pinMode (10, OUTPUT);



void loop () { 

 readValue = analogRead(A5);
  Serial.print("A5 = ");

  // Sync, front and back margin settings 
  _delay_us (4); 
  _delay_us (5); 
  _delay_us (5) ; 

  // Screen display 1
  _delay_us (3025);        //these values must be changed via the ribbon pots
  _delay_us (3025); 
  _delay_us (3025); 

  Serial.print("A5 = ");


Not according to the documentation

The input parameter is an unsigned integer.

From wiring.c

/* Delay for the given number of microseconds.  Assumes a 1, 8, 12, 16, 20 or 24 MHz clock. */
void delayMicroseconds(unsigned int us)

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.