Compare commits

..

No commits in common. "0ceb20bcf17d94899735be067b98f1c0cfc75b7b" and "557bad83872bd2d38a627e138822d6a522f53518" have entirely different histories.

57 changed files with 0 additions and 58696 deletions

View File

@ -1,15 +0,0 @@
Fred Bloggs 73
Michael Smith 43
Claire White 64
Simon Black 23
Joshua Mason -20
Jenny Jones 57
George Clark 40
Ann Bell 101
Fay Allen 52
John Morris 60
Steven Hayes 47
Hannah Jackson 94
Alex Benson 50
Susan Baker 70
Wendy Brooks 57

View File

@ -1,27 +0,0 @@
12
0
12.343
1
13.574
2
14.359
3
14.367
4
15.694
5
17.489
6
19.486
7
20.427
8
21.759
9
20.402
10
19.444
11
18.736
12
17.445

View File

@ -1 +0,0 @@
The quick brown fox jumped over the lazy dog!

Binary file not shown.

Before

Width:  |  Height:  |  Size: 352 KiB

View File

@ -1,19 +0,0 @@
#include <avr/io.h>
void setup()
{
DDRB |= (1<<7); // Set pin 13 as output
TCCR1A = (1<<WGM11) | (1<<COM1C1);
TCCR1B = (1<<WGM12) | (1<<WGM13) | (1<<CS10);
TCCR1C = 0; // No force output compare
ICR1 = 799; // Set PWM frequency noting prescale if any
OCR1C = 79; // Set PWM duty cycle as a fraction of ICR1
}
void loop()
{
}

View File

@ -1,53 +0,0 @@
// Program to generate and count pulses using hardware only.
// Also uses interrupt to handle register overflow.
// For Arduino Mega only, as T/C 1 Compare Output Channel C is linked to pin 13.
// Frequency generation loosely based on code within "Newbie's Guide to AVR Timers".
// The code is revised by Abdelkhalick Mohammad for MMME3085 Module.
#include <avr/io.h>
unsigned long bigLaps; // To record how many times T/C5 overflows
void setup()
{
Serial.begin(9600);
// ===Timer/Counter 5 settings to count input pulses ====
//set pin T5 as input (external); this is pin 47 (Arduino Mega pin mapping)
pinMode(47, INPUT);// set pin to input
TCCR5A=0;// No waveform generation needed (T/C is counting only)
TCCR5B=(1<<CS50)|(1<<CS51)|(1<<CS52);// Normal mode, external clock on rising edge
TCCR5C=0;//No force output compare (we will not study about this in the module)
TCNT5=0;//Initialise counter register to zero
TIMSK5=(1<<TOIE5);//When the T/C reach its maximum, an interrupt will be activated
bigLaps=0;//When an overflow happens, we will increase this bigLaps by 1
sei();// Enable all active interrupts
// === Timer/Counter 1 settings to generate pulses with different frequencies ===
DDRB|=(1 << 7);//T/C1 channel C is connected to pin 13, set it as output
TCCR1B=(1 << WGM12 );//Configure T/C1 for CTC mode
TCCR1A=(1 << COM1C0 );//Enable T/C1 Compare Output channel C in toggle mode
// OCR1A= 7;//Set CTC compare value to 2 MHz at 16MHz AVR clock with no prescaling
// TCCR1B|= (1 << CS10 ) ;//Start T/C1 at Fcpu with no prescaling (i.e., 16MHz)
OCR1A=1249;//Set CTC compare value to 200 Hz at 16MHz AVR clock with 1/64 prescaling
TCCR1B|= (1 << CS10 )|(1 << CS11 );// Start T/C1 at Fcpu (i.e., 16MHz)
}
// === This is a routine which will be called if an overflow happens in T/C5 ===
ISR(TIMER5_OVF_vect )
{
bigLaps++; //when this runs, you had 65365 pulses counted
}
unsigned long Current_Count=0;//A variable to store the total number of pulses
void loop() {
Current_Count = TCNT5 + bigLaps*65536;
Serial.println(Current_Count); // Print the current number of pulses
delay(1000); // Intervals between each two consecutive prints
}