Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Revision:
- 2:65d319447726
- Parent:
- 1:d9a739fe837e
- Child:
- 3:2566acb12c47
--- a/main.cpp Sun Mar 06 11:38:08 2016 +0000
+++ b/main.cpp Sun Mar 06 12:05:15 2016 +0000
@@ -7,6 +7,9 @@
AnalogIn voltage(p20); // AnalogIn is a class of anlog input, p20 is the pin you use for anlog input,
// You can change the pin from pin15 to pin20
Serial pc(USBTX, USBRX); // Communicate with PC through the serial
+
+DigitalOut high_pin(p5); //test pin, p5 is the high level pin
+DigitalOut low_pin(p6); //test pin, p6 is the low level pin
float mass; // The mass of the object
unsigned short int mass_trans; // A 8 bits mass used for transmitting
@@ -14,6 +17,10 @@
int main()
{
SerialInit(); //Initial the serial
+
+ high_pin = 1;
+ low_pin = 0;
+
while(1)
{
MassCompute(voltage.read());