File tree Expand file tree Collapse file tree 4 files changed +8
-7
lines changed
Learn/Simple Libraries/Robotics/S3/libs3 Expand file tree Collapse file tree 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.
7474
7575*/
7676
77- // ------ Libraries and Definitions ------
78- #include "simpletools.h"
79- #include "s3.h"
80-
81-
82-
83- // ------ Main Program ------
8477int main ()
8578{
8679
Original file line number Diff line number Diff line change @@ -702,6 +702,7 @@ int32_t s3_ping(int32_t Pin)
702702 return result ;
703703}
704704
705+ // User EEPROM read/write functions
705706void s3_memoryWrite (int32_t Addr , int32_t Value ) {
706707 int AddrMax = (32768 - SCRIBBLER_EE_USER_AREA ) / 4 ; // 7936
707708 if (Addr >= 0 && Addr < AddrMax ) {
@@ -711,4 +712,9 @@ void s3_memoryWrite(int32_t Addr, int32_t Value) {
711712
712713int32_t s3_memoryRead (int32_t Addr ) {
713714 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 ;
714720}
Original file line number Diff line number Diff line change 3636#define S3_COLOR_00FF00 (SCRIBBLER_GREEN)
3737#define S3_OFF (0)
3838#define S3_COLOR_000000 (S3_OFF)
39+ #define S3_ADC_A0 (SCRIBBLER_ADC_P6)
40+ #define S3_ADC_A1 (SCRIBBLER_ADC_P7)
3941
4042
4143
You can’t perform that action at this time.
0 commit comments