;********************************************************************************* ; gpspeed-test-print GpSpeed test motor's ; Louse@RotaryRacer ;********************************************************************************* ; ; Shows how to print diagnostics messages and data back to the PC's terminal. ; You need to start off the Terminal from the PicAxe programming editor and ; set the baudrate to 2400 to see the messages. ; ; GpSpeed pins are: ; B.1 LED ; C.2 Motor PWM ; C.1 Fan PWM ; A.0 Analogue Input 0, I0, throttle ; A.1 Analogue Input 1, I1, misc ; A.2 Analogue Input 2, Votage measurement ; A.3 Analogue Input 3, Current measurement (Hall effect) ; B.4 Analogue/Digital Input, I2 ; ; B.2 Analogue Input 8, Current measurement (Raw) ; B.0 Error, error from Motor PWM ; C.3 I2C Clk ; C.4 I2c DAT ; C.0 User 0, I2c Int ; B.3 User 1 ; C.6 SER1 TX ; C.7 SER1 RX ; init: let adcsetup = %000000000000111 ; Initialises ADC inputs pwmout C.2, 49, 150 ; Initialises PWM hardware to 20khz and 75% duty cycle gloop: readadc10 A.3, w0 ; Read the ADC value of the hall effect current sensor sertxd ("Current value: ", #w0, 13, 10) ; Print a message with the ADC current value, followed by CR NL (A new line) pause 1000 ; Delay for 1 second goto gloop