To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.legosOpen lugnet.robotics.rcx.legos in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / legOS / 1197
1196  |  1198
Subject: 
Re: legOS battery life code
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Wed, 5 Jul 2000 17:22:42 GMT
Viewed: 
1416 times
  
Sorry! I forgot to post the code. Here it is:

#include <dsensor.h>
#include <dlcd.h>
#include <conio.h>


int get_battery_mv() {
long b;
int mv;

b = BATTERY;
b = ds_scale(b) * 0xABD4L;
mv = b / 0x618L;
return mv;
}


int main(int ac, char **av) {
int b;

b = get_battery_mv() / 100;
cls();
cputc_hex_3(b / 10);
cputc_hex_2(b % 10);
dlcd_show(LCD_3_DOT);
cputc_1('v');

sleep(1);
dlcd_hide(LCD_3_DOT);
cls();

return 1;
}



Message is in Reply To:
  legOS battery life code
 
Hello, I recently received some code in the mail that when compiled and uploaded to the RCX is supposed to give you the battery life. But when I go to compile it, legOS/util/makelx gives me the following error message: single byte different at (...) (24 years ago, 5-Jul-00, to lugnet.robotics.rcx.legos)

2 Messages in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR