Sign in

username:

password:



Not a member?

Search basicx



Search tips

Subscribe to basicx



basicx by Keywords

Accelerometer | ADC | ADXL | Adxl20 | AVR | BasicStamp | BX-35 | BX28 | BX35 | COM3 | Compiler | Downloader | EEPROM | Electromagnet | GetADC | GP2D1 | GPS | I2C | IDE | Keypad | LCD | LCD+ | MIDI | Motors | Multitasking | Netmedia | Networking | PCB | PID | PlaySound | PWM | Relays | RTC | Servo | ShiftOut | SitePlayer | SPI | Stack | Timer | USB

Ads

Discussion Groups

See Also

DSPFPGAElectronics

Discussion Groups | BasicX | LowByte / High Byte


Advertise Here

Discussion forum for the BasicX family of microcontroller chips.

LowByte / High Byte - Eric - Mar 13 21:59:00 2003

I am using the MotorMind C

Got it to work the first time

The Serial Send is

&D0,&01,&04,Mot1HighByte,Mot1LowByte,Mot2HighByte,Mot2LowByte,CheckSum I have to send the motor PWM in High/Low byte Format (0-1024)

I sould like to increment or decrement one variable per motor, and
then break it up into High and low.

Is there a way to assign a Variable to the High and Low bytes. Kind
of like the BasicStamp has

Motor Var Word
MotHigh Var Motor.Highbyte
MotLow Var Motor.LowByte So If I update Motor then MotLow and MotHigh follow suit.

Make Sense?

Thanks for any help,
Eric



______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.


(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )


Re: LowByte / High Byte - Frank Manning - Mar 17 18:24:00 2003

From: "Eric" <>

> [...]
> Is there a way to assign a Variable to the High and
> Low bytes. Kind of like the BasicStamp has
>
> Motor Var Word
> MotHigh Var Motor.Highbyte
> MotLow Var Motor.LowByte
>
> So If I update Motor then MotLow and MotHigh follow suit.
> [...]

Reminds me of the bad old days of Fortran's equivalence
statements. BasicX doesn't have anything equivalent, but you can
directly copy memory from one block to another, which allows you
to interpret a given bit pattern as a different type. This allows
you to sidestep BasicX's strong typing. Example:

Dim Motor As Integer
Dim Split(1 To 2) As Byte

Motor = &H1234

Call BlockMove(2, MemAddressU(Motor), MemAddressU(Split))

' High byte, Split(2) = &H12
' Low byte, Split(1) = &H34

-- Frank Manning
-- NetMedia, Inc.


______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.


(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )