The sub-folders in this folder contain the source code for all the pages on this site.
For the development of these pages the sketchbook location was "C:\00rmit\Projects\sites\Programs". To view in the Arduino IDE from the tool bar select File-->Preferences:
Every Arduino Sketch/Program will create a sub-folder that is the name of the sketch and includes the sketch ( That is the *.ino file). This site uses exactly the same directory of sub-folders. Each contains the source code for the project as a text file. If readers wish to duplicate the projects then if they copy the file(s) into the Arduino IDE and save the project with the same name they will end up with the same file structure given on this page under their sketchbook location.
The main sketch is the *.ino. For classes there will also be an implementation file *.cpp and a header file *.h. All files should have the same name (but different extension).
To duplicate a project in the Arduino create a new file. ie File-->New and copy paste the *.ino. Save it with the same name.
With classes it is necessary to add two additional files.
1.In the Arduino IDE click on the inverted triangle near the top right of the screen and select New_Tab.
2.Create 2 new files both with the same name but one with extension *.cpp and the other *.h
3.Copy/paste the sample code.
The program should compile and run. (It may be necessary to edit some embedded tags from the files, For example web pages use "<" as part of a tag but it is also a programming symbol).
If it is necessary to create a library
1.Create a *.zip file of the *.cpp and *.h files
2.In the Arduino IDE select Sketch-->Add Library-->Add *.zip library and select the file.
The Arduino will now create a library of the same name - it will be located in the preferences folder under the sub-directory libraries.
The page LDR_Sensor_Class gives a detailed example of developing a project that includes a class and generates a library.
Testing_LDR: Testing Light Detecting Resistor
LDR_Sensor_Class: Project develops a library/class for an LDR sensor/detector.
LDR_Overload_Class: Overloads LDR_Sensor_Class to give a programmable filter delay. (Default is 1 second)
LDR_Analog_Class: Modifies LDR_Sensor_Class/LDR_Overload_Class when analog pins are used to use analog readings.
LDR_Serial_Sensor_Class: Develops a library/class to read many sensors via a parallel to serial converter.
Testing_IR: Testing the performance/limitations of an IR detector
IR_Sensor_Class: Project develops a library/class for an LDR sensor/detector.
LCD_ROM_Class: Project that reads all the bit patterns from ROM for an LCD display.
LCD_Init_Class: Project Initialises an LCD
LDR_Signals_RAG_Class: Project uses LDRs to detect a train and sends signals through a RED, AMBER, GREEN sequence
Signals3_Serial_Class: Project controls RED-AMBER-GREEN signal via serial to parallel convertor.
Single_Track_Class: Project controls signals at both ends of a single track. Examples uses LDR sensors.
IR_Single_Track_Class Project controls signals at both ends of ONE or TWO single track. Examples uses IR sensors.
DCC_Probe: Project captures DCC message bytes on model train track.
DCC_Debug Project duplicates DCC_Probe to decode message bytes.
DCC_Function: Project builds on DCC_Probe to return give loco/function value.
Track_Trains: Project tracks position of train using 4 sensors and controls signals
Dsp_Train_State: Enhances project Track_Trains to display state on serial monitor.
Track_Train_ESP: Using ESP8266 to monitor sensors/flash signals and display state on serial monitor.
Track_Train_ESP_Class: Converts Track_Train_ESP into a class to hide implementation details.
Dsp_State_ESP13: Messages now sent over WiFi via ESP13
WiFi_123: Project reviews 3 different wifi techniques
WiFi_Mess: Project enhances HTML display using placeholders and tags.
WiFi_SSE: SSE (Service Sent Events) updates HTML display without client request.
WiFi_Train_State Adds WiFi to Track_Train_ESP_Class to send train state to Smartphone
WiFi_Train_SSE Adds WiFi SSE to Track_Train_ESP_Class: to send train location to smartphone.
LDR_ESP_WiFi_SSE Senses train position, sends location to smartphone and controls signals
Multiple WiFi ESP_NOW to WiFi AP code: Multiple ESP_NOW stations that send train status to central ESP_NOW that acts as a WiFi AP
Coal_Basin: A number of projects that build a control system for a model railyard known as the Coal Basin.
Coal_Basin_Control: Umbrella project that inherits:
LCD_1602_Class (LCD Display). Coal_Basin_Buttons (Reads toggle switches), Coal_Basin_LEDs (Displays chosen routes)
Coal_Basin_Servos (Servos to drive points) Coal_Basin_Signals. (Signals to indicate point positions)
Servo_Tester Separate program used to determine required servo settings.
DCC NCE Bus Project that (i) monitors the NCE bus and (ii) injects commands to control accessories.