File tree 4 files changed +8
-7
lines changed
Learn/Simple Libraries/Robotics/S3/libs3
4 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -74,13 +74,6 @@ the Test Utility, cycle the Scribbler//s power switch.
74
74
75
75
*/
76
76
77
- // ------ Libraries and Definitions ------
78
- #include "simpletools.h"
79
- #include "s3.h"
80
-
81
-
82
-
83
- // ------ Main Program ------
84
77
int main ()
85
78
{
86
79
Original file line number Diff line number Diff line change @@ -702,6 +702,7 @@ int32_t s3_ping(int32_t Pin)
702
702
return result ;
703
703
}
704
704
705
+ // User EEPROM read/write functions
705
706
void s3_memoryWrite (int32_t Addr , int32_t Value ) {
706
707
int AddrMax = (32768 - SCRIBBLER_EE_USER_AREA ) / 4 ; // 7936
707
708
if (Addr >= 0 && Addr < AddrMax ) {
@@ -711,4 +712,9 @@ void s3_memoryWrite(int32_t Addr, int32_t Value) {
711
712
712
713
int32_t s3_memoryRead (int32_t Addr ) {
713
714
return scribbler_ee_read_byte ((Addr * 4 ) + SCRIBBLER_EE_USER_AREA );
715
+ }
716
+
717
+ // Return the ADC reading in volt-hundreths
718
+ int32_t s3_readADC (int32_t p ) {
719
+ (scribbler_get_results (p ) * 500 ) >> 16 ;
714
720
}
Original file line number Diff line number Diff line change 36
36
#define S3_COLOR_00FF00 (SCRIBBLER_GREEN)
37
37
#define S3_OFF (0)
38
38
#define S3_COLOR_000000 (S3_OFF)
39
+ #define S3_ADC_A0 (SCRIBBLER_ADC_P6)
40
+ #define S3_ADC_A1 (SCRIBBLER_ADC_P7)
39
41
40
42
41
43
You can’t perform that action at this time.
0 commit comments