mirror of
https://github.com/digistump/DigistumpArduino.git
synced 2025-09-17 17:32:25 -07:00
Add OLED library - update tiny wire libraries - add support for all PWM channels and PWM on pin 8
This commit is contained in:
@@ -103,6 +103,11 @@ int digitalRead(uint8_t);
|
||||
int analogRead(uint8_t);
|
||||
void analogReference(uint8_t mode);
|
||||
void analogWrite(uint8_t, int);
|
||||
void pwmWrite(uint8_t, int);
|
||||
void pwmConnect(uint8_t);
|
||||
void pwmDisconnect(uint8_t);
|
||||
void pwmReset(void);
|
||||
|
||||
|
||||
unsigned long millis(void);
|
||||
unsigned long micros(void);
|
||||
@@ -160,8 +165,8 @@ extern const uint8_t PROGMEM digital_pin_to_timer_PGM[];
|
||||
#define TIMER1B 4
|
||||
#define TIMER1D 5
|
||||
|
||||
#define CHANNELA 3; //TIMER1A
|
||||
#define CHANNELB 4; //TIMER1B
|
||||
#define CHANNELA 3 //TIMER1A
|
||||
#define CHANNELB 4 //TIMER1B
|
||||
|
||||
#include "pins_arduino.h"
|
||||
|
||||
|
@@ -1,35 +0,0 @@
|
||||
/*
|
||||
Stream.h - base class for character-based streams.
|
||||
Copyright (c) 2010 David A. Mellis. All right reserved.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef Stream_h
|
||||
#define Stream_h
|
||||
|
||||
#include <inttypes.h>
|
||||
#include "Print.h"
|
||||
|
||||
class Stream : public Print
|
||||
{
|
||||
public:
|
||||
virtual int available() = 0;
|
||||
virtual int read() = 0;
|
||||
virtual int peek() = 0;
|
||||
virtual void flush() = 0;
|
||||
};
|
||||
|
||||
#endif
|
@@ -185,15 +185,15 @@ void analogWrite(uint8_t pin, int val)
|
||||
uint8_t timer = digitalPinToTimer(pin);
|
||||
|
||||
|
||||
/*
|
||||
if( timer == TIMER0B){
|
||||
// connect pwm to pin on timer 0, channel B
|
||||
sbi(TCCR0A, COM0B1);
|
||||
cbi(TCCR0A, COM0B0);
|
||||
OCR0B = val; // set pwm duty
|
||||
} else
|
||||
*/
|
||||
|
||||
if( timer == TIMER0A){
|
||||
// connect pwm to pin 8 on timer 0, channel A
|
||||
sbi(TCCR0A, COM0A1);
|
||||
cbi(TCCR0A, COM0A0);
|
||||
sbi(TCCR0A, WGM01);
|
||||
sbi(TCCR0A, WGM00);
|
||||
OCR0A = val; // set pwm duty
|
||||
} else
|
||||
|
||||
if( timer == TIMER1A){
|
||||
// connect pwm to pin on timer 1, channel A
|
||||
|
Reference in New Issue
Block a user