Just can't figure out what is wrong with this code...snippit
I keep getting an error message on the following code, and I am sure it is something simple that I am overlooking...
··· SELECT gallons_of_water
····· CASE > 7 AND· <= 49
······· average_error_of_sensor = 17
····· CASE > 49 AND· <= 109
······· average_error_of_sensor = 31
····· CASE > 109 AND· <=186
······· average_error_of_sensor = 21
····· CASE > 186 AND <= 255
······· average_error_of_sensor = 11
··· ENDSELECT
Thanks to all...Deno
··· SELECT gallons_of_water
····· CASE > 7 AND· <= 49
······· average_error_of_sensor = 17
····· CASE > 49 AND· <= 109
······· average_error_of_sensor = 31
····· CASE > 109 AND· <=186
······· average_error_of_sensor = 21
····· CASE > 186 AND <= 255
······· average_error_of_sensor = 11
··· ENDSELECT
Thanks to all...Deno
Comments
' {$STAMP BS2} ' {$PBASIC 2.5} gallons_of_water VAR Byte average_error_of_sensor VAR Byte SELECT gallons_of_water CASE > 7, <= 49 average_error_of_sensor = 17 CASE > 49, <= 109 average_error_of_sensor = 31 CASE > 109, <=186 average_error_of_sensor = 21 CASE > 186, <= 255 average_error_of_sensor = 11 ENDSELECT
case > 7 and CASE <= 49
you have to supply another variable because the AND thinks your comparing more then one variable at a time.
The help section in the STAMP IDE V2.1 shows AND as an acceptable Conditional Logic Operator. Why can't it be used? Is the table in the IDE help in error?
SELECT gallons_of_water CASE 8 TO 49 average_error_of_sensor = 17 CASE <= 109 average_error_of_sensor = 31 CASE <=186 average_error_of_sensor = 21 CASE <= 255 average_error_of_sensor = 11 ENDSELECT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
OS-X: because making Unix user-friendly was easier than debugging Windows
links:
My band's website
Our album on the iTunes Music Store