no, ive used 2 different atmegas to make sure one wasnt damaged. the power light is on - on the adapter. also, i have 2 of these adapters im trying, just in case one is damaged. i usually order stuff in twos. to me this should be a simple thing lol, very confused. the breadboard setup is minimal, atmega, xtal, xtal caps, thats it. (the entire circuit is a receiver for weatherstation. but since it didnt work from get go, im working with stripped breadboard. also, on an uno without sdcard this works fine. im building it on a breadboard to stay with the 3.3v because i want to add the sdcard, but i cant even get it to spit out "hello world" to the pc lol.
// receive w/ sd card support. add clock?
#include <SD.h>
#include <SPI.h>
#include "nRF24L01.h"
#include "RF24.h"
const int chipSelect = 8; //sd card
const uint64_t pipe = 0xE8E8F0F0E1LL; //pipe
typedef struct{
float T; //temperature
float RH;
float HI;
float DP;
float pressure;
}
payload;
payload ard1;
RF24 radio(9,10);
void setup()
{
ADCSRA &= ~(1<<ADEN); //Disable ADC
ACSR = (1<<ACD); //Disable the analog comparator
DIDR0 = 0x3F; //Disable digital input buffers on all ADC0-ADC5 pins
DIDR1 = (1<<AIN1D)|(1<<AIN0D); //Disable digital input buffer on AIN1/0
// power_adc_disable();
Serial.begin(57600);
pinMode(7, OUTPUT); //write error
pinMode(8, OUTPUT); //cs sd card
// see if the card is present and can be initialized:
if (!SD.begin(chipSelect)) {
digitalWrite(7,HIGH); //error
// don't do anything more:
return;
}
Serial.println("card initialized.");
File dataFile = SD.open("datalog.csv", FILE_WRITE);
if (dataFile) { //file header
dataFile.println("Decimal Minutes (GPS): N32 31.581409999999998 W86 23.3472 Date: ");
dataFile.print("Temperature");
dataFile.print(",");
dataFile.print("Pressure");
dataFile.print(",");
dataFile.print("Humidity");
dataFile.print(",");
dataFile.print("Dew Point");
dataFile.print(",");
dataFile.println("Heat Index");
dataFile.close();
}
radio.begin();
radio.openReadingPipe(1,pipe);
radio.startListening();
}
void loop()
{
if ( radio.available() )
{
// Dump the payloads until we've gotten everything
boolean done = false;
while (!done)
{
// Fetch the payload, and see if this was the last one.
done = radio.read( &ard1, sizeof(ard1) );
Serial.print(ard1.T);
Serial.println(" oF");
Serial.print(ard1.pressure);
Serial.println(" in/Hg");
Serial.print(ard1.RH);
Serial.println(" % Hum");
Serial.print(ard1.DP);
Serial.println(" Dew Point");
Serial.print(ard1.HI);
Serial.println(" Feels like");
}
}
File dataFile = SD.open("datalog.csv", FILE_WRITE);
if (dataFile) {
dataFile.print(ard1.T);
dataFile.print(",");
dataFile.print(ard1.pressure);
dataFile.print(",");
dataFile.print(ard1.RH);
dataFile.print(",");
dataFile.print(ard1.DP);
dataFile.print(",");
dataFile.println(ard1.HI);
dataFile.close();
}
}