writing LIGHT readings to eeprom
mbreihan
Posts: 3
I am working on a school project and we have hit a roadblock in our programming. We have two photometers hooked up to the Basic stamp and trying to get them to take alternating light·readings and saving them to eeprom. perhaps someone out there can find the flaw in our program?
writing program
' {$STAMP BS2}
' {$PBASIC 2.5}
z VAR Word
x VAR Word
cnt VAR Word
cnt2· VAR Word
eepromAddress VAR Byte
S0· CON 0
S1· CON 1
S2· CON 2
S3· CON 3
S4· CON 6
S5· CON 7
S6· CON 8
S7· CON 9
HIGH S0
HIGH· S1
LOW· S2
LOW S3
LOW· 4
HIGH· S4
HIGH· S5
LOW S6
LOW S7
LOW 10
FOR z=1 TO 5
FOR x=1 TO 1
COUNT 5, 1000, cnt
FOR eepromAddress = 0 TO 9 STEP 2
· WRITE eepromAddress, Word cnt
NEXT
DEBUG DEC cnt, CR
NEXT
PAUSE 1000
FOR x=1 TO 1
COUNT 11, 1000, cnt2
FOR eepromAddress = 10 TO 19 STEP 2
· WRITE eepromAddress, Word cnt2
NEXT
DEBUG DEC cnt2, CR
NEXT
PAUSE 2000
NEXT
END
reading program
reading program
' {$STAMP BS2}
' {$PBASIC 2.5}
cnt VAR Word
cnt2 VAR Word
eepromAddress VAR Byte
FOR eepromAddress = 0 TO 9 STEP 2
· READ eepromAddress, Word cnt
· DEBUG DEC2 eepromAddress, " ", DEC cnt, CR
NEXT
FOR eepromAddress = 10 TO 19 STEP 2
· READ eepromAddress, Word cnt2
· DEBUG DEC2 eepromAddress, " ", DEC cnt2, CR
NEXT
END
writing program
' {$STAMP BS2}
' {$PBASIC 2.5}
z VAR Word
x VAR Word
cnt VAR Word
cnt2· VAR Word
eepromAddress VAR Byte
S0· CON 0
S1· CON 1
S2· CON 2
S3· CON 3
S4· CON 6
S5· CON 7
S6· CON 8
S7· CON 9
HIGH S0
HIGH· S1
LOW· S2
LOW S3
LOW· 4
HIGH· S4
HIGH· S5
LOW S6
LOW S7
LOW 10
FOR z=1 TO 5
FOR x=1 TO 1
COUNT 5, 1000, cnt
FOR eepromAddress = 0 TO 9 STEP 2
· WRITE eepromAddress, Word cnt
NEXT
DEBUG DEC cnt, CR
NEXT
PAUSE 1000
FOR x=1 TO 1
COUNT 11, 1000, cnt2
FOR eepromAddress = 10 TO 19 STEP 2
· WRITE eepromAddress, Word cnt2
NEXT
DEBUG DEC cnt2, CR
NEXT
PAUSE 2000
NEXT
END
reading program
reading program
' {$STAMP BS2}
' {$PBASIC 2.5}
cnt VAR Word
cnt2 VAR Word
eepromAddress VAR Byte
FOR eepromAddress = 0 TO 9 STEP 2
· READ eepromAddress, Word cnt
· DEBUG DEC2 eepromAddress, " ", DEC cnt, CR
NEXT
FOR eepromAddress = 10 TO 19 STEP 2
· READ eepromAddress, Word cnt2
· DEBUG DEC2 eepromAddress, " ", DEC cnt2, CR
NEXT
END
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
Matt