22.03.2012, 15:26
hast Du Dir mal das Beispiel angeschaut mit dem Temp Sensor?
We choose an LM335Z temperature sensor which has 10mV/C output and 2.73V at 0C.
I can write MM Basic code to read the temperature as simple as this :
20 SETPIN 9,1
30 PRINT (PIN(9)-2.73)*100
On the first line I tell MM Basic that I want to use PIN number 9 on the DuinoMite connector as an Analog input.
On the second line I calculate and print the temperature.
Now tell me what amount of time you would need to write same code in C or Arduino if there is no libraries for it? You have to study the PIC32 datasheet, to initialize a lot of registers and debug your code etc.
You will lose HOURS for what I did in SECONDS.
This is the charm of MM Basic.
Now let's assume we need to store the temperature in a log file, all we have to do is to add two new lines of code:
10 OPEN "TEMP-LOG.TXT" FOR OUTPUT AS #1
and to modify 30 as:
30 PRINT #1, (PIN(9)-2.73)*100
and now we have a temperature data logger.
If I want to add the Date and Time stamp in the results I again will modify the line 30:
30 PRINT #1, DATE$, TIME$, (PIN(9)-2.73)*100
and now I will have date/time stamp before the temperature logged
einfacher geht es nicht!
In Assembler sicherlich extrem komplex wegen SD-Karten Zugriff und in C ohne Compiler und passenden Unterroutinen (fast) unlösbar
We choose an LM335Z temperature sensor which has 10mV/C output and 2.73V at 0C.
I can write MM Basic code to read the temperature as simple as this :
20 SETPIN 9,1
30 PRINT (PIN(9)-2.73)*100
On the first line I tell MM Basic that I want to use PIN number 9 on the DuinoMite connector as an Analog input.
On the second line I calculate and print the temperature.
Now tell me what amount of time you would need to write same code in C or Arduino if there is no libraries for it? You have to study the PIC32 datasheet, to initialize a lot of registers and debug your code etc.
You will lose HOURS for what I did in SECONDS.
This is the charm of MM Basic.
Now let's assume we need to store the temperature in a log file, all we have to do is to add two new lines of code:
10 OPEN "TEMP-LOG.TXT" FOR OUTPUT AS #1
and to modify 30 as:
30 PRINT #1, (PIN(9)-2.73)*100
and now we have a temperature data logger.
If I want to add the Date and Time stamp in the results I again will modify the line 30:
30 PRINT #1, DATE$, TIME$, (PIN(9)-2.73)*100
and now I will have date/time stamp before the temperature logged
einfacher geht es nicht!
In Assembler sicherlich extrem komplex wegen SD-Karten Zugriff und in C ohne Compiler und passenden Unterroutinen (fast) unlösbar