Make: AVR Programming by Elliot Williams
Author:Elliot Williams
Language: eng
Format: epub, mobi, pdf
ISBN: 9781449355784
Publisher: Maker Media, Inc.
Published: 2014-03-25T16:00:00+00:00
The header
The header file’s contents are shown in Example 11-3.
Example 11-3. servoSundial.h listing
/* Quasi-realtime-clock with servo sundial. */ // ------- Includes -------- // #include <avr/io.h> // ------- Defines -------- // #define PULSE_MIN 1000 /* experiment with these values */ #define PULSE_MAX 2000 /* to match your own servo */ #define PULSE_RANGE (PULSE_MAX - PULSE_MIN) #define PULSE_OVER 3000 /* Must be larger than PULSE_MAX */ #define START_TIME 10 /* 10 am */ #define STOP_TIME 22 /* 10 pm */ #define HOURS_RANGE (STOP_TIME - START_TIME - 1) #define LASER PB2 #define LASER_PORT PORTB #define LASER_DDR DDRB #define SERVO PB1 #define SERVO_PORT PORTB #define SERVO_DDR DDRB #define OVERFLOWS_PER_SECOND 31250 /* nominal, should calibrate */ // -------- Global Variables --------- // volatile uint16_t ticks; volatile uint8_t hours = 15; /* arbitrary default time */ volatile uint8_t minutes = 42; volatile uint8_t seconds = 57; // Serial input and output functions void pollSerial(void); void printTime(uint8_t hours, uint8_t minutes, uint8_t seconds); // Servo setup and utility functions void initTimer1_Servo(void); void enableServo(void); void disableServo(void); void setServoPosition(void); // Realtime-clock handling functions // Use the globals ticks, hours, minutes, seconds void initTimer0_Clock(void); void everyHour(void); void everyMinute(void); void everySecond(void);
Download
Make: AVR Programming by Elliot Williams.mobi
Make: AVR Programming by Elliot Williams.pdf
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Whiskies Galore by Ian Buxton(41493)
Introduction to Aircraft Design (Cambridge Aerospace Series) by John P. Fielding(32863)
Small Unmanned Fixed-wing Aircraft Design by Andrew J. Keane Andras Sobester James P. Scanlan & András Sóbester & James P. Scanlan(32537)
Craft Beer for the Homebrewer by Michael Agnew(17906)
Turbulence by E. J. Noyes(7665)
The Complete Stick Figure Physics Tutorials by Allen Sarah(7101)
Kaplan MCAT General Chemistry Review by Kaplan(6550)
The Thirst by Nesbo Jo(6409)
Bad Blood by John Carreyrou(6247)
Modelling of Convective Heat and Mass Transfer in Rotating Flows by Igor V. Shevchuk(6210)
Learning SQL by Alan Beaulieu(5999)
Weapons of Math Destruction by Cathy O'Neil(5785)
Man-made Catastrophes and Risk Information Concealment by Dmitry Chernov & Didier Sornette(5598)
Digital Minimalism by Cal Newport;(5329)
Life 3.0: Being Human in the Age of Artificial Intelligence by Tegmark Max(5152)
iGen by Jean M. Twenge(5129)
Secrets of Antigravity Propulsion: Tesla, UFOs, and Classified Aerospace Technology by Ph.D. Paul A. Laviolette(4870)
Design of Trajectory Optimization Approach for Space Maneuver Vehicle Skip Entry Problems by Runqi Chai & Al Savvaris & Antonios Tsourdos & Senchun Chai(4812)
Electronic Devices & Circuits by Jacob Millman & Christos C. Halkias(4706)
