[C.CC USERS] HIGH and LOW and interrupts problem

Laurence Laycock rencio7 at gmail.com
Wed Aug 11 16:05:05 BST 2010


Hi Laurence here (:
(Here<http://docs.google.com/leaf?id=0B0w0YgMynq6wMWZkMTY3NWQtNzc1OS00OWRlLWIzNzEtYTU3OWRiODNkNDI4&hl=en&authkey=CLyWgZoE>is
a link to my robot code and rencio7.module)
Firstly here are some things I found  when doing my robot code which need
fixing (well these aren't too high priority but still...) :


   - * HIGH* and *LOW* with *digital.write* (*plumbing.module*) doesn't work
   and  other commands such as *digital.output *(*digital.module*) I get
   type mismatch errors.. try 0 and 1 instead....it works...this should be
   fixed easily in the library...I'll try and do it lol..although not high
   priority I guess....
   - *button.press PROC* only works with pins 1,2 or 3...it doesn't work
   with all the others (arduino atmega328) error code: - error status
   E....final machine state: file=external.interrupts.module line 37....maybe
   there is a reason for this?
   - *writing.module* only works (compiles) if I delete the lines 101 - 108
   of it... yay
   - my use of byte.tick PROC(in rencio7.module) ...for motor pwm needs to
   be possible without it....probably is...I'd like to know how...D:

Just a couple of things to report - I haven't had that much time to tweak my
robot code recently though.
A few more things : -


   1. When running a sequence can I loop it? If not how do I do an if
   statement to tell it that if the sensor is not HIGH run it again...?
   2. I'm trying to trigger a pin to high or low when triggering a sharp 5cm
   sensor (which just reports 0 or 1) It works when using button.press on a
   motor pin but I tried it on pin 9 (the enablepin1 of the h-bridge) -but the
   motor doesn't move - I'm guessing that toggle only uses 1 or 0 values so due
   to pwm 1 is too little to move the motor..or not. :X

My next step is to do some robot simple avoidance and to run this when
triggering a sensor : -
(this will be just a set of PROC I've made)

   *goStop()*
*    delay (500)*
*    goStart()*
*    goBackward()*
*    delay(500)*
*    goLeft()*
*    delay(500)*
*
*
How would I send a signal from a pin to trigger a PROC and if that trigger
is LOW run a different one?
I'm trying to port code from arduino and I'm getting confused...my head is
still trapped in C -I've tried drawing some code diagrams like in plumbing
pdf but I'm unsure of some ways to do some things...even though I have
OccamDocs....

*Any help would be greatly appreciated.*
*
*
I plan to use concurrency as my main coding base for arduino if it continues
to develop (it is promising). I have a lot of code I would like to try
porting to it.
----
My future projects will include porting polulu wheel encoders to occam some
lcd serial stuff ...definitely some led matrix work with shift registers...

Laurence (:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.concurrency.cc/pipermail/users/attachments/20100811/3c213bc2/attachment.htm>


More information about the users mailing list