Go Down

Topic: Using Serial.begin with ATtiny85 (Read 1 time) previous topic - next topic

nitwit

Apr 08, 2013, 04:45 pm Last Edit: Apr 12, 2013, 09:01 pm by Coding Badly Reason: 1
Hi peeps,
my first attempt at programming an Arduino, so please make it simple for me.......... :)

I have eventually managed to get some code working fine on the Arduino Uno, and have managed to program an ATtiny 85 with some simpler code using the Arduino as ISP...... but when I transfer the full code (excerpt below) to the ATTiny85 it stops at the Serial.begin(9600);
saying that 'serial was not declared in this scope'
HELP please:

Code: [Select]
#include<multiCameraIrControl.h>
Sony A900(0); //changed pin number from 9

#define RX_SIGNAL_IN 0
#define RX_SIGNAL_IN_PIN 1 //changed pin number from 2

#define NEUTRAL_RX 1500
volatile int nRXIn = NEUTRAL_RX;
volatile unsigned long ulStartPeriod = 0;
volatile boolean bNewRXSignal = false;

void setup()
{
 
 attachInterrupt(RX_SIGNAL_IN,calcInput,CHANGE);

 Serial.begin(9600);
}

void loop()
{

if(bNewRXSignal)
{
 
if(nRXIn >1600)
{




Moderator edit: [code] [/code] tags added.

Erni

I don't think your problem is the Serial.begin(9600);

It is more likely the multiCameraIrControl library you include.

Where did you get it ?



fungus


I don't think your problem is the Serial.begin(9600);


Yes it is.

The ATtiny85 doesn't have a serial port.
No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

Erni

Quote
Yes it is.

The ATtiny85 doesn't have a serial port.


This sketch wil work perfectly well on a Attiny85.
It use TinyDebugSerial, which is part of this core:

https://code.google.com/p/arduino-tiny/


Code: [Select]

void setup() {
Serial.begin(9600);
}

void loop() {
Serial.println("Testing..");
}

fungus


This sketch wil work perfectly well on a Attiny85.
It use TinyDebugSerial, which is part of this core:


Is he using that core?
No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

Go Up