I am have extreme difficulty trying to adapt from "basic STAMP" configuration to"Arduino"
and am hoping someone out there can help me regain my sanity.
The following is how I initialised the STAMP program and it doesn't what form of Arduino opening address I use I can't get beyond this stage.
Could someone please transform the following to Arduino intellegence? :-[
secs VAR Byte ' byte counts to to 255
Mans VAR Byte
tries VAR Nib ' Nib counts from 0 to 15
Setup:
INPUT 1
INPUT 2
INPUT 3
GreyW_Off PIN 1 ' float switch closes on rise
GreyW_on PIN 2 ' float switch closes on rise
Man_Start PIN 3 ' momentry make watering sequence for back
OUTPUT 8
OUTPUT 9
OUTPUT 10
Power_On PIN 8 ' this OP turn 240V supply to pumps on
Pump_Select PIN 9 ' this selects when activated grey water pump or tank pump when not activated
Valve1 PIN 10 ' section one for watering back garden
secs VAR Byte ' byte counts to to 255
Mans VAR Byte
tries VAR Nib ' Nib counts from 0 to 15
=============================
byte secs;
byte Mans;
byte tries; // No nybble data type
----------------------------------------------------
Setup:
INPUT 1
INPUT 2
INPUT 3
GreyW_Off PIN 1 ' float switch closes on rise
GreyW_on PIN 2 ' float switch closes on rise
Man_Start PIN 3 ' momentry make watering sequence for back
========================
const int GreyW_Off = 1;
pinMode (GreyW_Off, INPUT);
etc
---------------------------------------------------------
OUTPUT 8
OUTPUT 9
OUTPUT 10
Power_On PIN 8 ' this OP turn 240V supply to pumps on
Pump_Select PIN 9 ' this selects when activated grey water pump or tank pump when not activated
Valve1 PIN 10 ' section one for watering back garden
=========================
const int Power_On = 8;
...
pinMode (Power_On, OUTPUT);
I have tried many times to get my programming started but I always come up with a programming error. The following program has been written I believe as dictated by the DigitalRead tutorial.
RESULT
error: function 'void setup()' is initialized like a variable
can you advise me where I have gone wrong please?
int GreyW_Off =0; //' float switch closes on rise
int GreyW_On =1; //' float switch closes on rise
int Man_Start = 2; //' momentry make watering sequence for back
int Power_On =8; //' this OP turn 240V supply to pumps on
int Pump_Select = 9; // ' this selects when activated grey water pump or tank pump when not activated
int Valve1 = 10; // ' section one for watering back garden
Spend some time reading ladyada's tutorials. You need a good grounding in the basics, otherwise you'll constantly be running into little problems like this
You can probably start with lesson 2 - it sounds like you know how to plug it in and open the IDE
BTW, everyone will be happy if you use the "code" tags when posting your code here - it makes it SO much easier for everyone to read. The button looks like a "#" in the toolbar above the input box.
(Hint: you are using "straight" brackets to enclose the setup function, you need to use "curly" brackets.)