I am fairly new to arduino, I am attempting to make a low power bare bones micro possessor atmega328p to take in analog sensor information to convert to digital then send over fsk to my anrdoid using the soft modem library. I have changed the fuses on the atmege328p to use the internal 8mhz oscillator and the board is working at 2.7v, but my problem i face now is the soft modem library (that works fine at 16mhz) will not send a good reading to the phone. any suggestions are greatly appreciated
this is the link for the sofrmodem http://code.google.com/p/arms22/downloads/detail?name=SoftModem-005.zip&can=2&q=
this is my sketch
| #define F_CPU 1000000UL | // 1 MHz, 16MHz is 16000000UL |
| #include <util/delay.h> | // Delay functions library, delay values based on F_CPU. |
// Automatically sets UART baud rate registers based on F_CPU.
#include <SoftModem.h>
#include <ctype.h>
SoftModem modem;
unsigned int val = 0;
unsigned char PIN = 0;
void setup()
{
Serial.begin(9600);
pinMode(PIN,INPUT);
delay(1000);
modem.begin();
}
void loop()
{
val = analogRead(PIN);
modem.println(val);
Serial.println(val);
delay(1000 );
while(modem.available()){
| int c = modem.read(); | ||
| if(isprint(c)){ | ||
| Serial.println((char)c); | ||
| } | ||
| else{ | ||
| Serial.print("("); | ||
| Serial.print(c,HEX); | ||
| Serial.println(")"); | ||
| } |
}
if(Serial.available()){
| modem.write(0xff); | |
| while(Serial.available()){ | |
| char c = Serial.read(); | |
| modem.write(c); | |
| } |
}
}