2008-09-15 14:09:13 -07:00
|
|
|
#ifndef WProgram_h
|
|
|
|
#define WProgram_h
|
|
|
|
|
2007-10-06 06:02:43 -07:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <math.h>
|
|
|
|
|
|
|
|
#include <avr/interrupt.h>
|
|
|
|
|
|
|
|
#include "wiring.h"
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
2010-12-03 20:12:41 -08:00
|
|
|
#include "WCharacter.h"
|
2010-07-04 09:36:52 -07:00
|
|
|
#include "WString.h"
|
2007-10-06 06:02:43 -07:00
|
|
|
#include "HardwareSerial.h"
|
|
|
|
|
2008-10-26 05:31:45 -07:00
|
|
|
uint16_t makeWord(uint16_t w);
|
|
|
|
uint16_t makeWord(byte h, byte l);
|
2008-10-25 05:52:07 -07:00
|
|
|
|
|
|
|
#define word(...) makeWord(__VA_ARGS__)
|
|
|
|
|
2008-03-08 13:30:00 -08:00
|
|
|
unsigned long pulseIn(uint8_t pin, uint8_t state, unsigned long timeout = 1000000L);
|
|
|
|
|
2009-12-29 12:57:07 -08:00
|
|
|
void tone(uint8_t _pin, unsigned int frequency, unsigned long duration = 0);
|
|
|
|
void noTone(uint8_t _pin);
|
|
|
|
|
2007-11-21 09:08:07 -08:00
|
|
|
// WMath prototypes
|
2007-10-06 06:02:43 -07:00
|
|
|
long random(long);
|
|
|
|
long random(long, long);
|
|
|
|
void randomSeed(unsigned int);
|
2007-11-21 09:08:07 -08:00
|
|
|
long map(long, long, long, long, long);
|
2010-05-15 21:05:40 -07:00
|
|
|
|
2010-09-08 15:33:33 -07:00
|
|
|
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
|
2010-05-15 21:05:40 -07:00
|
|
|
const static uint8_t A0 = 54;
|
|
|
|
const static uint8_t A1 = 55;
|
|
|
|
const static uint8_t A2 = 56;
|
|
|
|
const static uint8_t A3 = 57;
|
|
|
|
const static uint8_t A4 = 58;
|
|
|
|
const static uint8_t A5 = 59;
|
|
|
|
const static uint8_t A6 = 60;
|
|
|
|
const static uint8_t A7 = 61;
|
|
|
|
const static uint8_t A8 = 62;
|
|
|
|
const static uint8_t A9 = 63;
|
|
|
|
const static uint8_t A10 = 64;
|
|
|
|
const static uint8_t A11 = 65;
|
|
|
|
const static uint8_t A12 = 66;
|
|
|
|
const static uint8_t A13 = 67;
|
|
|
|
const static uint8_t A14 = 68;
|
|
|
|
const static uint8_t A15 = 69;
|
|
|
|
#else
|
|
|
|
const static uint8_t A0 = 14;
|
|
|
|
const static uint8_t A1 = 15;
|
|
|
|
const static uint8_t A2 = 16;
|
|
|
|
const static uint8_t A3 = 17;
|
|
|
|
const static uint8_t A4 = 18;
|
|
|
|
const static uint8_t A5 = 19;
|
|
|
|
const static uint8_t A6 = 20;
|
|
|
|
const static uint8_t A7 = 21;
|
|
|
|
#endif
|
|
|
|
|
2007-10-06 06:02:43 -07:00
|
|
|
#endif
|
2008-09-15 14:09:13 -07:00
|
|
|
|
|
|
|
#endif
|