Hello Bascom friends, i have been using bascom for a while to do some home projects and a few projects at work also.
All the projects i have worked on until now are low level projects, What I mean by low level projects is that my expertise with µControllers is not too advanced, i would like to learn to write code for a project which can run multiple tasks at the same time, so far the projects i've worked on have not required this kind of tasks.
I now need to write code for a project that consists of a bluetooth module interfaced with an Atmega168, so far i have some code that works but the tasks are sequentially executed, and i would like to do it so that 2 or 3 things happen at the same time. for example.
the bluetooth module transmits the ADC reading from the µController to my Android Phone, (I have that part covered, i wrote an application which communicates between my Android phone and the Bluetooth module on the µController), at the same time if i press on a button on the phone i want a motor to start running. This is where it gets tricky for me, i have a do loop... that handles all the processing from the serial buffer, if i receive for example the string "L1" from the phone then an LED connected to one of the pins on the Atmega168 turns on, if I receive a string "L0" then the LED turns off, the problem is that i want to run the motor with PWM but i want to vary the speed of the motor, a slider on the android application will set the speed on the motor, the problem is that i can't figure out how to do this in a do loop..
In conclusion, if i would like to write code that handles multiple tasks at the same time without hanging other subs in the µController.
Ewwww i made myself dizzy trying to explain this, i hope you guys grasp my dilemma, i would like to get you guy's help, not writing the code for me, but by pointing in the right direction and giving me some tips or advice on how to accomplish this.
In Advance thanks to everyone, and i hope i can get help from you all.
Cheers,
Walter
[b:a3d1880daf][color=red:a3d1880daf](BASCOM-AVR version : 2.0.7.6 )[/b:a3d1880daf][/color:a3d1880daf]
↧