C :: Wireless Surveillance System Using Arduino And Zigbee?
Feb 11, 2014
I am trying to implement same thing as given in following images:
i m working on "Wireless surveillance system using zigbee".
But i want to add external PIR motion sensor and wireless zigbee module with Arduino.
The images are stored in SD card. but my goal is when the PIR detects any motion the image should be stored in memory card (Done in attached code)and then that image should be transferred through zigbee (Zigbee Tx is connected with Rx Pin0 and zigbee Rx is connected with Tx Pin1). PIR sensor output is connected with Pin7 of arduino.
So what are the additions/modifications do i require for transmitting image on Pin1 in following code.
I am using this code
Code:
// This is a motion-detect camera sketch using the Adafruit VC0706 library.
// On start, the Arduino will find the camera and SD card and turn
// on motion detection. If motion is detected, the camera will
// snap a photo, saving it to the SD card.
#include <Adafruit_VC0706.h>
#include <SD.h>
how to pass a string from vb6 into the gsm module ... i am posting vb6 code ... below code passes
check1.caption=11BNELE0455 to MSCOMM2.output...
Static col As Integer
col = 3 lbl: If excelws.Cells(10, col).Value = "" Then excelws.Cells(9, col).Value = Format(Now, "dd/mm/yyyy") If (check1.Value = 1) And (Timer1.Enabled = True) Then excelws.Cells(10, 1).Value = check1.Caption
[Code]...
now i want to access this string a=0455 from c-code of arduino..how can i access this.. below is c-code for arduino uno.what is wrong with it.it is giving me error:invalid conversion from 'int' to 'const char*'.
//decalaration part of my code
#include <SoftwareSerial.h> char inchar[80][5]; // Will hold the incoming character from the GSMshield SoftwareSerial SIM900(7, 8); String textForSMS;
Okay so this is part of a small uni module around the arduino board. The task is to simulate traffic lights at a junction. At the moment my code below runs through the sequence with 2 seperate lights. When one set of lights turns RED , the other turns GREEN.In my main loop method I need to add a button for a crossing. I want to be able to check if the button is pressed at each of the delays but do not want to have to hold it down.I have thought about putting it at the top of the loop but then the program will only check if button is pressed in that point therefore the user will have to hold it down?
Code:
int green1 = 13 ; int amber1 = 12 ; int red1 = 11 ;
int green2 = 6 ; int amber2 = 7 ; int red2 = 8 ; }
I know how to create your basic programm that compiles as a CLI or exports and/or saves data to a .txt file... But how does one build a GUI?
I ask because I am currently working on a programm for my Arduino controlled robot, in which I want to have a virtual on screen controller next to a map of my bots path.
I am working on a project that requires using an arduino microcontroller to control the motion of a servo motor. The arduino language is pretty much C.
The original code is of the form:
Code: #include <Servo.h>
Servo myservo; // create servo object to control a servo // a maximum of eight servo objects can be created
int pos = 0; // variable to store the servo position
[Code] .....
But the problem is I don't want the motor's motion to behave linearly (constant increments of the pos variable). My desired motion is a sinusoidal like function. How to approach this?
I am quite new to programming, especially with microcontrollers. My guess is that instead of the pos+=1, I would need something like pos+=sin(argument). I am not sure what that argument should be.
I am building a project with an Arduino Uno that involves using analogue IR sensors to detect fast motion. By placing one sensor on top of the other, I want to be able to attain a variable integer from the difference in time between the responses of the sensors.
Here is my code I have so far, it is essentially for detecting motion for 1 sensor and then converting it into a MIDI note depending on how far away the motion is detected. There is also a part which compares the value from the previous time so that only above a certain amount of movement will trigger the note. I also have a variable delay to be controlled by a potentiometer.
Here is the datasheet for the sensors I'm using.
#include <MIDI.h> MIDI_CREATE_DEFAULT_INSTANCE();
int currentvalA = 0; //current sensor A value int previousvalA = 0; //previous sensor A value int valA = 0; // value to store sensor const int valchangeA = 40; //motion change value int del = 0; //variable delay value
But now I'm trying to use this to point to a function inside a class so instead of do11, i want to be able to point to Basic.Do11. Somehow this doesnt work and I keep on getting this message:
error: argument of type 'void (Basic::)()' does not match 'void (*)()'
I just started my task with Ordering system. what should I use if I'm going to ask the user if he wants to exit the system, he will press(zero)0 to exit the program and press Y(uppercase or lowercase) to continue?
Here's the objective of the program: "Instead of using ABCDEFGHIJ to order letters use DCBAJIHGF go order. The program should determine which 4-letter word is larger of two based on this new ordering system."
Not even sure how to start with this problem , how would I go about defining my own ordering system?
You are required develop a computerized GPA evaluation system of your class using array. The basic idea is to calculate the GPA (Grade Point Average) of each subject and then calculate the GPA of whole semester of all the students of the class and on the basis of that GPA calculate the grade and remarks of each student of the class. Suppose that the total students of the class are 50. Your system must also provide the facility of the following:
1.Searching a student result according to his/her roll number. 2.Updating the obtained marks of the students in case of any mistake in entering marks. 3.Display the result of student who is the topper of the class 4.Display the result of the student who got minimum CGPA out of the class. 5.Display how many number of students got greater than or equal to 3.0 CGPA. 6.Display how many number of students got greater than or equal to 2.00CGPA and less than 3.00. 7.Display the total number of students who got A grade in the semester. 8.Display the total number of students who got B grade in the semester. 9.Display the total number of students who got C grade in the semester. 10.Display the total number of students who got F grade in the semester.
Detailed Description: You are required to take the student’s marks for four subjects (Programming fundamentals, Calculus, English and Computing) as input from the user at runtime. After that calculate the GPA of each subject and the whole semester. Assume that total marks of a subject are 100 and each subject is of 3 credit hours except programming fundamentals. Programming fundamentals subject has 4 credit hours.
Complete Assessment system is given below in the table:
S.#Percentage (%)GradeGPARemarks 185-100A4Excellent 280-84A-3.75Very Good 375-79B+3.50Good 470-74B3.0Satisfactory 565-69C+2.50Above Average 660-64C2.0Average 755-59D+1.50Pass 850-54D1.0Just Pass 9Below 50F0Fail
Table: Assessment Scheme •Percentage of a subject = (obtained marks / total marks) * 100. Percentage works to find the grade of the student. •GPA of whole semester = multiply GPA of each subject according to the percentage of obtained marks by the number of credit hours for that course, sum up the GPA of all the subjects, and then divide this sum by the total number of credit hours taken in semester.
For example suppose the GPA in subject X is 2.5, in subject Y 2.6, and in subject Z is 3. Assuming that each subject is of 3 credit hours then GPA of whole semester will be calculated as: GPA= (3 * (2.5 + 2.6 + 3)) / 9 GPA= 2.7
On the basis of Semester GPA, you have to give grade and remarks to the student. You have to study the above table for other types of remarks according to grade.
•If a student has less than 50 marks in a subject, a message should display that “you have to repeat this subject “.
I code login form. In the textbox I want to clear if there are some text or close form if there's nothing. The problem is System beep sound occured when the text is cleared. Here's my code
So Scenario is like this,A Gym has owned a Software to maintain record of employee and customer, everything is ready now only reminder system is to be made. Reminder system is like for example if customer comes to gym and inquires about plan and fees and says call back him at so and so time, so receptionist will require reminder system to alert him at the time given by customer for call back.
What i have done
1.Created a Listview to show reminder list, and created two button ADD reminder and DELETE reminder When reminder is added following things are added in Reminder table in Database
i.ID ii.Title iii.Message iv.Time v.Date
2.when i display the reminder table in reminder listview, the order will be in (Date, time)asecnding order.
---Till here everything is done---
Now i am confused here, lets take example The first Reminder in Listview is around 3.00 clock, when the time is reached i want to show message that "call back this customer".
So to do this i was thinking of using timer and on each tick compare Current time with Reminder time, if equals display message, but this method is inefficient it can freeze my UI.
The Alternate way i was thinking to run this timer inside Background worker as it would create a different thread there will be no issue with my application.
I can't debug anything and get an error whenever I try. Being able to release a program to run it works sometimes, but it's hit or miss. I've created a very simple program to show the problem. The error on the screen is a result of me trying to debug, but I actually received the same error when trying to release as well.
I need to take the system time and turn it into this format: 03:20 PM, Tuesday March 17, 2015. I am suppose to use 3 enumerators for the day of the week, the month, and AM or PM. I am having a lot of trouble with converting the system time to year, month, day, hour and minute. I also know there are a lot of functions that would make this more than simple, but I have to do the calculations and use enumerators. Here is what I have so far:
What I want to do is abstract and model a device (more specifically in this case, an IMU) in an embedded system.
Now, there are a couple of gotchas:
- It is basically a framework, which means that it should work with any device, any platform and any bus.
- It is an embedded system, so power consumption and memory consumption must be reduced. It is not a PC.
- It cannot be too complex, because I fear that will just make people scrap it and rewrite it from scratch :P
- It should aim for as little code as possible to write the whole model, of course. Adding 100 lines of code for each register would be a bummer.
That said, I must also model the current system, which means that the current platform, the current bus (which is I2C) and the specific IMU model (I have a datasheet). So the model I am thinking of currently is this:
First, I have a platform. It will know what bus a device is connected on and contains the buses (or specifically, the instances of the buses). It consists of a specific class for each platform and a base. Here are the two I have now:
Code: namespace Sensors { template<typename Platform_t> class GPS; } namespace Platforms { class RaspberryPi: public PlatformBase
[Code]....
Currently I am making the assumption that all platforms will have an I2c bus and UART bus, but I'm not sure about that. We have only one platform ATM, though, so for now this holds. I'm guessing I might have to move it to the specific platforms later and get rid of PlatformBase.GetI2CBus is a problematic one related to registers, but I'll get back to that.
UART is simple to model since it's just a block read and write, so:
I'm probably going to handle all errors through exceptions. So if I can't open the UART bus, I'll throw an exception.
The I2C bus is a problem. I have a model which deals with it on a register-based level, but ideally I'd like to be able to model and use the devices on the I2C bus on a flag-based level (ie, I have names for each individual flag in the registers which I can read or write to directly instead of writing a hexadecimal value directly to each register).
Here is code:
Code: namespace Buses { template<unsigned int Id> class I2CDevice { public: I2CDevice(I2C& Bus): m_Bus(Bus) {} template<typename T>
[Code]....
So I2CDevice does some checks to see that the data to write to a register is either 8 or 16 bits. It does not check that the size to write matches the register's size, but another class does not.
The idea is also that it checks which device is currently active on the bus, and if it's not the current I2CDevice, then it simply selects that before attempting to read or write (the Open call).
This is not meant for multi-threaded environments. Yet, anyway.
The Impl2::Read/Write just dispatches the call so it calls the correct function for writing and reading the correct size, depending on the size of the data.
This is all well and good, but I2C works with registers, so of course I want a class to model a register which I can read and write to directly. It must tie into the bus class since the bus class is the one that abstracts reads and writes on the bus.
The register class looks like:
Code: template<unsigned int Bits, unsigned int RegisterId, typename Bus_t> class Register { public: typedef typename Impl::RegisterBase<Bits>::Storage_t Storage_t; static_assert(!std::is_same<Bus_t, Buses::UART>::value, "Cannot read and write registers on the UART bus."); static_assert(Bits == 8 || Bits == 16 || Bits == 32 || Bits == 64, "Number of bits must be 8, 16, 32 or 64."); auto Write(Storage_t Data) -> void
[Code]....
I think this explains itself, except for the Regs struct, which is an experiment by me to enable myself to access registers via Regs.Config, etc.
What is missing is the ability to access and read/write the individual bits inside the registers. I am thinking a two-way access, where you can write to individual bits, but must call .Write() to commit the write to the register for efficiency.
I haven't actually written this. I don't know a good way ATM. I don't want to add a lot of variables and a write function because that would use 1 byte for every bit which is unacceptable.
I don't want to add a lot of code to make it work, either. A good get/set class would be nice, but I can't see that working. The register must store all state and any subsequent classes must not store any state or overhead will increase.
Finally, yes, I know a lot is incomplete and untested. It probably won't even compile. But that is for later. First is finishing the model.
It would be nice if things such as the platform and buses could be made static because there will only be one instance at any time, and that would save overhead if I don't have to store objects or references to them, but I haven't figured out how to achieve this.
I have made a complete solar system with key action for zoom in zoom out, moving along x, y, z axes on plus or minus and going up/down/right/left. I am now in a bit of a dilemma. I want to add a text window ( i have made my project in visual studio 2010 in win32 console application) where to put a text like a description of each planet to appear when i hit the left mouse button. E.g. When i click with the left mouse button the Venus planet I want a description to appear in my text window. However I don't know how to put make a text window and how to correctly define the picking methods... for now everywhere i hit the mouse button it appears in to the console that i hit the sun.
I am making a console based database system. Because I have to keep inserting, editing , deleting data blocks from my record file I have decided to use either vectors or list to store the all records. From the file I shall read the entire vector/list and work with it to add , remove or edit record and then again write the entire vector/list to the file again. I figured it would stop all the weird things that happen when directly working with the file. Is it an efficient way ?Or is it totally unnecessary ?Is there a better way?
I want to create a word game using c. My question is it possible to set questions and the system will randomly display each? If yes, what's the right code?
i'm writing a C code, can it can be compiled, however everytime I run this program, after I typed in the number the system will show Segmentation fault (core dumped).