3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

picaxe code help?

here is the code for a breathnalayzer using picaxe14m2 
ignore the if b2= as i have to experiment and get the values and i havent done so.
the code stores messages in eeprom and in the starting it operates a rgb led to create effects

the code:
low B.0'initialise lcd outpu
pause 500'wait for lcd to initialise
'load messages in eeprom
EEPROM 0,("NO ALCOHOL")
EEPROM 10,("ONE OR TWO DRINKS")
EEPROM 27,("BUZZED")
EEPROM 33,("DRUNK")
EEPROM 38,("WASTED")
EEPROM 44,("BLOW ON THE SENSOR FOR 5 SEC")

high b.2'red
pause 2000
low b.2
high b.3'green
pause 2000
low b.3
high b.4'blue
pause 2000
low b.4
pause 1000
high b.3,b.4'sky blue
pause 2000
low b.3,b.4
pause 1000
high b.2,b.4'pink
pause 2000
low b.2,b.4
pause 1000
high b.3,b.2'yellow
pause 2000
low b.3,b.2
pause 1000
high b.2,b.3,b.4'white
pause 2000
low b.2,b.3,b.4
pause 1000

for b0=45 to 75 'print blow on the sensor
read b0,b1
serout B.0,n2400,(254,1,b1)
next b0
   
main:readadc B.1,b0
     if b2=54 then main1
     if b2=45 then main2
     if b2=45 then main3
     if b2=45 then main4
     if b2=245 then main5
     goto main
    
main1:high b.3'on green led
      for b3= 0 to 9'print no alcohol
      read b3,b4'read eeprom locations 0to10
      serout b.0,n2400,(254,1,b4)
      next b3
      low b.3
      goto main
     
main2:high b.4'on blue led
      for b5= 11 to 27
      read b5,b6
      serout b.0,n2400,(254,1,b6)
      next b5
      low b.4
      goto main
     
main3:high b.3'sky blue
      high b.4
      for b7= 28 to 33
      read b7,b8
      serout b.0,n2400,(254,1,b8)
      next b7
      low b.3
      low b.4
      goto main
     
main4:high b.3'yellow
      high b.2
      for b9= 34 to 38
      read b9,b10
      serout b.0,n2400,(254,1,b0)
      next b9
      low b.3
      low b.2
      goto main
     
main5:high b.2'red danger
      for b11= 39 to 44
      read b11,b12
      serout b.0,n2400,(254,1,b12)
      next b11
      low b.2
      goto main

5 answers
sort by: active | newest | oldest
Jan 13, 2012. 5:55 AMBot1398 says:
Yes,the code will work as expected

R
Jan 6, 2012. 1:23 AMrickharris says:
You would/will be FAR FAR better off asking these specific Picaxe questions in their forum, they are very friendly - Give it a try.
Jan 5, 2012. 11:28 PMsteveastrouk says:
And what's the problem ?

STeve

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!