Post a new topicPost a reply Page 1 of 1   [ 2 posts ]
Author Message
 Post subject: problems with writing correct code
PostPosted: Sun Feb 12, 2012 3:00 pm 

Joined: Sun Feb 12, 2012 2:54 pm
Posts: 1
Hello i'm new in your forum and not so good in C language programming.
Can somebody help to me to write a maybe simple programfor you but not and for me.:(
i want to use waspmote module with gsm/gprs board.
i use 4 inputs and 4 outputs from board pinouts. inputs to detect logic "0" or logic "1".When change state to logic (1) is detected, ex. led1 turn ON and send email using my own smtp server,same situation when change state to logic (0) send another email with another text and led1 goes OFF.The same thing for all 4 inputs/and 4 outputs with leds.
please help me to write proper code.
my begin of code is here but can't continue
i hope some help.sorry for my bad EN

void setup(){

// setup for Serial port over USB
USB.begin();
USB.println("USB port started...");

// setup for GPRS seial port
GPRS.ON();
USB.println("GPRS module ready...");
// waiting while GPRS connects to the network
Utils.blinkLEDs(1000);
// waiting while GPRS connects to the network
while(!GPRS.check());
USB.println("GPRS connected to the network");

// waiting while GPRS connects to the network
while(!GPRS.check());
USB.println("GPRS connected to the network");

// configure SMS and Incoming Calls
if(GPRS.setInfoIncomingCall()) USB.println("Info Incoming Call OK");
if(GPRS.setInfoIncomingSMS()) USB.println("Info Incoming SMS OK");
if(GPRS.setTextModeSMS()) USB.println("Text Mode SMS OK");

// Setting Digital 1 as an input
pinMode(DIGITAL1,INPUT);

// Setting Digital 2 as an input
pinMode(DIGITAL2,INPUT);

// Setting Digital 3 as an input
pinMode(DIGITAL3,INPUT);

// Setting Digital 4 as an input
pinMode(DIGITAL4,INPUT);

// Setting Digital 5 as an output
pinMode(DIGITAL5,OUTPUT);

// Setting Digital 6 as an output
pinMode(DIGITAL6,OUTPUT);

// Setting Digital 7 as an output
pinMode(DIGITAL7,OUTPUT);

// Setting Digital 8 as an output
pinMode(DIGITAL8,OUTPUT);

}
long time=0;


Top
 Profile  
 
 Post subject: Re: problems with writing correct code
PostPosted: Mon Feb 13, 2012 2:25 pm 

Joined: Mon Sep 28, 2009 1:06 pm
Posts: 7516
Hello kukata86,

I can see this is your first post and probably you have Waspmote since few days ago. First of all we advice you to read all the documentation and all the examples. According to your needs, specially (1) Waspmote Tech Guide and (2) GPRS, (3) RTC and (4) Energy and Power Programming Guides:
http://www.libelium.com/support/waspmote
http://www.libelium.com/development/waspmote

Be sure to read the examples:
http://www.libelium.com/development/waspmote
there are examples for reading digital I/Os:
http://www.libelium.com/development/waspmote/example038

You could start by dividing your project into several tasks. Basically:
- control time/date (it is important in almost any project)
- read input
- light LEDs
- send email
- sleep (optional but recommended to enlarge the battery life)


For example, you could do a simple code which detects 1/0 in one digital input. Also, some sketch controlling the RTC (time/date). After that, you can do a program which makes missing calls (GPRS). After that, a code for sending an SMS. After that, a code which sends an email. Then you can get it all together and mix the last code with the first one.

As you will know, we are Wireless Sensor Networks hardware manufacturers. On addition to that, we provide with a complete software system to control our hardware and comprehensive documentation. We are committed to support the clients in the development process through the forum, but we cannot implement the final solution for each project.

Some clients just do not want to implement the software for their projects and prefer us to do it for them, or maybe they find it complicated. In these cases we offer special services like:
1. a number of one-to-one support hours with one engineer on our online e-learning platform. You can have direct line with one of our experts and if you like we can access your desktop in a remote way.
2a. general training courses which are a great introduction to our systems.
2b. specific training course, focusing on the features and modules you need to handle.
3. customized engineering: you can let us know the list of tasks your system needs to work out, and our R&D Dept. can develop all the project for you.


Please visit this area regarding training: http://www.libelium.com/products/training
and this one about custom engineering: http://www.libelium.com/products/services

Do not hesitate to ask any questions you may have.

Best regards
PD: do not worry about English, we are not natives either


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 2 posts ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Libelium theme based on 610nm Style by Daniel St. Jules of http://www.gamexe.net


© Libelium Comunicaciones Distribuidas S.L. | Terms of use